#PyCord bug

1 messages · Page 1 of 1 (latest)

north iron
#

After trying another Discord bots library. I noticed that PyCord was the only one to have the Unknown Interaction error. Do you think this is fixable as I love your library but it's a big problem the interaction error.

slim niche
#

It's not a bug

#

it usually happens when you take too long (3s) to respond to an interaction, and is intended design

north iron
slim niche
#

show your code

north iron
#

ok

#
 @discord.Cog.listener()
    async def on_interaction(self, interaction):
        if interaction.type == discord.InteractionType.component:
            if interaction.data["custom_id"] == "plus":
                
                await interaction.response.defer(ephemeral=True) # code crash here
                
slim niche
#

why are you overriding on_interaction?

#

never do that

north iron
#

what ?

slim niche
#

you should never override that event

north iron
#

I don't understand

slim niche
#

leave on_interaction alone, its the entire brains of your bot regarding interactions
whatever you want to do, you can do it without overriding that event

#

what do you even want to do

north iron
#

It's a plugins to made a counter. I use this event because my button after reload does'nt respond

slim niche
#

yea, you need persistent views for that

#

check the docs on those

north iron
#

Yes but it's dynamic button, my users can be change the name, color, emoji of btn

slim niche
#

all possible

north iron
#

and before, I have tried this with persistant view and I have the same error

slim niche
#

yea, but start by not overriding this event

north iron
slim niche
#

yes, just delete that

north iron
#

what do I do next?

slim niche
#

try to figure your stuff out using persistent views :)

#

there's a guide on that i think, and the docs in general of course

north iron
#

Ok thanks

#

I have another question

#

I have shard, how to log if my shard disconnect and reconnect ?

#

how to log the reconnection

slim niche
north iron
#

Ok thanks you so much

true citrus
slim niche
#

oh right