Discord API library for Node.JS
- If you are already convinced about using nig-disutils, go to Getting Started
- To learn if nig-disutils is right for you, read everything below.
install now to help us!
npm i nig-dis-utils
index.js sample code
const DisUtils = require("dis-utils");
const token = 'your bot token';
const utils = new DisUtils(token);
utils.setActivity("[Dis-utils] best api ever");
utils.Handler("./comandos");
OBS: to work the handler create a folder called commands if you don't want to change it there in index.js
Test.js command code inside the commands folder
const Discord = require("discord.js")
const DisUtils = require("dis-utils");
module.exports = {
name: "test",
description: "test",
type: Discord.ApplicationCommandType.ChatInput,
run: async (client, interaction, disutils) => {
const cmds = new disutils()
const result = await cmds.consult("you api");
cmds.send(interaction, `${result}`, "channel");
}
}