Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proxy_url = "http://proxy.server:3128"
- telepot.api._pools = {
- 'default': urllib3.ProxyManager(proxy_url=proxy_url, num_pools=3, maxsize=10, retries=False, timeout=30),
- }
- telepot.api._onetime_pool_spec = (urllib3.ProxyManager, dict(proxy_url=proxy_url, num_pools=1, maxsize=1, retries=False, timeout=30))
- secret = "ключ"
- bot = telepot.Bot('токен')
- bot.setWebhook("https://ganduras3.pythonanywhere.com/{}".format(secret), max_connections=100000000)
- app = Flask(__name__)
- @app.route('/{}'.format(secret), methods=["POST"])
- def telegram_webhook():
- update = request.get_json()
- if "message" in update:
- text = update["message"]["text"]
- chat_id = update["message"]["chat"]["id"]
- if text == '/start':
- bot.sendMessage(chat_id, 'здравствуйте...')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement