fix(bot): 📝 more docs

This commit is contained in:
Leifer Mendez
2023-01-16 17:32:09 +01:00
parent e3c94a49d7
commit 98793d0cfc
12 changed files with 301 additions and 36 deletions

View File

@@ -14,6 +14,9 @@ export const fetchGithub = async (token: string) => {
},
}
)
const listUsers = data.json()
return listUsers
const listUsers = await data.json()
return listUsers.map((u: any) => ({
...u,
avatar_url: `${u.avatar_url}&s=80`,
}))
}

View File

@@ -0,0 +1,19 @@
/**
* GET API from OpenCollective
* @returns
*/
export const fetchOpenCollective = async () => {
const data = await fetch(
`https://opencollective.com/bot-whatsapp/members/users.json?limit=10&offset=0`,
{
method: 'GET',
}
)
const listUsers = await data.json()
return listUsers.map((u: any) => ({
html_url: u.profile,
avatar_url: u.image ?? 'https://i.imgur.com/HhiYKwN.png',
login: u.name,
id: u.MemberId,
}))
}