Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thegears/basic-discordoauth2

Basic Discord OAUTH2
https://github.com/thegears/basic-discordoauth2

discord discordbasic discordoauth discordoauth2

Last synced: 22 days ago
JSON representation

Basic Discord OAUTH2

Awesome Lists containing this project

README

        

# Basic Discord OAUTH2

Example Usage

```js
const bdoa = require("basic-discordoauth2");
const Auth = new bdoa.Auth({
clientId: "client id",
clientSecret: "client secret",
redirectUri: "redirect uri",
scopes: ["identify", "guilds"]
});

(async () => {
let token = await Auth.Token("code");
let refreshToken = await Auth.RefreshToken(token.refresh_token);

await Auth.Guilds(refreshToken).then(a2 => {
console.log(a2);
});

refreshToken = await Auth.RefreshToken(refreshToken.refresh_token);

await Auth.Me(refreshToken).then(a2 => {
console.log(a2);
});
})();
```