How to Initiate a Specific Message to a User via a Telegram Bot Any Time After the User Starts the Bot?

38 Views Asked by At

I am currently developing a Telegram bot and facing a specific challenge. My goal is to enable the bot to send a message I write, to the user immediately after they start the bot. I am not sure how to trigger the bot to send a message once the '/start' command is issued by the user.

Here's what I have done so far:

  1. Created the bot using BotFather.
  2. Set up a basic command handler for '/start'.
  3. Able to receive messages from the user.

However, I am stuck at the point where I need the bot to initiate a conversation with the user right after they send the '/start' command and then send the message each time I tell the bot. I am looking for guidance on how to implement this functionality.

Can anyone provide insights or examples on how to achieve this? Specifically, I am interested in:

  • Detecting the '/start' command from the user.
  • Sending a response message from the bot to the user, which I write every time, immediately after the command is received.
0

There are 0 best solutions below