fixes to slm, @everyone copyme and slm

This commit is contained in:
Master Kwoth
2016-01-29 14:33:02 +01:00
parent 805c592fff
commit 1316c83bd4
5 changed files with 12 additions and 11 deletions

View File

@ -323,18 +323,18 @@ namespace NadekoBot.Modules
Message msg;
var msgs = e.Channel.Messages
.Where(m => m.MentionedUsers.Contains(e.User))
.OrderBy(m => m.Timestamp);
.OrderByDescending(m => m.Timestamp);
if (msgs.Count() > 0)
msg = msgs.FirstOrDefault();
else {
var msgsarr = await e.Channel.DownloadMessages(10000);
msg = msgsarr
.Where(m => m.MentionedUsers.Contains(e.User))
.OrderBy(m => m.Timestamp)
.OrderByDescending(m => m.Timestamp)
.FirstOrDefault();
}
if (msg != null)
await e.Send("Last message mentioning you was at " + msg.Timestamp + "\n**Message:** " + msg.RawText);
await e.Send("Last message mentioning you was at " + msg.Timestamp + "\n**Message:** " + msg.RawText.Replace("@everyone","@everryone"));
else
await e.Send("I can't find a message mentioning you.");
});