fix(bot): correct error for pk;debug proxy pointing to a DM channel message

This commit is contained in:
spiral 2022-12-15 00:57:22 +00:00
parent de9cae0cbd
commit 74d621455a
No known key found for this signature in database
GPG Key ID: 244A11E4B0BCF40E

View File

@ -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();