|
1 |
| -# Discord-Cleverbot |
| 1 | +# discord-cleverbot |
| 2 | + |
| 3 | +## cleverbot-free |
| 4 | +[](https://github.com/IntriguingTiles/cleverbot-free/actions/workflows/api.yml) |
2 | 5 |
|
3 | 6 | ## About
|
4 | 7 |
|
5 |
| -Discord-Cleverbot is a [Discord](https://discord.com/) bot developed in JavaScript that uses the node.js library of [cleverbot-free](https://www.npmjs.com/package/cleverbot-free) to give Cleverbot a presence on Discord. Through the bot, users are able to converse with the [Cleverbot chat bot](https://www.cleverbot.com/). The bot also hosts other features that help integrate it with the Discord chat environment. |
| 8 | +discord-cleverbot is a [Discord](https://discord.com/) bot that allows users to interact with the [Cleverbot chat bot](https://www.cleverbot.com/) on Discord. It is developed in [TypeScript](https://www.typescriptlang.org/) and relies on the [node.js](https://nodejs.org/) module of [cleverbot-free](https://www.npmjs.com/package/cleverbot-free). |
6 | 9 |
|
7 |
| -This project was started in December 2017 and developed periodically until September 2021. This included several ground-up rewrites to improve functionality, efficiency, and simplicity, resulting in a comparatively simple design today. |
| 10 | +It was originally started in December 2017 and has undergone several ground-up rewrites to improve functionality, efficiency, modernity, and simplicity. |
8 | 11 |
|
9 | 12 | ## Licensing
|
10 | 13 |
|
11 | 14 | Without a specific license, this code is the direct intellectual property of the original developer. It may not be used, modified, or shared without explicit permission.
|
12 |
| -Please see GitHub's [guide](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository) on licensing. |
| 15 | +Please see [GitHub's guide on licensing](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository). |
13 | 16 |
|
14 | 17 | ## Getting started
|
15 | 18 |
|
16 | 19 | ### Creating a bot
|
17 | 20 |
|
18 |
| -1. Create a new bot account in the [Discord developer portal](https://discord.com/developers/applications/) |
19 |
| -2. Copy the access token and application ID of your bot for later |
| 21 | +- Create a new bot account in the [Discord Developer Portal](https://discord.com/developers/applications/). |
| 22 | +- Copy the access token of your bot for later. |
20 | 23 |
|
21 | 24 | ### Setting up the code
|
22 | 25 |
|
23 |
| -3. Run `git pull https://github.com/JstnMcBrd/Discord-Cleverbot.git` to download the repo |
24 |
| -4. Go into the `/accounts` directory, duplicate the `ExampleUsername` folder, and rename it as the username of your bot |
25 |
| -5. Inside the new folder, edit `config.json` and replace `example-user-id` with the application ID and `example-token` with the access token |
| 26 | +- You will need an environment with [node.js v18](https://nodejs.org/en/download) installed (or use the Dev Container - see the [Development](#development) section below). |
| 27 | +- Run `git pull https://github.com/JstnMcBrd/discord-cleverbot.git` to clone the repo. |
| 28 | +- Create a new file called `.env` and add your access token, using [`.env.example`](./.env.example) as an example. |
26 | 29 |
|
27 | 30 | ### Running the code
|
28 | 31 |
|
29 |
| -6. In the top directory, run `npm install` to download all necessary packages |
30 |
| -7. Run `node deploy-commands.js [bot username]` to register slash commands with Discord |
31 |
| -8. Run `node index.js [bot username]` to start the bot |
| 32 | +- In the top directory, run `npm install` to download all necessary packages. |
| 33 | +- Run `npm run build` to build the project. |
| 34 | +- Run `npm run commands` to register slash commands with Discord. |
| 35 | +- Run `npm start` to start the bot. |
32 | 36 |
|
33 | 37 | ### Interacting with the bot
|
34 | 38 |
|
35 |
| -9. Use the URL in `/accounts/[bot username]/config.json` to add your bot to a server |
36 |
| -10. Use the `/whitelist` command in a channel to allow the bot to speak there |
37 |
| -11. Send messages in the whitelisted channel and watch the bot respond! |
| 39 | +- In the **OAuth2**>**URL Generator** tab in the Discord Developer Portal, generate an invite URL with the `applications.commands` scope. |
| 40 | +- Use the invite URL to add the bot to a server. |
| 41 | +- Use the `/whitelist` command in a channel to allow the bot to speak there. |
| 42 | +- Send messages in the whitelisted channel and watch the bot respond! |
| 43 | + |
| 44 | +## Development |
| 45 | + |
| 46 | +- [Visual Studio Code](https://code.visualstudio.com/) is the recommended IDE for development. |
| 47 | +- All settings are included as artifacts in the [`.vscode`](./.vscode) folder and will automatically apply. |
| 48 | +- You can use the built-in debugger and set breakpoints to troubleshoot the code. |
| 49 | + |
| 50 | +> If you want a standardized development environment, you can use the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) with the given [`devcontainer.json`](./.devcontainer/devcontainer.json) config to develop inside a [Docker](https://www.docker.com/) container with all dependencies and recommended extensions pre-installed. |
| 51 | +> |
| 52 | +> Simply install the extension and use the **Dev Containers: Open Folder in Container** command. |
0 commit comments