File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,8 @@ def unknown_cli_command(bot, update):
106
106
107
107
def main ():
108
108
# 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 )
110
111
111
112
# Get the dispatcher to register handlers
112
113
dp = updater .dispatcher
@@ -125,13 +126,23 @@ def main():
125
126
126
127
# Start the Bot and store the update Queue, so we can insert updates
127
128
update_queue = updater .start_polling (poll_interval = 0.1 , timeout = 20 )
129
+
128
130
'''
129
131
# 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',
131
136
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)
135
146
'''
136
147
137
148
# Start CLI-Loop
You can’t perform that action at this time.
0 commit comments