fix(bot): add allowed mentions to msg info replies
Some checks failed
Build and push Docker image / .net docker build (push) Has been cancelled
.net checks / run .net tests (push) Has been cancelled
.net checks / dotnet-format (push) Has been cancelled

This commit is contained in:
asleepyskye 2025-10-24 21:26:33 -04:00
parent 49ce00e675
commit 0983179240
2 changed files with 5 additions and 3 deletions

View file

@ -201,7 +201,7 @@ public class ReactionAdded: IEventHandler<MessageReactionAddEvent>
Type = ComponentType.Separator
});
components.AddRange(await _embeds.CreateMessageInfoMessageComponents(msg, true, config));
await _rest.CreateMessage(dm, new MessageRequest { Components = components.ToArray(), Flags = Message.MessageFlags.IsComponentsV2 });
await _rest.CreateMessage(dm, new MessageRequest { Components = components.ToArray(), Flags = Message.MessageFlags.IsComponentsV2, AllowedMentions = new AllowedMentions() });
}
catch (ForbiddenException) { } // No permissions to DM, can't check for this :(

View file

@ -5,6 +5,7 @@ using Autofac;
using Myriad.Cache;
using Myriad.Gateway;
using Myriad.Rest;
using Myriad.Rest.Types;
using Myriad.Types;
using PluralKit.Core;
@ -76,13 +77,14 @@ public class InteractionContext
});
}
public async Task Reply(MessageComponent[] components = null)
public async Task Reply(MessageComponent[] components = null, AllowedMentions? mentions = null)
{
await Respond(InteractionResponse.ResponseType.ChannelMessageWithSource,
new InteractionApplicationCommandCallbackData
{
Components = components,
Flags = Message.MessageFlags.Ephemeral | Message.MessageFlags.IsComponentsV2
Flags = Message.MessageFlags.Ephemeral | Message.MessageFlags.IsComponentsV2,
AllowedMentions = mentions ?? new AllowedMentions()
});
}