defstudio / telegraph

Telegraph is a Laravel package for fluently interacting with Telegram Bots
MIT License
674 stars 116 forks source link

How to get user reply on message #561

Closed AntonNosovich closed 6 months ago

AntonNosovich commented 6 months ago
     $this->chat->message("text")->forceReply()->send();

How get answer on this message

fabio-ivona commented 6 months ago

You should listen for a reply in a webook

AntonNosovich commented 6 months ago

You should listen for a reply in a webook

I can get each message ,but I need get only reply on bot message

fabio-ivona commented 6 months ago

Telegram is stateless, but you could keep track of the conversation status using telegraph internal storage system, eg.

Send your message

Record 'waiting for reply from user X'

Listen for incoming messages for a message from user X, checking his id against your stored one

Handle the message and delete the storage record