Just a bot template I usually use for my bots.
It's built using HostBuilder
& InteractionService
, which allows easy modification & good maintainability of the codebase.
Feel free to use it as a base for your own projects.
- Clone the repo or create new repository from this template
- (Optional) Rename
DiscordNetTemplate.sln
,src/DiscordNetTemplate
folder,src/DiscordNetTemplate/DiscordNetTemplate.csproj
to whatever name you want for the project. Then openDiscordNetTemplate.sln
in text editor & change allDiscordNetTemplate
references to your bot name. Then edit all namespaces to be also your bot name. - Replace
token
inappsettings.json
with your actual bot token, which can be obtained from you application's page on dev portal - Compile & run the app. If you did everything correctly - congrats!! your bot is online!
- By default bot comes with a single slash command -
/test
. The bot should register the command when it comes online. Run the command to test if it actually works - you should getHello There
in the response.