#Problems with interactions

1 messages · Page 1 of 1 (latest)

tranquil talon
#

Hello everyone!
I've read a lot around here but never posted because I never had any big bugs until now....
I have encountered a problem related to interactions.
Let me put it in context:
Let's imagine that the bot has sent a message with a simple button and if they click on that button it creates a private thread for the user and sends them another message in which they have a dropdown with several options.
If you select the first option it sends you a message with a new view with a button that cancels a search that I do from behind in the code, apparently nothing is seen.

The problem is that only the last user who interacted with the bot and clicks on that button does what he has to do and cancels that search and cancels also the rest. Users who interacted previously can click on that button but it does nothing, like the view expired, suggesting that the interactions may be in conflict.

Is it somehow possible for a user interaction to interfere with another user's interaction and also in different threads?

oblique siren
#

did you make the view persistent?

safe axle
#

.tag persistent

cunning galleonBOT
#

The Issue

When you send a message with a view, button for example
if your bot restarts, you will lose the ability to use this button.

How To Fix This

  1. Set your view timeout to None
  • By default, the view timeout value is set to 300 seconds
  1. Pass a custom_id value to the view
  • Custom ids must be unique
  • Chose a custom id that has a meaning in relation to your view
  1. Add the view to the bot
  • You can use the method Bot.add_view(YourViewClass())
  • Make sure to add the view when the bot begin ready
tranquil talon
tranquil talon
oblique siren
#

you should really work with a persistent view instead of resending it over and over

#

and well, show your view code

#

(views only last for 15m unless persistent)

tranquil talon
#

let's see how I show because I have a lot of scripts and many of them are connected to each other.

One view inherits from another parent and is the one that handles the timeout issue.
I don't have any global variables that could interfere and close the interaction or anything like that.
The truth is things that I can't figure out, I've been trying things for hours and nothing.
I will try to see about the persistent view, but if I just run the bot there should be no conflict with the interactions or anything, right?

tranquil talon
oblique siren
#

yea

#

its no different

#

just that it doesnt disable itself

tranquil talon
tranquil talon
# oblique siren .

I always tried it but with the ephemeral messages, which I imagine are different from the normal ones

tranquil talon
oblique siren
#

yea

tranquil talon
oblique siren
#

?