From 9cc944fcc10d7fd284de89357c7a65ff2535dce0 Mon Sep 17 00:00:00 2001 From: runebaas Date: Fri, 19 Jun 2020 12:28:22 +0200 Subject: [PATCH] Use a single message for !mtg and show a searching message when the command starts executing --- Geekbot.net/Commands/Integrations/MagicTheGathering.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Geekbot.net/Commands/Integrations/MagicTheGathering.cs b/Geekbot.net/Commands/Integrations/MagicTheGathering.cs index 1075c46..f9e006c 100644 --- a/Geekbot.net/Commands/Integrations/MagicTheGathering.cs +++ b/Geekbot.net/Commands/Integrations/MagicTheGathering.cs @@ -28,6 +28,8 @@ namespace Geekbot.net.Commands.Integrations { try { + var message = await Context.Channel.SendMessageAsync($":mag: Looking up\"{cardName}\", please wait..."); + var service = new CardService(); var result = service .Where(x => x.Name, cardName) @@ -37,7 +39,7 @@ namespace Geekbot.net.Commands.Integrations var card = result.All().Value.FirstOrDefault(); if (card == null) { - await ReplyAsync("I couldn't find that card..."); + await message.ModifyAsync(properties => properties.Content = ":red_circle: I couldn't find a card with that name..."); return; } @@ -65,7 +67,11 @@ namespace Geekbot.net.Commands.Integrations if (card.Legalities != null && card.Legalities.Count > 0) eb.AddField("Legality", string.Join(", ", card.Legalities.Select(e => e.Format))); - await ReplyAsync("", false, eb.Build()); + await message.ModifyAsync(properties => + { + properties.Content = string.Empty; + properties.Embed = eb.Build(); + }); } catch (Exception e) {