Exemple #1
0
        public async Task Unsubcribe(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.Unsubscribe(Context.Guild, Program.p.db);

            switch (result.error)
            {
            case Error.Unsubscribe.NoSubscription:
                await ReplyAsync(Sentences.NoSubscription(Context.Guild.Id));

                break;

            case Error.Unsubscribe.None:
                await ReplyAsync(Sentences.UnsubscribeDone(Context.Guild.Id, "anime"));

                break;

            default:
                throw new NotImplementedException();
            }
        }
Exemple #2
0
        public async Task Unsubcribe(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.Unsubscribe(Context.Guild, Program.p.db);

                switch (result.error)
                {
                case Error.Unsubscribe.NoSubscription:
                    await ReplyAsync(Sentences.NoSubscription(Context.Guild));

                    break;

                case Error.Unsubscribe.None:
                    await ReplyAsync(Sentences.UnsubscribeDone(Context.Guild, "anime"));

                    break;

                default:
                    throw new NotImplementedException();
                }
            }
        }