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 discord.js@v14.9.0
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.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。