Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Modal interactions don't support Regex. #2838

Open
3 tasks done
ImNoOSRS opened this issue Feb 7, 2024 · 2 comments
Open
3 tasks done

[Bug]: Modal interactions don't support Regex. #2838

ImNoOSRS opened this issue Feb 7, 2024 · 2 comments
Labels

Comments

@ImNoOSRS
Copy link
Contributor

ImNoOSRS commented Feb 7, 2024

Check The Docs

  • I double checked the docs and couldn't find any useful information.

Verify Issue Source

  • I verified the issue was caused by Discord.Net.

Check your intents

  • 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

@ImNoOSRS ImNoOSRS added the bug label Feb 7, 2024
@Misha-133
Copy link
Member

Misha-133 commented Feb 11, 2024

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

@ImNoOSRS
Copy link
Contributor Author

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

Great idea, did not seem to work sadly :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants