grammyjs / conversations

Conversational interfaces for grammY.
https://grammy.dev/plugins/conversations
MIT License
44 stars 17 forks source link

Does not wait for user input with gramjs #98

Closed m0x61h0x64i closed 4 months ago

m0x61h0x64i commented 4 months ago

im using conversations package to create a session using gramjs client.start function (for phone number, code and password)

while i want user phone number it gives me error this is my code :

phoneNumber: async () => {
                        console.log(9)
                        return await ctx.conversation.enter('getPhoneNumber')
                    }

phone number callback does not wait for conversations and then it throws error which says im getting undefined instead of phone number.

here is the full code : https://github.com/m0x61h0x64i/telegram-session-sender

KnorpelSenf commented 4 months ago

This exact code has been discussed numerous times in the chat. The plugin works exactly as intended.

m0x61h0x64i commented 4 months ago

@KnorpelSenf after updating from js to ts, im now getting error which says phone number is invalid but i didnt even give it phone number, it shows that conversation package does not wait for user input (phone number) in order for phoneNumber gramjs callback function be able to return the correct phone number.

code updated : https://github.com/m0x61h0x64i/telegram-session-sender

KnorpelSenf commented 4 months ago

My answers stay the same. The plugin is not going to wait, no matter how many times you ask.