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 + "`"); }
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!"); }