This issue is dedicated to creating the base Discord bot for our project. We will use the .NET Wrapper DSharp+ for as simple as possible development. Essential information such as the bot's token will be securely stored in secrets.json.
Implementation
Here is a code snippet of a basic bot with a ping-pong functionality to see if the bot is responding:
var discord = new DiscordClient(new DiscordConfiguration()
{
Token = "My First Token",
TokenType = TokenType.Bot,
Intents = DiscordIntents.AllUnprivileged | DiscordIntents.MessageContents
});
discord.MessageCreated += async (s, e) =>
{
if (e.Message.Content.ToLower().StartsWith("ping"))
await e.Message.RespondAsync("pong!");
};
await discord.ConnectAsync();
Create Discord Bot
Objective
This issue is dedicated to creating the base Discord bot for our project. We will use the .NET Wrapper DSharp+ for as simple as possible development. Essential information such as the bot's token will be securely stored in
secrets.json
.Implementation
Here is a code snippet of a basic bot with a ping-pong functionality to see if the bot is responding:
For more info, check out the docs here