mirror of
https://github.com/RPCS3/discord-bot.git
synced 2025-03-04 07:47:08 +00:00
actually, we need to remove the most recent message, not the oldest; I'm dumb
This commit is contained in:
parent
5205fe184c
commit
7dac7bacf2
@ -31,7 +31,7 @@ namespace CompatBot.EventHandlers
|
||||
|
||||
await args.Message.ReactWithAsync(args.Client, DiscordEmoji.FromUnicode("😟"), "Okay (._.)").ConfigureAwait(false);
|
||||
var lastBotMessages = await args.Channel.GetMessagesBeforeAsync(args.Message.Id, 20, DateTime.UtcNow.AddSeconds(-30)).ConfigureAwait(false);
|
||||
if (lastBotMessages.OrderBy(m => m.CreationTimestamp).FirstOrDefault(m => m.Author.IsCurrent) is DiscordMessage msg)
|
||||
if (lastBotMessages.OrderByDescending(m => m.CreationTimestamp).FirstOrDefault(m => m.Author.IsCurrent) is DiscordMessage msg)
|
||||
await msg.DeleteAsync("asked to shut up").ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user