Example #1
0
        private async Task <bool> ProcessMessage(CommandContext context)
        {
            try
            {
                var loadedModules = GlobalConfig.GetGuildConfig(context.Guild.Id).LoadedModules;
                var bot           = await context.Guild.GetCurrentUserAsync();

                if (!bot.GuildPermissions.SendMessages)
                {
                    return(false);
                }

                if (loadedModules.Contains((int)ModuleEnum.Mod))
                {
                    if (!(await _modLogic.Process(context)))
                    {
                        return(false);
                    }
                }

                if (loadedModules.Contains((int)ModuleEnum.Punish) && bot.GuildPermissions.ManageMessages)
                {
                    await _punishLogic.HandleMessage(context);
                }

                if (loadedModules.Contains((int)ModuleEnum.Media))
                {
                    await _mediaProcessor.Process(context);
                }

                if (loadedModules.Contains((int)ModuleEnum.MessageTrigger))
                {
                    await _messageTriggers.Process(context);
                }

                return(true);
            }
            catch (Exception ex)
            {
                await context.Channel.SendMessageAsync(ex.Message);

                return(false);
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            MediaProcessor mediaProcessor = new MediaProcessor();

            mediaProcessor.Process(args);
        }