The nodeJS API client for Discord.Exchange
BUILD-TOOLS ARE REQUIRED!
The alpha has not opened yet. PLease await for more info soon:tm:
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);
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.