0

I create a telegram bot with framework python-telegram-bot. I have a little phone numbers,Now I want send message to phone numbers. The phone numbers have an account in Telegram,and this is my codes:

from telegram.ext import Updater, MessageHandler, Filters
def start_method(bot, update):
    bot.send_message(chat_id='Phone number', "Hello")
def main():
    updater = Updater(token='TOKEN')
    updater.dispatcher.add_handler(MessageHandler(Filters.text, start_method))
    updater.start_polling()
    updater.idle()
if __name__ == '__main__':
    main()

But;this codes don't work and not give me an error!!!

How can I do???

Sajjad
  • 41
  • 1
  • 4
  • 13

1 Answers1

5

You can't do that at this time, since bots can't be first to chat, you have to give your users bot link like t.me/Sean_Bot, and ask them to START.

Sean Wei
  • 7,433
  • 1
  • 19
  • 39