feat: add -raw flag to pk;msg (#399)
This commit is contained in:
@@ -9,6 +9,7 @@ using Myriad.Builders;
|
||||
using Myriad.Extensions;
|
||||
using Myriad.Gateway;
|
||||
using Myriad.Rest;
|
||||
using Myriad.Rest.Exceptions;
|
||||
using Myriad.Rest.Types;
|
||||
using Myriad.Types;
|
||||
|
||||
@@ -56,6 +57,19 @@ namespace PluralKit.Bot
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task<Message?> GetMessageOrNull(this DiscordApiClient rest, ulong channelId, ulong messageId)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await rest.GetMessage(channelId, messageId);
|
||||
}
|
||||
catch (ForbiddenException)
|
||||
{
|
||||
// no permission, couldn't fetch, oh well
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static uint? ToDiscordColor(this string color)
|
||||
{
|
||||
if (uint.TryParse(color, NumberStyles.HexNumber, null, out var colorInt))
|
||||
|
Reference in New Issue
Block a user