collabbot/CollabBot/Program.cs

27 lines
850 B
C#
Raw Normal View History

2024-04-21 13:28:07 -04:00
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);
}
}