ask for term to explain _after_ the list, so it won't be lost

This commit is contained in:
13xforever 2019-03-20 20:37:44 +05:00
parent 9959dd0676
commit a471c21330

View File

@ -34,7 +34,6 @@ namespace CompatBot.Commands
var sourceTerm = term;
if (string.IsNullOrEmpty(term))
{
var botMsg = await ctx.RespondAsync("Please tell what term to explain:").ConfigureAwait(false);
var lastBotMessages = await ctx.Channel.GetMessagesBeforeAsync(ctx.Message.Id, 10).ConfigureAwait(false);
var showList = true;
foreach (var pastMsg in lastBotMessages)
@ -47,6 +46,7 @@ namespace CompatBot.Commands
}
if (showList)
await List(ctx).ConfigureAwait(false);
var botMsg = await ctx.RespondAsync("Please tell what term to explain:").ConfigureAwait(false);
var interact = ctx.Client.GetInteractivity();
var newMessage = await interact.WaitForMessageAsync(m => m.Author == ctx.User && m.Channel == ctx.Channel && !string.IsNullOrEmpty(m.Content)).ConfigureAwait(false);
await botMsg.DeleteAsync().ConfigureAwait(false);