PaulSonOfLars / gotgbot

Autogenerated Go wrapper for the telegram API. Inspired by the python-telegram-bot library.
MIT License
469 stars 107 forks source link

AllowReEntry not working #91

Closed bazuker closed 1 year ago

bazuker commented 1 year ago

I am having trouble with AllowReEntry in ConversationOpts.

func GetConversationStarters() []ext.Handler {
    return []ext.Handler{
        handlers.NewCommand("start", start),
    }
...
dispatcher.AddHandler(handlers.NewConversation(
GetConversationStarters(),
GetConversationHandlers(),
&handlers.ConversationOpts{
    Exits:        []ext.Handler{handlers.NewCommand("cancel", cancel)},
    ...
    AllowReEntry: true,
     },
))

It is set to true, however I can't get it to work and the conversation does not restart. From my expectations, /start command should be working regardless of the current state.

PaulSonOfLars commented 1 year ago

Hi Daniil, thanks for raising the issue!

That's very strange, I've got a test to check specifically for this behaviour.

Would you be able to provide us with a minimal reproduction of this, so we can test against it and reproduce?

PaulSonOfLars commented 1 year ago

Ah, managed to repro locally, the test was wrong - Fixed in v2.0.0-rc.20!

bazuker commented 1 year ago

@PaulSonOfLars thanks for a quick fix