A Discord.js Chat Bot
This is a simple chatbot for Discord.js clients using the cleverbot.io API. If you need help or just want to chat, feel free to join the discord server.
Installation
- Get your API User and Key from https://cleverbot.io/keys
- Have a Discord app setup and a bot token
- In your working directory:
npm i discord.js-chatbot --save
Basic Usage
// First we require the Discord.js library.const Discord = ; // Now we make a new Discord.js Client.const client = ; // Lets put the chat bot data in the client for easier usage.clientchat = ; // Now, we start the chatbot!// Make sure your credentials are correct.// cleverUser, cleverKey and cleverNick are all required options.clientchat; // Now we login with the actual bot!client
Options
There are a few other options you can pass as well. However, these are not needed.
Option | Type | Default | Description |
---|---|---|---|
watchMention | Boolean | true | Whether or not to watch for messages starting with the clients mention. |
watchName | Boolean | true | Whether or not to watch for messages starting with the clients username. |
enableTyping | Boolean | true | Whether or not to send typing requests while fetching a response from cleverbot. |
ignoredServers | Array | [ ] | An Array of sever ID's to ignore from the chat bot. |
ignoredChannels | Array | [ ] | An array of channel ID's to ignore from the chat bot. |
Custom Options Example
const Discord = ;const client = ;clientchat = ; clientchat; client