An open API service indexing awesome lists of open source software.

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

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**

![](img/newApplication.png)

and choose a name for your bot

![](img/name.png)

and click on **Create**

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

![](img/appSetting.png)

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

![](img/applicationID.png)

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

![](img/permissions.png)

- 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

![](img/chooseServer.png)

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

![](img/botAdded.png)

## 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`.