Sajjad
Sajjad

Reputation: 41

Python-telegram-bot send message to phone numbers

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???

Upvotes: 0

Views: 4195

Answers (1)

Sean Wei
Sean Wei

Reputation: 7975

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.

Upvotes: 5

Related Questions