fix: don't try to re-send stickers and activity invites
This commit is contained in:
@@ -115,6 +115,12 @@ public class ProxyService
|
||||
if (isMessageBlank && msg.Attachments.Length == 0)
|
||||
throw new ProxyChecksFailedException("Message cannot be blank.");
|
||||
|
||||
if (msg.Activity != null)
|
||||
throw new ProxyChecksFailedException("Message contains an invite to an activity, which cannot be re-sent by PluralKit.");
|
||||
|
||||
if (msg.StickerItems != null) // && msg.StickerItems.Any(s => s.Type == Sticker.StickerType.GUILD && s.GuildId != msg.GuildId))
|
||||
throw new ProxyChecksFailedException("Message contains stickers, which cannot be re-sent by PluralKit.");
|
||||
|
||||
// All good!
|
||||
return true;
|
||||
}
|
||||
@@ -158,6 +164,7 @@ public class ProxyService
|
||||
Attachments = trigger.Attachments,
|
||||
FileSizeLimit = guild.FileSizeLimit(),
|
||||
Embeds = embeds.ToArray(),
|
||||
Stickers = trigger.StickerItems,
|
||||
AllowEveryone = allowEveryone
|
||||
});
|
||||
await HandleProxyExecutedActions(ctx, trigger, proxyMessage, match);
|
||||
|
||||
@@ -37,6 +37,7 @@ public record ProxyRequest
|
||||
public Message.Attachment[] Attachments { get; init; }
|
||||
public int FileSizeLimit { get; init; }
|
||||
public Embed[] Embeds { get; init; }
|
||||
public Sticker[] Stickers { get; init; }
|
||||
public bool AllowEveryone { get; init; }
|
||||
}
|
||||
|
||||
@@ -115,7 +116,8 @@ public class WebhookExecutorService
|
||||
Content = content,
|
||||
AllowedMentions = allowedMentions,
|
||||
AvatarUrl = !string.IsNullOrWhiteSpace(req.AvatarUrl) ? req.AvatarUrl : null,
|
||||
Embeds = req.Embeds
|
||||
Embeds = req.Embeds,
|
||||
Stickers = req.Stickers,
|
||||
};
|
||||
|
||||
MultipartFile[] files = null;
|
||||
|
||||
Reference in New Issue
Block a user