#Component Interaction isnt working

1 messages · Page 1 of 1 (latest)

candid glade
#

I set up a component interaction using ```
[ComponentInteraction("sleeper:yes:*")]
public async Task IsUser(string user_id){}

wicked sonnet
#

Did you setup rest of the interaction framework?

candid glade
#

my slashcommands and everything else are working fine

wicked sonnet
#

Ah, so you are already using it

candid glade
#

yes

wicked sonnet
#

aha
then

#

What event are you using?

#

DiscordSocketClient.InteractionCreated?

candid glade
#

im sorry i dont fully understand what youre asking

wicked sonnet
#

like
when an interaction is triggered (slash command, button click, etc)
an event is fired

candid glade
#

OHHHHh

#

yeah interactioncreated

wicked sonnet
#

IF uses those events to run command

#

ah

#

hmmm

#

Then it should be fine

candid glade
#
public async Task InitializeAsync()
        {
            await _commands.AddModulesAsync(assembly: Assembly.GetEntryAssembly(), services: _services);

            _client.InteractionCreated += HandleInteractionsAsync;
        }
#

thats my initialization

wicked sonnet
#

Is the task with [ComponentInteraction] attribute in a class with [Group] attribute?

candid glade
#

yes

wicked sonnet
wicked sonnet
#

That's why

candid glade
#

dont do that

#

got itttttt

wicked sonnet
#

So it expects your button id to be group_name button id

#

set ignoreGroupNames = true in [ComponentInteraction()]

candid glade
#

where

#

ah ty

wicked sonnet
#

and that should solve it

#

same thing applies to [ModalInteraction]

candid glade
#

Thank you!

wicked sonnet
candid glade
#

other way to fix it just wondering

#

is adding the group name to the id?

wicked sonnet
#

iirc yes

#

but never really looked into this tbh

candid glade
#

with a space or :

#

true removing the group is enough