feat: add correct error about guild boost file size limit
This commit is contained in:
parent
923ad100e5
commit
36acb5bae6
@ -112,7 +112,7 @@ namespace PluralKit.Bot
|
|||||||
|
|
||||||
public static PKError GenericCancelled() => new PKError("Operation cancelled.");
|
public static PKError GenericCancelled() => new PKError("Operation cancelled.");
|
||||||
|
|
||||||
public static PKError AttachmentTooLarge => new PKError("PluralKit cannot proxy attachments over 8 megabytes (as webhooks aren't considered as having Discord Nitro) :(");
|
public static PKError AttachmentTooLarge(int mb) => new PKError($"PluralKit cannot proxy attachments over {mb} megabytes in this server (as webhooks aren't considered as having Discord Nitro) :(");
|
||||||
public static PKError LookupNotAllowed => new PKError("You do not have permission to access this information.");
|
public static PKError LookupNotAllowed => new PKError("You do not have permission to access this information.");
|
||||||
public static PKError ChannelNotFound(string channelString) => new PKError($"Channel \"{channelString}\" not found or is not in this server.");
|
public static PKError ChannelNotFound(string channelString) => new PKError($"Channel \"{channelString}\" not found or is not in this server.");
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,7 @@ namespace PluralKit.Bot
|
|||||||
|
|
||||||
foreach (var attachment in attachments)
|
foreach (var attachment in attachments)
|
||||||
{
|
{
|
||||||
if (attachment.Size >= sizeThreshold) throw Errors.AttachmentTooLarge;
|
if (attachment.Size >= sizeThreshold) throw Errors.AttachmentTooLarge(sizeThreshold);
|
||||||
|
|
||||||
if (list.Sum(a => a.Size) + attachment.Size >= sizeThreshold)
|
if (list.Sum(a => a.Size) + attachment.Size >= sizeThreshold)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user