1
votes

Is it possible to get a bot to send the first message in the chat without running a command like "/Start"?

Maybe it possible to save the chat_id of the requested user in advance and send him a message in the future, thus allowing the bot to send a first message in chat according to a predefined condition that will trigger him?

I searched for an answer online but could not find one. Can you send me a link to a tutorial that explains how to do this? Thanks in advance

Yoav Giladi :)

1

1 Answers

2
votes

One solution is to use a Telegram Bot deeplink to provide an entry point to the Chatbot that does not require the users typing the /Start command.

After the very first interaction you can the obtain the chat_id which can be stored for using it to initiate a message later:

context.bot.send_message(chat_id, text='Howdy')