新增会话注册

This commit is contained in:
2025-11-15 15:03:44 +08:00
parent 8a461df181
commit 924d5c3e12

View File

@@ -1006,7 +1006,7 @@ class WPSAPI(BasicWPSInterface):
@override @override
def get_webhook_url(self, message: str, chat_id: int, user_id: int) -> str: def get_webhook_url(self, message: str, chat_id: int, user_id: int) -> str:
webhook_url = ProjectConfig().GetFile(f"webhook_url/{chat_id}",False).LoadAsText() webhook_url = ProjectConfig().GetFile(f"webhook_url/{chat_id}",True).LoadAsText()
if webhook_url == "": if webhook_url == "":
webhook_url = MAIN_WEBHOOK_URL webhook_url = MAIN_WEBHOOK_URL
return webhook_url return webhook_url
@@ -1069,7 +1069,7 @@ class WPSAPIWebhook(WPSAPI):
@override @override
async def callback(self, message: str, chat_id: int, user_id: int) -> str|None: async def callback(self, message: str, chat_id: int, user_id: int) -> str|None:
ProjectConfig().GetFile(f"webhook_url/{chat_id}",False).SaveAsText(message) ProjectConfig().GetFile(f"webhook_url/{chat_id}",True).SaveAsText(message)
return await self.send_markdown_message(f"会话注册成功", chat_id, user_id) return await self.send_markdown_message(f"会话注册成功", chat_id, user_id)
logger.SaveProperties() logger.SaveProperties()