From 6cf4855aa42327ac0059b3cd8738ccc9e2e9bbf9 Mon Sep 17 00:00:00 2001 From: git-bruh Date: Tue, 1 Dec 2020 12:08:59 +0530 Subject: [PATCH] Imports --- main.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/main.py b/main.py index 3ed257a..69533c9 100644 --- a/main.py +++ b/main.py @@ -1,15 +1,9 @@ import discord -import re import json import logging -from nio import ( - AsyncClient, - RoomMessageText, - RoomMessageMedia, - RedactionEvent, - EphemeralEvent -) +import nio import os +import re def config_gen(config_file): @@ -51,7 +45,7 @@ class MatrixClient(object): global matrix_client - matrix_client = AsyncClient(homeserver, username) + matrix_client = nio.AsyncClient(homeserver, username) matrix_logger.info(await matrix_client.login(password)) @@ -62,13 +56,13 @@ class MatrixClient(object): callbacks = Callbacks() matrix_client.add_event_callback( callbacks.message_callback, - (RoomMessageText, RoomMessageMedia)) + (nio.RoomMessageText, nio.RoomMessageMedia)) matrix_client.add_event_callback( - callbacks.redaction_callback, RedactionEvent) + callbacks.redaction_callback, nio.RedactionEvent) matrix_client.add_ephemeral_callback( - callbacks.typing_callback, EphemeralEvent) + callbacks.typing_callback, nio.EphemeralEvent) matrix_logger.info("Syncing forever.") await matrix_client.sync_forever(timeout=timeout)