public SonequaDiscord(ILogger <SonequaDiscord> logger, SonequaSettings options) { _logger = logger; _discordClient = new DiscordClient(new DiscordConfiguration { Token = options.BotToken, TokenType = TokenType.Bot, UseInternalLogHandler = true, LogLevel = DSharpPlus.LogLevel.Debug }); _commands = _discordClient.UseCommandsNext(new CommandsNextConfiguration { StringPrefix = "!" }); _commands.RegisterCommands <SlapCommand>(); _discordClient.ConnectAsync().GetAwaiter().GetResult(); Task.Delay(-1).GetAwaiter().GetResult(); }
public SonequaDiscord(ILogger <SonequaDiscord> logger, SonequaSettings options) { _logger = logger; _discordClient = new DiscordClient(new DiscordConfiguration { Token = options.BotToken, TokenType = TokenType.Bot, MinimumLogLevel = LogLevel.Debug }); _commands = _discordClient.UseCommandsNext(new CommandsNextConfiguration() { UseDefaultCommandHandler = false }); InitializeBotCommands(); _discordClient.MessageCreated += CommandHandler; _discordClient.ConnectAsync().GetAwaiter().GetResult(); Task.Delay(-1).GetAwaiter().GetResult(); }