Can i send message to a specific user having their chat_id? #2566
-
Is it possible to send someone a message (that's me : D) if I have my chat_id and username? I already have the APscheduler code working on heroku and it works well and it can reply to messages received. But instead of replying, I want to be able to send message proactively (of course after i start their convo with bot)? what approach should i take? Happy to provide more details if needed. Any suggestion is appreciated : ) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi. Sending messages is as easy as calling |
Beta Was this translation helpful? Give feedback.
Hi. Sending messages is as easy as calling
bot.send_message
. In PTB, thebot
instance is usually available ascontext/dispatcher/updater.bot
, but you can also instantiate it yourself, if needed. Please see here and here.