From 74d621455a93362a36fcead4415be938053b261b Mon Sep 17 00:00:00 2001 From: spiral Date: Thu, 15 Dec 2022 00:57:22 +0000 Subject: [PATCH] fix(bot): correct error for pk;debug proxy pointing to a DM channel message --- PluralKit.Bot/Commands/Checks.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PluralKit.Bot/Commands/Checks.cs b/PluralKit.Bot/Commands/Checks.cs index 0dd86fbd..362e6aca 100644 --- a/PluralKit.Bot/Commands/Checks.cs +++ b/PluralKit.Bot/Commands/Checks.cs @@ -230,6 +230,9 @@ public class Checks if (channel == null) throw new PKError("Unable to get the channel associated with this message."); + if (channel.GuildId == null) + throw new PKError("PluralKit is not able to proxy messages in DMs."); + // using channel.GuildId here since _rest.GetMessage() doesn't return the GuildId var context = await ctx.Repository.GetMessageContext(msg.Author.Id, channel.GuildId.Value, msg.ChannelId); var members = (await ctx.Repository.GetProxyMembers(msg.Author.Id, channel.GuildId.Value)).ToList();