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

33 lines
1 KiB
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() {
2021-12-10 14:25:29 +03:00
MessageCacheSize = 250,
GatewayIntents = GatewayIntents.All
2021-12-07 21:27:27 +03:00
};
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-10 14:25:29 +03:00
await Client.SetActivityAsync(new Game("Retrospecter - Electrospasm", ActivityType.Listening));
2021-12-07 15:52:37 +03:00
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;
}
}