Poll when webhook domain is missing
Hooks is not very easy to setup, so lets fallback to polling if the hook domain is not defined Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
parent
9c9a7f71f3
commit
ed158f0a47
1 changed files with 4 additions and 1 deletions
|
@ -221,4 +221,7 @@ bot.onUpdate(updateHandler)
|
||||||
bot.onCommand("start", startHandler)
|
bot.onCommand("start", startHandler)
|
||||||
bot.onCommand("ban", banHandler)
|
bot.onCommand("ban", banHandler)
|
||||||
bot.onCommand("unban", unbanHandler)
|
bot.onCommand("unban", unbanHandler)
|
||||||
bot.startWebhook(getEnv("HOOK_SECRET"), getEnv("HOOK_DOMAIN") & "/" & getEnv("HOOK_SECRET"))
|
if getEnv("HOOK_DOMAIN") != "":
|
||||||
|
bot.startWebhook(getEnv("HOOK_SECRET"), getEnv("HOOK_DOMAIN") & "/" & getEnv("HOOK_SECRET"))
|
||||||
|
else:
|
||||||
|
bot.poll(timeout=300)
|
||||||
|
|
Loading…
Reference in a new issue