Skip to content

Commit 185bff7

Browse files
committed
update example
1 parent 9f07900 commit 185bff7

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

examples/updater_bot.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ def unknown_cli_command(bot, update):
106106

107107
def main():
108108
# Create the EventHandler and pass it your bot's token.
109-
updater = Updater("TOKEN", workers=2)
109+
token = 'token'
110+
updater = Updater(token, workers=2)
110111

111112
# Get the dispatcher to register handlers
112113
dp = updater.dispatcher
@@ -125,13 +126,23 @@ def main():
125126

126127
# Start the Bot and store the update Queue, so we can insert updates
127128
update_queue = updater.start_polling(poll_interval=0.1, timeout=20)
129+
128130
'''
129131
# Alternatively, run with webhook:
130-
update_queue = updater.start_webhook('example.com',
132+
updater.bot.setWebhook(webhook_url='https://example.com/%s' % token,
133+
certificate=open('cert.pem', 'wb'))
134+
135+
update_queue = updater.start_webhook('0.0.0.0',
131136
443,
132-
'cert.pem',
133-
'key.key',
134-
listen='0.0.0.0')
137+
url_path=token,
138+
cert='cert.pem',
139+
key='key.key')
140+
141+
# Or, if SSL is handled by a reverse proxy, the webhook URL is already set
142+
# and the reverse proxy is configured to deliver directly to port 6000:
143+
144+
update_queue = updater.start_webhook('0.0.0.0',
145+
6000)
135146
'''
136147

137148
# Start CLI-Loop

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy