Only set webhook if __main__
This commit is contained in:
parent
08a45dcd8a
commit
51b7d057e9
1 changed files with 4 additions and 3 deletions
7
main.py
7
main.py
|
@ -15,9 +15,6 @@ db.app = app
|
|||
db.init_app(app)
|
||||
|
||||
bot = telebot.TeleBot(config['bot']['token'], threaded=False)
|
||||
bot.remove_webhook()
|
||||
time.sleep(0.1)
|
||||
bot.set_webhook(url='https://{base}/{key}/'.format(base=app.config['bot']['base_url'], key=app.config['bot']['token']))
|
||||
|
||||
|
||||
def channel_commands(message, commands):
|
||||
|
@ -69,4 +66,8 @@ def webhook(key):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
bot.remove_webhook()
|
||||
time.sleep(0.1)
|
||||
bot.set_webhook(url='https://{base}/{key}/'.format(base=app.config['bot']['base_url'], key=app.config['bot']['token']))
|
||||
|
||||
app.run()
|
||||
|
|
Loading…
Add table
Reference in a new issue