Esp Customs OAuth
Clonado de disco-oauth, pero con compatibilidad con TypeScript y menos errores
Ejemplos completos: Demo, Esp Customs
1 - Instalar
npm i -S @espcustomss/oauth
2 - Usar
import { Client } from '@espcustomss/oauth';
export default new Client({
id: '681799808276758533',
secret: '<your_bot_secret>',
redirectURI: 'http://localhost:3000/auth',
scopes: ['identify', 'guilds']
});
...
const key = await client.getAccess('<code_from_discord>');
...
const user = await client.getUser(key);
const guilds = await client.getGuilds(key);