Skip to content

thegears/basic-discordoauth2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic Discord OAUTH2

Example Usage

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);
	});
})();

Releases

No releases published

Packages

No packages published