mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-16 10:40:12 +00:00
fix(bot): correct error for pk;debug proxy pointing to a DM channel message
This commit is contained in:
parent
de9cae0cbd
commit
74d621455a
1 changed files with 3 additions and 0 deletions
|
|
@ -230,6 +230,9 @@ public class Checks
|
||||||
if (channel == null)
|
if (channel == null)
|
||||||
throw new PKError("Unable to get the channel associated with this message.");
|
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
|
// 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 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();
|
var members = (await ctx.Repository.GetProxyMembers(msg.Author.Id, channel.GuildId.Value)).ToList();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue