Built with Discord.js v14.9.0
Help and support docs can be found here: My Blog
To get started, first thing first, git clone this project:
git clone https://github.com/wtflmao/discord_bot_example.git
Then, create a config.json in the root directory discord_bot_example
.
config.json
looks like this:{ "token": "bot-token-goes-here", "clientId": "bot-clientid-goes-here", "guildId": "serverid-goes-here" }
-
If you don't know what a "bot token" is, then I guess you haven't created your own discord application yet.
Go to Discord Developer Portal to set up your first very own application and add a very new bot to it.
-
clientId is your bot's snowflake id.
-
guildId is your server's snowflake id.
-
After setting up that config.json thingy, you should run the following command to install discord.js:
cd discord_bot_example
npm install [email protected]
Then, use the following command to deploy your commands.
node deploy_commands.js
Then, use the following command to start your bot.
node .
or
node index.js
That's all.
Btw, my bot was built just for myself learning purpose, it isn't production-ready. I do NOT provide any warranty for this project.