Ejemplo n.º 1
0
        public async Task IncreaseSize(params string[] args)
        {
            Base.Utilities.CheckAvailability(Context.Guild, Program.Module.Code);
            await Program.p.DoAction(Context.User, Program.Module.Code);

            if (Context.Message.Attachments.Count > 0)
            {
                args = new[] { Context.Message.Attachments.ToArray()[0].Url }
            }
            ;
            var result = await Features.Tools.Code.IncreaseSize(args, Program.p.rand);

            switch (result.error)
            {
            case Features.Tools.Error.IncreaseSize.Help:
                await ReplyAsync(Sentences.IncreaseHelp(Context.Guild));

                break;

            case Features.Tools.Error.IncreaseSize.InvalidLink:
                await ReplyAsync(Sentences.NotAnImage(Context.Guild));

                break;

            case Features.Tools.Error.IncreaseSize.None:
                await Context.Channel.SendFileAsync(result.answer.path);

                break;

            default:
                throw new NotImplementedException();
            }
        }
    }