collabbot/CollabBot/Program.cs
2024-04-21 13:29:36 -04:00

27 lines
No EOL
850 B
C#

using DSharpPlus;
using DSharpPlus.Entities;
using DSharpPlus.SlashCommands;
using Tomlet;
namespace CollabBot;
class Program
{
public static IConfig Config { get; private set; }
public static DiscordChannel ReportChannel { get; private set; }
async static Task Main(string[] args)
{
Config = TomletMain.To<IConfig>(File.ReadAllText("config.toml"));
var discord = new DiscordClient(new DiscordConfiguration
{
Token = Config.DiscordToken,
TokenType = TokenType.Bot,
Intents = DiscordIntents.AllUnprivileged
});
var slash = discord.UseSlashCommands();
slash.RegisterCommands<DiscordCommands>();
await discord.ConnectAsync();
ReportChannel = await discord.GetChannelAsync(Config.ReportChannel);
await Task.Delay(-1);
}
}