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
4 changed files with 50 additions and 19 deletions

View File

@@ -280,15 +280,7 @@ namespace PluralKit.Bot
var channel = await _cache.GetOrFetchChannel(_rest, msg.Message.Channel);
var ctx = LookupContext.ByNonOwner;
Message serverMsg = null;
try
{
serverMsg = await _rest.GetMessage(msg.Message.Channel, msg.Message.Mid);
}
catch (ForbiddenException)
{
// no permission, couldn't fetch, oh well
}
var serverMsg = await _rest.GetMessageOrNull(msg.Message.Channel, msg.Message.Mid);
// Need this whole dance to handle cases where:
// - the user is deleted (userInfo == null)