user8306833
user8306833

Reputation:

Bot Telegram php: Conversation with a specific user

After this step:

if($message == "Bot copy me")
{
    sendMessage($chatid, "Sure?");
}

How a bot can reply to this specific user that said "Bot copy me" if he say "yes", for example, and copy him until he say "stop" ?

Upvotes: 0

Views: 387

Answers (1)

Sean Wei
Sean Wei

Reputation: 8015

You have to use your own database. If you don't have one, the easiest way is use file.

For instance, use file_get_contents("/tmp/tg-bot-{$chatid}-status") to get status. When received Sure, use file_put_contents("/tmp/tg-bot-{$chatid}-status", "REPLY") to set.

Upvotes: 1

Related Questions