mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Fix messages in DMs
This commit is contained in:
parent
13e3289c26
commit
1c548e9d7b
4 changed files with 19 additions and 3 deletions
|
|
@ -1,8 +1,6 @@
|
|||
using System.Threading.Tasks;
|
||||
|
||||
using Myriad.Gateway;
|
||||
using Myriad.Rest;
|
||||
using Myriad.Types;
|
||||
|
||||
namespace Myriad.Cache
|
||||
{
|
||||
|
|
@ -51,6 +49,11 @@ namespace Myriad.Cache
|
|||
|
||||
private static async ValueTask SaveMessageCreate(this IDiscordCache cache, MessageCreateEvent evt)
|
||||
{
|
||||
// DM messages don't get Channel Create events first, so we need to save
|
||||
// some kind of stub channel object until we get the real one
|
||||
if (evt.GuildId == null)
|
||||
await cache.SaveDmChannelStub(evt.ChannelId);
|
||||
|
||||
await cache.SaveUser(evt.Author);
|
||||
foreach (var mention in evt.Mentions)
|
||||
await cache.SaveUser(mention);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue