feat: add -clear-attachments flag to pk;edit

This commit is contained in:
sam 2024-11-12 00:20:56 +01:00
parent 10d45d3a1a
commit 11390a4fc7
No known key found for this signature in database
GPG key ID: 5F3C3C1B3166639D
4 changed files with 13 additions and 5 deletions

View file

@ -118,7 +118,8 @@ public class ProxiedMessage
// Should we clear embeds?
var clearEmbeds = ctx.MatchFlag("clear-embed", "ce");
if (clearEmbeds && newContent == null)
var clearAttachments = ctx.MatchFlag("clear-attachments", "ca");
if ((clearEmbeds || clearAttachments) && newContent == null)
newContent = originalMsg.Content!;
if (newContent == null)
@ -218,7 +219,7 @@ public class ProxiedMessage
try
{
var editedMsg =
await _webhookExecutor.EditWebhookMessage(msg.Guild ?? 0, msg.Channel, msg.Mid, newContent, clearEmbeds);
await _webhookExecutor.EditWebhookMessage(msg.Guild ?? 0, msg.Channel, msg.Mid, newContent, clearEmbeds, clearAttachments);
if (ctx.Guild == null)
await _rest.CreateReaction(ctx.Channel.Id, ctx.Message.Id, new Emoji { Name = Emojis.Success });