diff --git a/Myriad/Types/Application/Interaction.cs b/Myriad/Types/Application/Interaction.cs index 2b4834d8..237a9540 100644 --- a/Myriad/Types/Application/Interaction.cs +++ b/Myriad/Types/Application/Interaction.cs @@ -14,7 +14,8 @@ public ApplicationCommandInteractionData? Data { get; init; } public ulong GuildId { get; init; } public ulong ChannelId { get; init; } - public GuildMember Member { get; init; } + public GuildMember? Member { get; init; } + public User? User { get; init; } public string Token { get; init; } public Message? Message { get; init; } } diff --git a/PluralKit.Bot/Utils/InteractionContext.cs b/PluralKit.Bot/Utils/InteractionContext.cs index a27449a7..0a87407c 100644 --- a/PluralKit.Bot/Utils/InteractionContext.cs +++ b/PluralKit.Bot/Utils/InteractionContext.cs @@ -22,8 +22,8 @@ namespace PluralKit.Bot public ulong ChannelId => _evt.ChannelId; public ulong? MessageId => _evt.Message?.Id; - public GuildMember Member => _evt.Member; - public User User => _evt.Member.User; + public GuildMember? Member => _evt.Member; + public User User => _evt.Member?.User ?? _evt.User; public string Token => _evt.Token; public string? CustomId => _evt.Data?.CustomId; public InteractionCreateEvent Event => _evt; diff --git a/PluralKit.Bot/Utils/SerilogGatewayEnricherFactory.cs b/PluralKit.Bot/Utils/SerilogGatewayEnricherFactory.cs index 3ff85a12..9409ba3e 100644 --- a/PluralKit.Bot/Utils/SerilogGatewayEnricherFactory.cs +++ b/PluralKit.Bot/Utils/SerilogGatewayEnricherFactory.cs @@ -80,7 +80,7 @@ namespace PluralKit.Bot MessageUpdateEvent e => e.Author.HasValue ? e.Author.Value.Id : null, MessageReactionAddEvent e => e.UserId, MessageReactionRemoveEvent e => e.UserId, - InteractionCreateEvent e => e.Member.User.Id, + InteractionCreateEvent e => e.User?.Id ?? e.Member.User.Id, _ => null, };