Discord.Net
Discord.Net copied to clipboard
[Bug]: Modal interactions don't support Regex.
Check The Docs
- [X] I double checked the docs and couldn't find any useful information.
Verify Issue Source
- [X] I verified the issue was caused by Discord.Net.
Check your intents
- [X] I double checked that I have the required intents.
Description
Modal interactions don't work with Regex (*) ComponentInteraction's do work like that but modals do not.
Version
3.13.0
Working Version
No response
Logs
N/A
Sample
public class BotInteraction<TInteraction> : InteractionModuleBase<SocketInteractionContext<TInteraction>> where TInteraction : SocketInteraction
{
}
public class ModalCommands : BotInteraction<SocketModal>
{
[ModalInteraction("example-modal-*")]
public async Task exampleModalInteraction(GiveawayInfoModal modal)
{
await Context.Channel.SendMessageAsync("Oh this works now? Let ImNo know.");
}
}
Packages
Discord.Interactions
Environment
Any
Hey
Try setting TreatAsRegex to true for the ModalInteraction
ex.
[ModalInteraction("example-modal-*", TreatAsRegex = true)]
by default it treats the * as a wildcard for a parameter
Hey
Try setting
TreatAsRegexto true for theModalInteractionex.
[ModalInteraction("example-modal-*", TreatAsRegex = true)]by default it treats the
*as a wildcard for a parameter
Great idea, did not seem to work sadly :(