public Drifter(DiscordClient client) { _instance = this; this._discord = client; this.redis = new CSRedisClient("localhost"); this.redis.SetDatabase(1).Wait(); this._rolemap = new RoleMap(this.redis); _interactivity = Discord.UseInteractivity(new InteractivityConfiguration() { }); _commands = Discord.UseCommandsNext(new CommandsNextConfiguration() { StringPrefix = ";" }); Commands.RegisterCommands <Commands.AdminCommands>(); Commands.RegisterCommands <Commands.MemeCommands>(); Commands.RegisterCommands <Commands.UtilityCommands>(); //Commands.RegisterCommands<Commands.VoiceCommand>(); Commands.RegisterCommands <Commands.ReactionRoleCommands>(); client.MessageReactionAdded += OnReactionAdded; client.MessageReactionRemoved += OnReactionRemoved; //client.VoiceStateUpdated += OnVoiceChange; }
static async Task MainAsync(string[] args) { //DO this tutorial next: https://dsharpplus.emzi0767.com/articles/commandsnext.html discord = new DiscordClient(new DiscordConfiguration { Token = System.IO.File.ReadAllText("bot.key"), TokenType = TokenType.Bot, UseInternalLogHandler = true, LogLevel = LogLevel.Debug }); discord.SetWebSocketClient <WebSocket4NetClient>(); voice = discord.UseVoiceNext(); await discord.ConnectAsync(); bot = new Drifter(discord); await bot.Initialize(); await Task.Delay(-1); }