-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
68 lines (60 loc) · 2.65 KB
/
Program.cs
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System.Threading.Tasks;
using DSharpPlus;
using DSharpPlus.CommandsNext;
using System;
using System.Collections.Generic;
using AI_Bot.HelpModule;
using DSharpPlus.EventArgs;
namespace AI_Bot
{
public static class Program
{
public static DiscordClient discord;
public static CommandContext ctx;
public static CommandsNextExtension commands;
public static DateTime startupTime = DateTime.Now;
public static Dictionary<ulong, string> guildPrefixes = new Dictionary<ulong, string>();
public static string InternalPrefix = "??";
public static string InternalHelpPrefix = "";
public static string BotVersion = "v.1.0.44";
public static string BotName = "AtariBot";
public static string ShowNotification =
"This command has been set to private or was disabled by the developer." +
"Try to use the command later again.\n\nThe reason for this could due to an important issue that we we need to fix," +
"or we are investigate and work on this command.\n\n" +
"[[More information can be found in our FAQ]](https://sebi3.gitbook.io/ai-bot/wiki/frequently-asked-questions)";
public static bool IsPrivate = true;
static void Main(string[] args)
{
MainAsync(args).ConfigureAwait(false).GetAwaiter().GetResult();
}
static async Task MainAsync(string[] args)
{
discord = new DiscordClient(new DiscordConfiguration
{
Token = "Your Token",
TokenType = TokenType.Bot, MinimumLogLevel = Microsoft.Extensions.Logging.LogLevel.Debug,
});
commands = discord.UseCommandsNext(new CommandsNextConfiguration
{
StringPrefixes = new string[] { "??" },
CaseSensitive = false,
EnableDms = false,
});
commands.RegisterCommands<AI_Bot.BotModule.AdminModule>();
commands.RegisterCommands<AI_Bot.BotModule.FunModule>();
commands.RegisterCommands<AI_Bot.BotModule.MiscModule>();
commands.RegisterCommands<AI_Bot.BotModule.InforCommands>();
commands.SetHelpFormatter<Help>();
await discord.ConnectAsync();
await Task.Delay(-1);
discord.Ready += Discord_Ready;
}
public static Task Discord_Ready(DiscordClient client, ReadyEventArgs e)
{
Task.Run(Events.UpdateRichPrsence().Start);
Task.Run(Events.ThreadWorker(e).Start);
return Task.CompletedTask;
}
}
}