Пример #1
0
        public virtual async Task InstallCommandsAsync()
        {
            await OnLogAsync(Debug.LogSeverity.Info, "Installing commands");

            foreach (ModuleInfo moduleInfo in DiscordCommandService.Modules.ToArray())
            {
                await DiscordCommandService.RemoveModuleAsync(moduleInfo);
            }

            await DiscordCommandService.AddModulesAsync(Assembly.GetEntryAssembly(), serviceProvider);
        }
        public override async Task InstallCommandsAsync()
        {
            await base.InstallCommandsAsync();

            if (!botConfiguration.TrophiesEnabled)
            {
                await DiscordCommandService.RemoveModuleAsync <Modules.TrophyModule>();
            }

            if (!botConfiguration.GotchisEnabled)
            {
                await DiscordCommandService.RemoveModuleAsync <Modules.GotchiModule>();
            }
        }