pyTelegramBotAPI icon indicating copy to clipboard operation
pyTelegramBotAPI copied to clipboard

Send message without chat_Id

Open Arrmlet opened this issue 7 years ago • 4 comments

Please answer these questions before submitting your issue. Thanks!

  1. What version of pyTelegramBotAPI are you using? Newest
  2. What OS are you using? Ubuntu
  3. What version of python are you using? 3.6.2

I have created a telegram bot which send a messages, but it send the message only to one telegram account. How I can do this for all users which connected to my bot on telegram??

Arrmlet avatar Mar 14 '19 21:03 Arrmlet

for chat_id in user_storage:
   bot.send_message(chat_id, message)

No other way. PS. Yes, you need to collect and store all users wh visited your bot.

Badiboy avatar Mar 14 '19 21:03 Badiboy

@Badiboy Thanks for fast response, how I can collect all users which visited my bot( is there exist some api method for this?)

Arrmlet avatar Mar 14 '19 21:03 Arrmlet

@Arrmlet Process /start command in bot (anyway you need to do this) and store all ids of users who called that command. All storing routines is up to you: it's out of the pyTelegramBotAPI business.

Badiboy avatar Mar 14 '19 21:03 Badiboy

@Badiboy Thank you

Arrmlet avatar Mar 14 '19 22:03 Arrmlet