summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rw-r--r--main.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/main.py b/main.py
index bb521b1..bfa26bc 100644
--- a/main.py
+++ b/main.py
@@ -2,17 +2,19 @@ import asyncio, json, os
import hikari
import mautrix.client
+config = json.load(open("config.json", "r"))
+
dclient = hikari.GatewayBot(
- token=os.getenv("DISCORD_TOKEN"),
+ token=config["discord_token"],
intents=(hikari.Intents.MESSAGE_CONTENT|hikari.Intents.GUILD_MESSAGES)
)
mclient = mautrix.client.ClientAPI(
- os.getenv("MATRIX_USERID"),
- base_url=os.getenv("MATRIX_HOMESERVER"),
- token=os.getenv("MATRIX_TOKEN")
+ config["matrix_userid"],
+ base_url=config["matrix_homeserver"],
+ token=config["matrix_token"]
)
-rooms = {1196201613132574733: "!eChKdzVweNTyHctaKQ:wired.rehab"}
+rooms = config["rooms"]
async def matrix_init():
for room in rooms.values():
@@ -32,7 +34,7 @@ async def on_message(event: hikari.GuildMessageCreateEvent) -> None:
if not event.content:
return
- chanid = event.channel_id
+ chanid = str(event.channel_id)
if chanid in rooms.keys():
print(f"<{event.message.author.global_name}> {event.content}")