summaryrefslogtreecommitdiffstats
path: root/bot.py
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-03-09 01:21:59 -0700
committerPinapelz <yukais@pinapelz.com>2026-03-09 01:22:15 -0700
commit3c34982281cb6f3a8fc9bfef313e8149cad0cb50 (patch)
treef3df06a90f2d8ca873612b41bff11ab6b6f34024 /bot.py
parent6a31ee36a0660ff17b88b3e3707564ffbd2bdfd4 (diff)
add manual random games func
Diffstat (limited to 'bot.py')
-rw-r--r--bot.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/bot.py b/bot.py
index 244ba7e..bc44cb1 100644
--- a/bot.py
+++ b/bot.py
@@ -3,6 +3,7 @@ import os
from dotenv import load_dotenv
import constants
import restaurants
+import games
load_dotenv()
@@ -10,11 +11,13 @@ HOMESERVER = os.environ.get("HOMESERVER", "")
USERNAME = os.environ.get("USERNAME", "")
ACCESS_TOKEN = os.environ.get("ACCESS_TOKEN", "")
TARGET_ROOM_ID = os.environ.get("TARGET_ROOM_ID", "")
+SELF = os.environ.get("SELF")
creds = botlib.Creds(homeserver=HOMESERVER, username=USERNAME, access_token=ACCESS_TOKEN)
bot = botlib.Bot(creds)
restaurants.init_db()
+games.init_db()
@bot.listener.on_message_event
@@ -24,7 +27,10 @@ async def trigger_responses(room, message):
if room.room_id != TARGET_ROOM_ID:
return
- if await restaurants.handle_restaurant_command(bot.api, room.room_id, message.sender, message.body):
+ if await restaurants.handle_restaurant_command(bot.api, room.room_id, message.sender, message.body, SELF):
+ return
+
+ if await games.handle_game_command(bot.api, room.room_id, message.sender, message.body, SELF):
return
msg_text = message.body.strip().lower()
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage