diff --git a/src/nim_censor_bot.nim b/src/nim_censor_bot.nim index ab7923b..a16df9f 100644 --- a/src/nim_censor_bot.nim +++ b/src/nim_censor_bot.nim @@ -221,4 +221,7 @@ bot.onUpdate(updateHandler) bot.onCommand("start", startHandler) bot.onCommand("ban", banHandler) 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)