Загрузка...

Telegram bot that will execute a script on a specific message

Thread in Python created by natehero Sep 11, 2019. 393 views

  1. natehero
    natehero Topic starter Sep 11, 2019 Banned 79 Dec 15, 2018
    В шапке.
    Как сделать выполнение скрипта, когда отправляешь боту заданное сообщение?
     
  2. HCKR
    HCKR Sep 11, 2019 307 Feb 14, 2018
    В гугле десятки постов про боты
     
  3. asdfg298
    asdfg298 Sep 11, 2019 320 Feb 10, 2017
    Code
    $ pip install python-telegram-bot
    Code
    from telegram.ext import Updater, CommandHandler


    def hello(bot, update):
    if update.message.text == 'текст, на который бот должен реагировать':
    #тут твой скрипт


    updater = Updater('сюда токен бота')

    updater.dispatcher.add_handler(CommandHandler('hello', hello))

    updater.start_polling()
    updater.idle()
     
  4. natehero
    natehero Topic starter Sep 11, 2019 Banned 79 Dec 15, 2018
    Взаимодействие с telebot возможно?
     
  5. asdfg298
    asdfg298 Sep 11, 2019 320 Feb 10, 2017
    что это?
     
Loading...
Top