diff --git a/model/game/weapon.py b/model/game/weapon.py index a616aa47..4bc4ad93 100644 --- a/model/game/weapon.py +++ b/model/game/weapon.py @@ -6,8 +6,7 @@ from model.baseobject import BaseObject class WeaponInfo(BaseObject): - """ - 武器信息 + """武器信息 """ def __init__(self, item_id: int = 0, name: str = "", level: int = 0, main_item: Optional[GameItem] = None, diff --git a/plugins/errorhandler.py b/plugins/errorhandler.py index 1a0460b1..4507b543 100644 --- a/plugins/errorhandler.py +++ b/plugins/errorhandler.py @@ -7,10 +7,9 @@ import ujson from aiohttp import ClientConnectorError from genshin import InvalidCookies, GenshinException, TooManyRequests from httpx import ConnectTimeout -from pyrogram.errors import Forbidden from telegram import Update, ReplyKeyboardRemove from telegram.constants import ParseMode -from telegram.error import BadRequest, TimedOut +from telegram.error import BadRequest, TimedOut, Forbidden from telegram.ext import CallbackContext, ConversationHandler from config import config @@ -47,6 +46,7 @@ async def send_user_notification(update: Update, _: CallbackContext, text: str): def conversation_error_handler(func: Callable) -> Callable: """Conversation的错误处理修饰器 + 非常感谢 @Bibo-Joshi 提出的建议 """ diff --git a/plugins/post.py b/plugins/post.py index 03bc6442..88762d25 100644 --- a/plugins/post.py +++ b/plugins/post.py @@ -10,7 +10,8 @@ from telegram.helpers import escape_markdown from config import config from logger import Log from manager import listener_plugins_class -from model.apihelper import Hyperion, ArtworkImage +from model.apihelper.base import ArtworkImage +from model.apihelper.hyperion import Hyperion from plugins.base import BasePlugins from plugins.errorhandler import conversation_error_handler from service import BaseService diff --git a/service/gacha.py b/service/gacha.py index 246281e0..8bf407b4 100644 --- a/service/gacha.py +++ b/service/gacha.py @@ -1,4 +1,4 @@ -from model.apihelper import GachaInfo +from model.apihelper.gacha import GachaInfo from service.cache import RedisCache from service.repository import AsyncRepository diff --git a/service/game.py b/service/game.py index 56bd4e4b..076a2517 100644 --- a/service/game.py +++ b/service/game.py @@ -1,4 +1,4 @@ -from model.apihelper import Hyperion +from model.apihelper.hyperion import Hyperion from service.cache import RedisCache from service.repository import AsyncRepository diff --git a/test/service/test_game.py b/test/service/test_game.py index ef3d2378..64b755bd 100644 --- a/test/service/test_game.py +++ b/test/service/test_game.py @@ -1,7 +1,7 @@ import unittest from unittest import IsolatedAsyncioTestCase -from model.apihelper import Hyperion +from model.apihelper.hyperion import Hyperion class TestGame(IsolatedAsyncioTestCase):