Discord Cleverbot is an unofficial Discord interface for Cleverbot on Discord using node.js and discord.js, allowing you and your friends to chat with Cleverbot on Discord - providing an enjoyable time.
- Initial release
- Add slash commands
- Improve base and fix bugs
- Brand new README and weebsite and much more
- Clone the repository using
git clone
- Change directory to the cloned repository using
cd
- Install the dependencies using
npm install
- Configure the
.env
file, see Configuration - Start the bot using
npm run start
- Please remember that you will need to configure the
.env
file, see Configuration - Do not create any issues regarding Heroku deployment, as I will not be able to help you unless you have done this yourself
This method is untested and may not work.
- Create a new app on Heroku
- Make sure you have the Heroku CLI installed
- Clone the repository using
git clone
- Change directory to the cloned repository using
cd
- Login to Heroku using
heroku login
- Add the Heroku remote using
heroku git:remote -a <app name>
- Configure the
.env
file, see Configuration - Commit the changes using
git commit -am "Initial commit"
- Push the changes to Heroku using
git push heroku master
- Scale the bot using
heroku ps:scale worker=1
(optional) - View the logs using
heroku logs --tail
This method is untested and may not work.
- Create a new app on Heroku
- Make a fork of this repository on GitHub
- Connect your Github to Heroku and deploy the forked repository
- Configure the
.env
file, see Configuration - Scale the bot using
heroku ps:scale worker=1
(optional) - View the logs using
heroku logs --tail
- Create a new repl on Repl.it
- Select "Import from GitHub" and paste the repository URL
- Go into the secrets tab add the following secrets:
token
- Your Discord bot tokenport
- The port you want the bot to run on (default:3000
)
- Go onto your Glitch dashboard
- If it's your first time on Glitch: scroll down to "Import from GitHub" and paste the repository URL. Otherwise click "New Project" and select "Import from GitHub" and enter
https://github.com/darraghd493/DiscordCleverbot.git
. - Go into the
.env
file and add the following:token
- Your Discord bot token
Now remove the following:port
- The port you want the bot to run on (default:3000
)
- Hide the
.env
file by clicking on "Hide" (recommended - this will hide your bot token from the public) - Go into
index.js
and remove theapp.listener
, otherwise you will get an error about the port being in use.6. Open the console and runrefresh
- Install the dependencies using
npm install
- Run
npm run start
in the console
The following environment variables are required to run the bot:
Variable | Description |
---|---|
TOKEN |
The Discord bot token. |
PORT |
The port to run the web server on. |
You will need to create a new file to do this.
The configuration file is located at config.json
and contains the following options:
Option | Description | Default |
---|---|---|
activity.switch.enabled |
Whether to switch the bot's activity. | true |
activity.switch.delay |
The interval to switch the bot's activity. | 30000 |
activity.activities |
The activities to switch between. | [{"message":"Cleverbot for a response","type":"Watching"},{"message":"cb.help for help","type":"Playing"},{"message":"with Cleverbot","type":"Playing"},{"message":"with Discord","type":"Playing"}] |
activity.activities[].message |
The message to display. | null |
activity.activities[].type |
The type of activity. | null |
cache.limit |
The maximum number of messages to cache. | 5000 |
prefix |
The prefix to use for commands. | cb. |
- Go to the Discord Developer Portal
- Click "New Application"
- Give the application a name
- Click "Bot" on the left
- Click "Add Bot"
- Click "Copy" under "Token"
- Go to the Discord Developer Portal
- Click on your application
- Click "OAuth2" on the left
- Check the "bot" checkbox
- Select the permissions you want the bot to have
The bot will automatically respond to messages once a conversation has been started. To start a conversation, you can either mention the bot or use the start
command.
This project is licensed under the GNU General Public License v3.0.
- Cleverbot - The provider of Cleverbot
- Discord.js - The Discord API wrapper used for the bot
- Express - The web server used for the bot
- This bot does not use the API, and instead simulates the webpage with cleverbot-free, a package available on npm.
- Please forgive my mess of tags, I'm just trying to advertise this as it's something I've worked on for quite a while!