1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 09:09:00 +03:00
Octobot/Boyfriend/Boyfriend.cs

31 lines
871 B
C#
Raw Normal View History

2021-12-07 15:52:37 +03:00
using Discord;
using Discord.WebSocket;
namespace Boyfriend;
2021-12-07 21:27:27 +03:00
public static class Boyfriend {
2021-12-07 15:52:37 +03:00
2021-12-07 21:27:27 +03:00
public static void Main()
=> Init().GetAwaiter().GetResult();
2021-12-07 15:52:37 +03:00
2021-12-07 21:27:27 +03:00
private static readonly DiscordSocketConfig Config = new() {
MessageCacheSize = 250
};
public static readonly DiscordSocketClient Client = new(Config);
2021-12-07 15:52:37 +03:00
2021-12-07 21:27:27 +03:00
private static async Task Init() {
2021-12-07 15:52:37 +03:00
Client.Log += Log;
2021-12-07 21:27:27 +03:00
var token = (await File.ReadAllTextAsync("token.txt")).Trim();
2021-12-07 15:52:37 +03:00
await Client.LoginAsync(TokenType.Bot, token);
await Client.StartAsync();
2021-12-07 21:27:27 +03:00
await new EventHandler().InitEvents();
2021-12-07 15:52:37 +03:00
await Task.Delay(-1);
}
private static Task Log(LogMessage msg) {
Console.WriteLine(msg.ToString());
return Task.CompletedTask;
}
}