Exemplo n.º 1
0
        private async Task SendViewMessage(CommandEventArgs e, Func <IComponent, long, bool> predicate)
        {
            try
            {
                CommandsManager manager = new CommandsManager((long)e.Server.Id, predicate);

                string name = e.GetArg(CommandsConstants.ParameterModuleName);
                string view = String.IsNullOrEmpty(name) ? manager.CreateComponentsView(mBotModulesObserver.Modules) :
                              manager.CreateComponentsView(CommandsManager.FindModule(name, mBotModulesObserver.Modules));

                await SendStyleMessage(e.Channel, view, SettingsModuleResource.Css);
            }
            catch (ArgumentException exp)
            {
                await SendExceptonMessage(e.Channel, exp);
            }
        }