Created
August 25, 2016 04:45
-
-
Save Highstaker/af2a9e740431a29719541b7e56a60ef4 to your computer and use it in GitHub Desktop.
A simple bot working on webhooks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters | |
def msg_process(bot, update): | |
bot.sendMessage(131711493,update.message.text + " hello") | |
updater = Updater("176032236:AAF6h2YjwtUfsLP5K5O5wD8xV2dg3VadL5k") | |
disp = updater.dispatcher | |
updater.start_webhook(listen='0.0.0.0', | |
port=8443, | |
url_path='176032236:AAF6h2YjwtUfsLP5K5O5wD8xV2dg3VadL5k', | |
key='/tmp/private.key', | |
cert='/tmp/cert.pem', | |
webhook_url='https://185.70.187.235:8443/176032236:AAF6h2YjwtUfsLP5K5O5wD8xV2dg3VadL5k') | |
disp.add_handler(MessageHandler([Filters.text], msg_process)) | |
updater.idle() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment