diff --git a/core/quiz/repositories.py b/core/quiz/repositories.py index 8c4ab71..09a20f5 100644 --- a/core/quiz/repositories.py +++ b/core/quiz/repositories.py @@ -17,7 +17,7 @@ class QuizRepository: questions = results.all() return questions - async def get_answers_form_question_id(self, question_id: int) -> List[AnswerDB]: + async def get_answers_from_question_id(self, question_id: int) -> List[AnswerDB]: async with self.mysql.Session() as session: query = select(AnswerDB).where(AnswerDB.question_id == question_id) results = await session.exec(query) diff --git a/core/quiz/services.py b/core/quiz/services.py index 598dc74..471dcb3 100644 --- a/core/quiz/services.py +++ b/core/quiz/services.py @@ -12,7 +12,7 @@ class QuizService: self._cache = cache self.lock = asyncio.Lock() - async def get_quiz_form_database(self) -> List[Question]: + async def get_quiz_from_database(self) -> List[Question]: """从数据库获取问题列表 :return: Question List """ @@ -20,7 +20,7 @@ class QuizService: question_list = await self._repository.get_question_list() for question in question_list: question_id = question.id - answers = await self._repository.get_answers_form_question_id(question_id) + answers = await self._repository.get_answers_from_question_id(question_id) data = Question.de_database_data(question) data.answers = [Answer.de_database_data(a) for a in answers] temp.append(data) @@ -37,7 +37,7 @@ class QuizService: """ # 只允许一个线程访问该区域 让数据被安全有效的访问 async with self.lock: - question_list = await self.get_quiz_form_database() + question_list = await self.get_quiz_from_database() await self._cache.del_all_question() question_count = await self._cache.add_question(question_list) await self._cache.del_all_answer() diff --git a/plugins/genshin/material.py b/plugins/genshin/material.py index e84a4bf..c4a1858 100644 --- a/plugins/genshin/material.py +++ b/plugins/genshin/material.py @@ -59,7 +59,7 @@ class Material(BasePlugins): Log.info(f"用户 {user.full_name}[{user.id}] 查询角色培养素材命令请求 || 参数 {character_name}") await message.reply_chat_action(ChatAction.UPLOAD_PHOTO) file_path = await url_to_file(url, "") - caption = "Form 米游社 友人A " \ + caption = "From 米游社 友人A " \ f"查看 [原图]({url})" await message.reply_photo(photo=open(file_path, "rb"), caption=caption, filename=f"{character_name}.png", allow_sending_without_reply=True, parse_mode=ParseMode.MARKDOWN_V2) diff --git a/plugins/genshin/strategy.py b/plugins/genshin/strategy.py index d4fe43e..0dd1045 100644 --- a/plugins/genshin/strategy.py +++ b/plugins/genshin/strategy.py @@ -57,7 +57,7 @@ class Strategy(BasePlugins): Log.info(f"用户 {user.full_name}[{user.id}] 查询角色攻略命令请求 || 参数 {character_name}") await message.reply_chat_action(ChatAction.UPLOAD_PHOTO) file_path = await url_to_file(url, "") - caption = "Form 米游社 西风驿站 " \ + caption = "From 米游社 西风驿站 " \ f"查看 [原图]({url})" await message.reply_photo(photo=open(file_path, "rb"), caption=caption, filename=f"{character_name}.png", allow_sending_without_reply=True, parse_mode=ParseMode.MARKDOWN_V2)