Discord bot example made in Discord.js (Javascript). Follow the instructions below to set up and run the discord bot.
- Easy to Setup
- Made for Slash Commands
- Up to date
Before you begin, ensure you have met the following requirements:
- You have a Discord account.
- You have latest Node.js installed.
- You have npm installed.
- You have git installed.
- Go to the Discord Developer Portal.
- Click on "New Application" and give it a name.
- You can choose between Personal or Team
- Agree to Discord Developer Terms of Service and Developer Policy
- You have created your Discord Bot.
- In the "General Information" tab, click "Copy" under "Application ID". Save this ID as it will be used in your code.
- In the "Bot" tab, click "Copy" under "TOKEN". Save this token as it will be used in your code.
Due to a recent update from Discord, you need to reset your bot token to be able to copy it.
Do not share your Discord Bot Token. Tokens shown in the example are no longer valid.
- Go to the "OAuth2" tab.
- Under "OAuth2 URL Generator", select "bot" and "application.commands".
- Under "Bot Permissions", select the permissions your bot will need.
- Copy the generated URL and open it in your browser.
- Select the server you want to add the bot to and authorize it.
git clone https://github.com/Rihanss/discordbot-example-v14.git
npm install
- Rename
example.env
to.env
- Fill the required values from with what have you saved from step 2.
TOKEN=YOURBOTTOKEN
CLIENTID=BOTID
node deploy
This also creates commands needed for your Discord bot to respond.
If you have found an issue with using this Discord bot example, feel free to submit an issue here or a pull request. I'll be happy to take a look
This repo is maintained in my spare time. If you like the example I've provided, please give it a star :)
This project is licensed under the MIT License.
The MIT License is a permissive license that allows for reuse, modification, and distribution of the software. You are free to use this software in any project, personal or commercial, as long as you include the original license and copyright notice in any distributed copies or substantial portions of the software.
For more details, see the LICENSE file.