summaryrefslogtreecommitdiffstats
path: root/taulubot.py
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-07-19 10:42:15 +0300
committerJan Tuomi <jan@jantuomi.fi>2025-07-19 10:42:15 +0300
commit5a636abf7e98a5687811167917d0e07103599bc8 (patch)
tree682f8d70d194c6bf02b750780f05689fcb83ba5a /taulubot.py
parente1ae18d1bc9e26f8ab817ca1c1e4e271badf02ad (diff)
Vendor the unmaintained telepot dependency
Diffstat (limited to 'taulubot.py')
-rw-r--r--taulubot.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/taulubot.py b/taulubot.py
index 6b9c1a2..27f3b1b 100644
--- a/taulubot.py
+++ b/taulubot.py
@@ -1,7 +1,7 @@
import random
import time
from pprint import pprint
-import telepot
+from telepot import Bot
from telepot.loop import MessageLoop
import time
from PIL import Image
@@ -24,7 +24,7 @@ START_TIME = calendar.timegm(time.gmtime())
wooden_im.thumbnail(img_size)
golden_im.thumbnail(img_size)
-bot = telepot.Bot(BOT_TOKEN)
+bot = Bot(BOT_TOKEN)
logging.warning("Connected with token {}".format(BOT_TOKEN))
last_user_by_chat_id = {}
@@ -136,6 +136,10 @@ def handle(msg):
logging.warning("Listening...")
-MessageLoop(bot, handle).run_forever(
+MessageLoop(bot, handle).run_as_thread(
allowed_updates=["message"],
)
+
+# Run forever
+while True:
+ time.sleep(1)