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.
This commit is contained in:
Kumi 2024-05-18 15:44:52 +02:00
parent 4e1e15e3cc
commit 1e13fc761b
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -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