0.3.8 • Published 5 years ago

hdapi.js v0.3.8

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

HD Development API

An API Wrapper for HD Development API

Instalation

npm install hdapi.js

API Token

Join our Discord server here then use the command: #!token to get your HD Development API Token.

Examples

With async/await

const Discord = require('discord.js');
const HDdev = require('hddapi.js');

const bot = new Discord.Client();

const HDapi = new HDdev({ token: "HD Development API Token", clientID: "your bot's user id" });

bot.on('ready', () => console.log("Ready!"));

bot.on('message', async message => {
    var args = message.content.split(" ").replace('.', '');

    if (messsage.content === '.bot') {
    try {
        var botData = await HDapi.getBot(args[0]);
        message.channel.send(`${botData.bot.tag} by ${botData.owner.tag} with prefix ${botData.prefix}`);
        } catch(error) {
        if(error.message === '[HDAPI] Bot not found') return message.channel.send('The bot ID you provide is not registered *yet* on HD Development');
        return console.log(error;
        } 
    }
});

bot.login('bot token');

With .then() Promises

const Discord = require('discord.js');
const HDdev = require('hdapi.js');

const bot = new Discord.Client();

const HDapi = new HDdev({ token: "HD Development API Token", clientID: "your bot's user id" });

bot.on('ready', () => console.log("Ready!"));

bot.on('message', message => {
    var args = message.content.split(" ").replace('.', '');

    if (messsage.content === '.bot') {
    try {
        HDapi.getBot(args[0]).then(botData => {
        message.channel.send(`${botData.bot.tag} by ${botData.owner.tag} with prefix ${botData.prefix}`);
        } catch(error) {
        if (error.message === '[HDAPI] Bot not found') return message.channel.send('The bot ID you provided is not registered *yet* on HD Developement.');
        }
        });
    }
});

bot.login('bot token');
0.3.8

5 years ago

0.3.7

5 years ago

0.3.6

5 years ago

0.3.5

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0-beta

5 years ago

0.2.8-beta

5 years ago

0.2.7-beta

5 years ago

0.2.4-beta

5 years ago

0.2.3-beta

5 years ago

0.2.1-beta

5 years ago

0.1.9-beta

5 years ago

0.1.8-beta

5 years ago

0.1.5-beta

5 years ago

0.1.4-beta

5 years ago

0.1.3-beta

5 years ago

0.1.0-beta

5 years ago

0.0.9-beta

5 years ago

0.0.8-beta

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago