Discord.NETを使って開発することができます。
NuGetからDiscord.Netを入れればすぐ開発できます。
Example(公式):
https://github.com/discord-net/Discord.Net/blob/dev/samples/01_basic_ping_bot/Program.cs
Example:
c#
1using System;
2using System.Threading;
3using System.Threading.Tasks;
4using Discord;
5using Discord.WebSocket;
6
7namespace Example
8{
9 class Program
10 {
11 private readonly DiscordSocketClient _client;
12
13 static void Main(string[] args)
14 {
15 new Program().MainAsync().GetAwaiter().GetResult();
16 }
17
18 public Program()
19 {
20 _client = new DiscordSocketClient();
21
22 _client.Log += LogAsync;
23 _client.Ready += ReadyAsync;
24 _client.MessageReceived += MessageReceivedAsync;
25 }
26
27 public async Task MainAsync()
28 {
29 await _client.LoginAsync(TokenType.Bot, "Token");
30 await _client.StartAsync();
31
32 await Task.Delay(Timeout.Infinite);
33 }
34
35 private Task LogAsync(LogMessage log)
36 {
37 Console.WriteLine(log.ToString());
38 return Task.CompletedTask;
39 }
40
41 private Task ReadyAsync()
42 {
43 Console.WriteLine($"Logged In");
44
45 return Task.CompletedTask;
46 }
47
48 private async Task MessageReceivedAsync(SocketMessage message)
49 {
50 if (message.Author.isBot) {
51 return;
52 }
53
54 if (message.Content == "!ping") {
55 await message.Channel.SendMessageAsync("pong!");
56 }
57 }
58 }
59}