-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
50 lines (48 loc) · 1.55 KB
/
Copy pathProgram.cs
File metadata and controls
50 lines (48 loc) · 1.55 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
using DSharpPlus;
using DSharpPlus.CommandsNext;
using DSharpPlus.Interactivity;
using DSharpPlus.Interactivity.Extensions;
using DSharpPlus.SlashCommands;
using EasyDiscordWhitelister.Commands;
using EasyDiscordWhitelister.config;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace EasyDiscordWhitelister
{
internal class Program
{
private static DiscordClient Client { get; set; }
private static CommandsNextExtension Commands { get; set; }
public static async Task Main(string[] args)
{
var configJSON = new ConfigJSON();
await configJSON.ReadJSON();
var discordConfig = new DiscordConfiguration()
{
Intents = DiscordIntents.All,
Token = configJSON.BotToken,
TokenType = TokenType.Bot,
AutoReconnect = true,
};
Client = new DiscordClient(discordConfig);
Client.Ready += Client_Ready;
commandsreg();
await Client.ConnectAsync();
await Task.Delay(-1);
}
private static void commandsreg()
{
var commands = Client.UseSlashCommands();
commands.RegisterCommands<EasyWhitelist>();
}
private static Task Client_Ready(DiscordClient sender, DSharpPlus.EventArgs.ReadyEventArgs args)
{
return Task.CompletedTask;
}
}
}