1.1.0-fixed • Published 3 years ago

dishook-bots v1.1.0-fixed

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

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 of Bot() which returns every channel that the Bot instance is in
  • .Embed() An property of Bot() which makes a new Embed instance
  • .guilds An object of Bot() which returns every guild that the Bot instance is in
  • .users An object of Bot() which returns every user in every guild that the Bot instance is in
  • .on(event, listener) A property of Bot() 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 the Bot instance.

Webhook(link) - Makes a webhook instance

  • .send(message) Sends a message to the Webhook channel from the Webhook instace.
  • .sendFile(file) Sends a file to the Webhook channel from the Webhook instace.
  • .setAvatar(link) Sets the Avatar of the Webhook from the Webhook instance.
  • .setUsername(username) Sets the Username for the Webhook from the Webhook instance.