This repository has been archived on 2024-06-23. You can view files and clone it, but cannot push or open issues or pull requests.
OctobotStealth/Boyfriend/Boyfriend.cs
2021-12-07 23:27:27 +05:00

31 lines
No EOL
871 B
C#

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