<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp5.0</TargetFramework>
<StartupObject>Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Discord.Net" Version="3.1.0" />
<PackageReference Include="Discord.Net.WebSocket" Version="3.1.0" />
</ItemGroup>
</Project>
using System;
using Discord;
using Discord.WebSocket;
using System.Threading.Tasks;
namespace ConsoleApp1
{
public class Program
{
DiscordSocketClient client;
public static void Main(string[] args)
=> new Program().MainAsync();
private async Task MainAsync()
{
client = new DiscordSocketClient();
client.MessageReceived += CommandsHandler;
var token = "Secret";
await client.LoginAsync(TokenType.Bot, token);
await client.StartAsync();
Console.ReadLine();
}
private Task CommandsHandler(SocketMessage arg)
{
throw new NotImplementedException();
}
}
}