Skip to content

Template project for creating Discord bots with .NET, using the DSharpPlus library.

License

Notifications You must be signed in to change notification settings

warriordog/DotnetDiscordBotTemplate

Repository files navigation

DotnetDiscordBotTemplate

Template project for creating Discord bots with .NET, using the DSharpPlus library. Sample code is completely cross-platform and modular. This repository should also work with with Visual Studio, VS Code, Jetbrains Rider, or the dotnet CLI. Project files for Rider are included.

Features

  • Structured logging support
  • Configuration options through appsettings.json

Requirements

  • .NET 5

Setup

A few basic setup steps are required in order to run the sample bot. These are:

  1. Register a bot with the Discord Developer Portal, and get an auth / access token.
  2. Open a terminal / command prompt to the Main folder.
  3. Run dotnet user-secrets init.
  4. Run dotnet user-secrets set "DiscordAuth:DiscordToken" "INSERT TOKEN HERE", using the token from step 1.

Sample bot

The sample bot responds to bot!hello with Hello, world!. It will not join any servers on its own, so you will need to invite it to a server in the typical way. Make sure to assign the bot scope and request permission to send messages.

About

Template project for creating Discord bots with .NET, using the DSharpPlus library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages