This commit is contained in:
git-bruh 2020-11-30 20:57:21 +05:30
parent f21d6b8da7
commit edf6f10ed0
No known key found for this signature in database
GPG key ID: E1475C50075ADCE6

View file

@ -125,14 +125,19 @@ class MatrixClient(object):
class DiscordClient(discord.Client): 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): async def on_ready(self):
print(f"Logged in as {self.user}") print(f"Logged in as {self.user}")
global channel global channel
channel = int(config["channel_id"]) channel = int(config["channel_id"])
channel = self.get_channel(channel) channel = self.get_channel(channel)
matrix_logger.info("Syncing forever.")
await matrix_client.sync_forever(timeout=30000)
async def on_message(self, message): async def on_message(self, message):
if message.author.bot or str(message.channel.id) != \ if message.author.bot or str(message.channel.id) != \