Esempio n. 1
0
            public async Task View(CommandContext ctx)
            {
                var count = await ManageCharacter.GetCountAsync(Tables.Suggest);

                Console.WriteLine(count);
                string Text = "`Suggestions`";

                while (count > 0)
                {
                    var IssueGet = new ManageCharacter.Suggestions()
                    {
                        Entry = count - 1
                    };
                    var Issue = await ManageCharacter.GetAlls(IssueGet);

                    if (Issue != null)
                    {
                        string Solved = "Not Added";
                        if (Issue.Done == ManageCharacter.Done.yes)
                        {
                            Solved = "Done";
                        }
                        Text += $"\n`→ [{Issue.Entry}] - {Issue.Title} - [{Solved}]`";
                    }
                    count--;
                }
                var embed = new DiscordEmbedBuilder();
                var inter = ctx.Client.GetInteractivity();
                var pages = inter.GeneratePagesInEmbed(Text, SplitType.Line, embed);
                await inter.SendPaginatedMessageAsync(ctx.Channel, ctx.Member, pages);
            }
Esempio n. 2
0
            public async Task View(CommandContext ctx, int ID)
            {
                var count = await ManageCharacter.GetCountAsync(Tables.Issues);

                if (ID > count)
                {
                    await ctx.RespondAsync("I don't have that many errors asshole-");

                    return;
                }
                var Issue = await ManageCharacter.GetAll(new ManageCharacter.Issues()
                {
                    Entry = ID
                });

                if (Issue == null)
                {
                    await ctx.RespondAsync("ID not found...");

                    return;
                }
                string Solved = "Unsolved";

                if (Issue.Solved == ManageCharacter.Solved.yes)
                {
                    Solved = "Solved";
                }
                var Emmy = new DiscordEmbedBuilder()
                {
                    Description = $"`{Issue.Title}`\n\n{Issue.Desc}"
                };

                Emmy = Emmy.WithFooter("Issue #" + ID + $" [{Solved}]");
                await ctx.RespondAsync(embed : Emmy);
            }
Esempio n. 3
0
        public async Task InvCards(CommandContext ctx)
        {
            var Accg = new AccountGet()
            {
                UID = ctx.User.Id,
                GID = ctx.Guild.Id
            };
            var Check = await ManageCharacter.GetAll(Acc : Accg);

            if (Check == null)
            {
                await ctx.RespondAsync("You have no characters.");

                return;
            }
            var OwnGet = new OwnerGet()
            {
                UID  = ctx.User.Id,
                GID  = ctx.Guild.Id,
                Slot = Check.Slot
            };
            var Own = await ManageCharacter.GetAll(OwnGet);

            var ChrGet = new ChrGet()
            {
                Entry = Own.CharEntry,
            };
            var Chrs = await ManageCharacter.GetAll(ChrGet);

            int i  = 0;
            var sb = new StringBuilder();

            sb.Append($"`{Chrs.Name}'s Cards:`");
            while (i < await ManageCharacter.GetCountAsync(Tables.Character))
            {
                var Card = new ManageCharacter.Card()
                {
                    ChrEntry = Chrs.Entry,
                    ChrCode  = i
                };
                var Cards = await ManageCharacter.GetAll(Card);

                if (Cards == null)
                {
                    i++;
                }
                else
                {
                    var Chr = await ManageCharacter.GetAll(Card);

                    sb.Append($"`Amount[{Chr.ChrAmount}]` **→** **[__{Chr.ChrClass}__ - __{Chr.ChrName}__ - __{Chr.ChrRace}__]**\n");
                    i++;
                }
            }
            var embed = new DiscordEmbedBuilder();
            var inter = ctx.Client.GetInteractivity();
            var pages = inter.GeneratePagesInEmbed(sb.ToString(), SplitType.Line, embed);
            await inter.SendPaginatedMessageAsync(ctx.Channel, ctx.Member, pages);
        }
Esempio n. 4
0
            public async Task New(CommandContext ctx)
            {
                var Issue = new ManageCharacter.Suggestions();
                var r     = await Interactivity.WaitForAnswerAsync(ctx, $"**What is the title of this Suggestion? (Command name, event name or just what it is)**", channel : ctx.Channel);

                if (r == null)
                {
                    return;
                }
                Issue.Title = r.Content;
                r           = await Interactivity.WaitForAnswerAsync(ctx, $"**Describe the Suggestion**", channel : ctx.Channel);

                if (r == null)
                {
                    return;
                }
                Issue.Desc = r.Content;
                var count = await ManageCharacter.GetCountAsync(Tables.Suggest);

                Issue.Entry = count;
                await ManageCharacter.InsertAsync(Suggest : Issue);

                await ctx.RespondAsync("New Suggestion added, see it with &Suggestion `" + count + "`");
            }
Esempio n. 5
0
            public async Task Solve(CommandContext ctx, int ID)
            {
                var count = await ManageCharacter.GetCountAsync(Tables.Issues);

                if (ID > count)
                {
                    await ctx.RespondAsync("I don't have that many errors asshole-");

                    return;
                }
                var Issue = await ManageCharacter.GetAll(new ManageCharacter.Issues()
                {
                    Entry = ID
                });

                if (Issue == null)
                {
                    await ctx.RespondAsync("ID not found...");

                    return;
                }
                Issue.Solved = ManageCharacter.Solved.yes;
                var Emmy = new DiscordEmbedBuilder()
                {
                    Description = $"`[Solved]{Issue.Title}`\n\n{Issue.Desc}"
                };

                Emmy = Emmy.WithFooter("Issue #" + ID);
                await ctx.RespondAsync(embed : Emmy);

                await ManageCharacter.UpdateAsync(Issue : Issue);

                await Task.Delay(1000 * 120);

                await ManageCharacter.RemoveAsync(Issue);
            }
Esempio n. 6
0
        public async Task PingAsync(CommandContext ctx)
        {
            var sw      = Stopwatch.StartNew();
            var message = await ctx.RespondAsync("pinging"); // this sends a message

            sw.Stop();

            await message.ModifyAsync($"ping: {sw.ElapsedMilliseconds} ms\n\n" + $"Characters: {await ManageCharacter.GetCountAsync(Tables.Character)}"); // edit the message
        }
Esempio n. 7
0
        public async Task SummonCard(CommandContext ctx)
        {
            var CharEntry = Helpers.Tools.RNG.Next(await ManageCharacter.GetCountAsync(Tables.Character));
            var ChrGet    = new ChrGet()
            {
                Entry = CharEntry,
            };

            var Chr = await ManageCharacter.GetAll(ChrGet);

            var Embed = new DiscordEmbedBuilder();

            Embed = Embed.WithDescription($"[`.Claim`] → [__{Chr.Class} - {Chr.Name} - {Chr.Race}__]");
            Embed = Embed.WithImageUrl(Chr.Image);
            Embed = Embed.WithFooter(Chr.Desc);
            await ctx.RespondAsync(embed : Embed);

ReAsk:
            var r = await Interactivity.WaitForStealAsync(ctx, channel : ctx.Channel);

            if (r == null)
            {
                goto ReAsk;
            }

            var User = r;

            var Accg = new AccountGet()
            {
                UID = User.Id,
                GID = ctx.Guild.Id
            };

            var Check = await ManageCharacter.GetAll(Acc : Accg);

            if (Check == null)
            {
                await ctx.RespondAsync($"You don't own a character.");

                goto ReAsk;
            }

            var OwnGet = new OwnerGet()
            {
                UID  = User.Id,
                GID  = ctx.Guild.Id,
                Slot = Check.Slot
            };

            var Own = await ManageCharacter.GetAll(OwnGet);

            var ChrGets = new ChrGet()
            {
                Entry = Own.CharEntry,
            };

            var Chrs = await ManageCharacter.GetAll(ChrGets);

            var Card = new ManageCharacter.Card()
            {
                ChrCode   = Chr.Entry,
                ChrEntry  = Chrs.Entry,
                ChrName   = Chr.Name,
                ChrDesc   = Chr.Desc,
                ChrRace   = Chr.Race,
                ChrClass  = Chr.Class,
                ChrAmount = 1,
                ChrImage  = Chr.Image
            };

            var Rs = await ManageCharacter.GetAll(Card);

            if (Rs == null)
            {
                await ctx.RespondAsync("You claimed this card for the first time!");

                await ManageCharacter.InsertAsync(Card : Card);

                return;
            }

            Card.ChrAmount += Rs.ChrAmount;

            await ManageCharacter.UpdateAsync(Card : Card);

            await ctx.RespondAsync("You claimed this card!");
        }