dishook-bots
v1.1.0-fixed
Published
DisBots is a addon of [DisHook](https://npmjs.com/dishook) that can help you make bots easily.
Downloads
2
Readme
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
.channels
An object ofBot()
which returns every channel that theBot
instance is in.Embed()
An property ofBot()
which makes a newEmbed
instance.guilds
An object ofBot()
which returns every guild that theBot
instance is in.users
An object ofBot()
which returns every user in every guild that theBot
instance 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 theBot
instance.
Webhook(link)
- Makes a webhook instance
.send(message)
Sends a message to the Webhook channel from theWebhook
instace..sendFile(file)
Sends a file to the Webhook channel from theWebhook
instace..setAvatar(link)
Sets the Avatar of the Webhook from theWebhook
instance..setUsername(username)
Sets the Username for the Webhook from theWebhook
instance.