Esempio n. 1
0
        public async Task Subscribe(params string[] args)
        {
            Base.Utilities.CheckAvailability(Context.Guild.Id, Program.Module.AnimeManga);
            await p.DoAction(Context.User, Context.Guild.Id, Program.Module.AnimeManga);

            var result = await Features.Entertainment.AnimeManga.Subscribe(Context.Guild, Program.p.db, args);

            switch (result.error)
            {
            case Error.Subscribe.Help:
                await ReplyAsync(Sentences.SubscribeHelp(Context.Guild.Id));

                break;

            case Error.Subscribe.InvalidChannel:
                await ReplyAsync(Sentences.InvalidChannel(Context.Guild.Id));

                break;

            case Error.Subscribe.None:
                await ReplyAsync(Sentences.SubscribeDone(Context.Guild.Id, "anime", result.answer.chan));

                break;

            default:
                throw new NotImplementedException();
            }
        }
Esempio n. 2
0
        public async Task Subscribe(params string[] args)
        {
            if (Context.Guild == null)
            {
                await ReplyAsync(Base.Sentences.CommandDontPm(Context.Guild));

                return;
            }
            Base.Utilities.CheckAvailability(Context.Guild, Program.Module.AnimeManga);
            await p.DoAction(Context.User, Program.Module.AnimeManga);

            if (!Tools.Settings.CanModify(Context.User, Context.Guild))
            {
                await ReplyAsync(Base.Sentences.OnlyOwnerStr(Context.Guild, Context.Guild.OwnerId));
            }
            else
            {
                var result = await Features.Entertainment.AnimeManga.Subscribe(Context.Guild, Program.p.db, args);

                switch (result.error)
                {
                case Error.Subscribe.Help:
                    await ReplyAsync(Sentences.SubscribeHelp(Context.Guild));

                    break;

                case Error.Subscribe.InvalidChannel:
                    await ReplyAsync(Sentences.InvalidChannel(Context.Guild));

                    break;

                case Error.Subscribe.None:
                    await ReplyAsync(Sentences.SubscribeDone(Context.Guild, "anime", result.answer.chan));

                    break;

                default:
                    throw new NotImplementedException();
                }
            }
        }