27 lines
No EOL
850 B
C#
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);
|
|
}
|
|
} |