Skip to content

DiscordExchange/discordexchange.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discordexchange.js

npm version Dependency Status CircleCI Codacy Badge Known Vulnerabilities Greenkeeper badge Commitizen friendly FOSSA Status

The nodeJS API client for Discord.Exchange

BUILD-TOOLS ARE REQUIRED!

PLEASE READ THIS!!

The alpha has not opened yet. PLease await for more info soon:tm:

Usage

Client initialisation

You first need to initialise our little client. You need your API token and your bot's ID.

The following code would initialise a command with a bot ID of 1234567890 and a token of PlsRyGimmeSumOwO

const exchangeapi = require(discordexchange);
const ExchangeClient = new exchangeapi.ExchangeClient(PlsRyGimmeSumOwO, 1234567890);

Client authentication

Now you need to authenticate your client. This is only done once per session:

ExchangeClient.authenticate();

The function is promisfied, so you should use it as such:

ExchangeClient.authenticate().then("Oh hello!").catch("Sad boyes we were not authenticated");

Upon authenticated, the .then clause will fire. If you are not authenticated, the .catch clause will fire.

License

FOSSA Status