feat: add -raw flag to pk;msg (#399)

This commit is contained in:
Katrix 2021-10-29 16:42:10 -04:00 committed by spiral
parent 9a34834ca9
commit b998636cbe
No known key found for this signature in database
GPG key ID: A6059F0CA0E1BD31
4 changed files with 50 additions and 19 deletions

View file

@ -245,15 +245,9 @@ namespace PluralKit.Bot
}
// get the message info
var msg = ctx.Message;
try
{
msg = await _rest.GetMessage(channelId.Value, messageId.Value);
}
catch (ForbiddenException)
{
var msg = await _rest.GetMessageOrNull(channelId.Value, messageId.Value);
if (msg == null)
throw new PKError(failedToGetMessage);
}
// if user is fetching a message in a different channel sent by someone else, throw a generic error message
if (msg == null || (msg.Author.Id != ctx.Author.Id && msg.ChannelId != ctx.Channel.Id))