https://github.com/erwanlt/discord-bot
skeleton for a discord bot
https://github.com/erwanlt/discord-bot
Last synced: 10 months ago
JSON representation
skeleton for a discord bot
- Host: GitHub
- URL: https://github.com/erwanlt/discord-bot
- Owner: ErwanLT
- License: mit
- Created: 2021-11-17T09:01:57.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-17T15:24:35.000Z (over 4 years ago)
- Last Synced: 2025-07-18T04:31:27.577Z (11 months ago)
- Language: Java
- Size: 644 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Discord-bot
## create the bot
Go to following url
- [discord developers portal](https://discord.com/developers/applications)
and the click on the button **new application**

and choose a name for your bot

and click on **Create**
Normally you should see the application settings page, click on Bot

and then **Add bot** -> **Yes, do it!**
Now that your bot is created, you can find the bot token, copy it to the class BotConstant.
We will use this token to connect our bot to discord.
## Invite the bot to a channel
Return to the app settings and copy the application ID

go [here](https://discordapi.com/permissions.html) to add permission to your bot.

- Paste your application ID in the Client ID input.
- Click on the Administrator check box to activate it
- Click on the link in the bottom of the page
Now all you have to do, is to choose a server to invite the bot

Do the captcha and at the end in your server you should have a notification that the bot joined

## Adding new commands
To add new commands to your bot :
- Create a new class in the `commands` package
- Make it implement `CommandExecutor`
- Override the run methode with your code
- In `MessageManager`, add your command in the `CommandRegistry`.