summaryrefslogtreecommitdiffstats
path: root/taulubot.py
diff options
context:
space:
mode:
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)