A console based discord bot built with Node.JS and TypeScript.
Make sure you have Node.JS before starting.
- Clone the repo to your computer
git clone https://github.com/Dmitriy-Vas/ts-discord-bot.git
- Change directory into the project folder
cd ts-discord-bot
- Install the required dependencies
npm install
- Install bot as an npm module. This will let you use bot from any directory in the console
npm install -g
- Link the installed module to this folder to automatically update the module when any code changes happen
npm link
Now that ts-discord-bot is installed, you will need to set up your config.json
file. This can be done in few steps:
- Open the project folder in your file explorer.
- Rename the file
config-sample.json
toconfig.json
. (Note: Depending on your computer's settings you might not see the.json
part of the file name) - Change the bot settings with your own settings.
{
"token": "W2dEwPEUhBreMqcnGkr7ghi9u3TqdfvZXpyEhkZDHtZkKwCnv4svmLgT", // Your Discord token.
"prefix": ">" // Your prefix to use with commands.
}
After setting up the config.json
file, bot is ready to go. To run program, simply use the command gulp start
in the console. If you have setup your config.json
properly (and used the correct credentials) you should see an output similar to this
C:\ts-discord-bot>gulp start
[19:24:10] Using gulpfile C:\ts-discord-bot\gulpfile.js
[19:24:10] Starting 'lint'...
[19:24:12] Finished 'lint' after 1.5 s
[19:24:12] Starting 'build'...
[19:24:18] Finished 'build' after 5.83 s
[19:24:18] Starting 'start'...
[19:24:18] Finished 'start' after 94 ms
[19:24:18] [nodemon] 1.18.10
[19:24:18] [nodemon] to restart at any time, enter `rs`
[19:24:18] [nodemon] watching: C:\ts-discord-bot\src\**\*
[19:24:18] [nodemon] starting `node ./index.js`
Successfully logged as Dmitriy