From edf6f10ed0939346c32f715e2803abeb581d84f8 Mon Sep 17 00:00:00 2001 From: git-bruh Date: Mon, 30 Nov 2020 20:57:21 +0530 Subject: [PATCH] Update --- main.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index cc26aa0..6aa3a9a 100644 --- a/main.py +++ b/main.py @@ -125,14 +125,19 @@ class MatrixClient(object): class DiscordClient(discord.Client): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + matrix_logger.info("Syncing forever.") + self.bg_task = self.loop.create_task( + matrix_client.sync_forever(timeout=30000)) + async def on_ready(self): print(f"Logged in as {self.user}") global channel channel = int(config["channel_id"]) channel = self.get_channel(channel) - matrix_logger.info("Syncing forever.") - await matrix_client.sync_forever(timeout=30000) async def on_message(self, message): if message.author.bot or str(message.channel.id) != \