1.1.0-fixed • Published 4 years ago
dishook-bots v1.1.0-fixed
DisBots
DisBots is a addon of DisHook that can help you make bots easily.
Example Usage
const { Bot } = require('dishook-bots')
const client = new Bot()
client.once('ready', () => {
console.log('Logged in as ' + client.getClientTag())
});
client.on('message', message => {
if (message.content == "ping") {
client.sendMessage('Pong!', message.channel)
// or
// message.channel.send('Pong!')
}
})
client.login('your-token-here')Sending Embeds
// <client> is your client variable
// == Put the code below inside your message event ==
const embed = <client>.Embed()
embed.setTitle('Hi this is a title')
embed.setDescription('and this is a description')
<client>.sendMessage(embed, message.channel)
// or
// message.channel.send(embed)Using Voice
Soon™
API
Classes
Bot() - Makes a new Bot instance
.channelsAn object ofBot()which returns every channel that theBotinstance is in.Embed()An property ofBot()which makes a newEmbedinstance.guildsAn object ofBot()which returns every guild that theBotinstance is in.usersAn object ofBot()which returns every user in every guild that theBotinstance is in.on(event, listener)A property ofBot()which does a certain action when an event occures..once(event, listener)Same as.on(), but it only does the action once..sendMessage(message, channel)Sends a message to a channel from theBotinstance.
Webhook(link) - Makes a webhook instance
.send(message)Sends a message to the Webhook channel from theWebhookinstace..sendFile(file)Sends a file to the Webhook channel from theWebhookinstace..setAvatar(link)Sets the Avatar of the Webhook from theWebhookinstance..setUsername(username)Sets the Username for the Webhook from theWebhookinstance.