-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
53 lines (44 loc) · 1.52 KB
/
Program.cs
File metadata and controls
53 lines (44 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using DSharpPlus;
using DSharpPlus.CommandsNext;
using System.Threading.Tasks;
using TeaBot.Commands;
using TeaBot.Commands.Moderation_Commands;
using TeaBot.Config;
namespace TeaBot
{
internal class Program
{
private static DiscordClient Client { get; set; }
private static CommandsNextExtension Commands { get; set; }
static async Task Main(string[] args)
{
var jsonReader = new JSONReader();
await jsonReader.ReadJSON();
var discordConfig = new DiscordConfiguration()
{
Intents = DiscordIntents.All,
Token = jsonReader.token,
TokenType = TokenType.Bot,
AutoReconnect = true,
};
Client = new DiscordClient(discordConfig);
Client.Ready += Client_Ready;
var commandsConfig = new CommandsNextConfiguration()
{
StringPrefixes = new string[] { jsonReader.prefix },
EnableMentionPrefix = true,
EnableDms = true,
EnableDefaultHelp = false
};
Commands = Client.UseCommandsNext(commandsConfig);
Commands.RegisterCommands<General>();
Commands.RegisterCommands<Moderation>();
await Client.ConnectAsync();
await Task.Delay(-1);
}
private static Task Client_Ready(DiscordClient sender, DSharpPlus.EventArgs.ReadyEventArgs args)
{
return Task.CompletedTask;
}
}
}