From 1e13fc761b29c95360c68f373ee6e8a9ea701a0c Mon Sep 17 00:00:00 2001 From: Kumi Date: Sat, 18 May 2024 15:44:52 +0200 Subject: [PATCH] refactor(bot): streamline imports and cleanup unused Removed numerous unused imports from the bot.py module, including specific event types, error classes, and utilities no longer utilized in the current implementation. This cleanup enhances readability and maintainability of the codebase by eliminating clutter and focusing on what's essential for the bot's operation. The removal of unused libraries like functools and datetime, alongside specific nio classes, signifies a shift towards a more streamlined and efficient code structure. This change also potentially improves import times and reduces memory footprint, albeit marginally. --- src/matrix_reportbot/classes/bot.py | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/src/matrix_reportbot/classes/bot.py b/src/matrix_reportbot/classes/bot.py index 9c80257..7a6238a 100644 --- a/src/matrix_reportbot/classes/bot.py +++ b/src/matrix_reportbot/classes/bot.py @@ -1,5 +1,4 @@ import asyncio -import functools import aiohttp from nio import ( @@ -7,48 +6,22 @@ from nio import ( AsyncClientConfig, WhoamiResponse, DevicesResponse, - Event, - Response, MatrixRoom, Api, - RoomMessagesError, - GroupEncryptionError, - EncryptionError, - RoomMessageText, RoomSendResponse, SyncResponse, - RoomMessageNotice, JoinError, RoomLeaveError, RoomSendError, - RoomVisibility, - RoomCreateError, - RoomMessageMedia, - RoomMessageImage, - RoomMessageFile, - RoomMessageAudio, - DownloadError, - DownloadResponse, - ToDeviceEvent, - ToDeviceError, - RoomPutStateError, RoomGetStateError, ) from typing import Optional, List from configparser import ConfigParser -from datetime import datetime from io import BytesIO -from pathlib import Path -from contextlib import closing -import base64 import uuid -import traceback import json -import importlib.util -import sys -import traceback import markdown2