菜园系统引入私发
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from typing import Any, Dict, List, Optional, Sequence, Type, Union
|
from typing import Any, Dict, List, Optional, Sequence, Type, Union, override
|
||||||
|
|
||||||
from PWF.Convention.Runtime.Architecture import Architecture
|
from PWF.Convention.Runtime.Architecture import Architecture
|
||||||
from PWF.Convention.Runtime.GlobalConfig import ConsoleFrontColor, ProjectConfig
|
from PWF.Convention.Runtime.GlobalConfig import ConsoleFrontColor, ProjectConfig
|
||||||
@@ -200,6 +200,15 @@ class WPSGardenBase(WPSAPI):
|
|||||||
cls._service.recover_overdue_plots()
|
cls._service.recover_overdue_plots()
|
||||||
return cls._service
|
return cls._service
|
||||||
|
|
||||||
|
@override
|
||||||
|
def get_webhook_url(self, message: str, user_id: int) -> str:
|
||||||
|
config : WPSConfigAPI = Architecture.Get(WPSConfigAPI)
|
||||||
|
url = config.get_user_url(user_id)
|
||||||
|
if url:
|
||||||
|
return url
|
||||||
|
else:
|
||||||
|
return super().get_webhook_url(message, user_id)
|
||||||
|
|
||||||
def dependencies(self) -> List[Type]:
|
def dependencies(self) -> List[Type]:
|
||||||
return [
|
return [
|
||||||
WPSConfigAPI,
|
WPSConfigAPI,
|
||||||
@@ -398,7 +407,7 @@ class WPSGardenBase(WPSAPI):
|
|||||||
return
|
return
|
||||||
message = (
|
message = (
|
||||||
"# 🌾 作物成熟提醒\n"
|
"# 🌾 作物成熟提醒\n"
|
||||||
f"- 地块 {plot_index}:{crop.display_name} 已成熟,记得收获!"
|
f"- 地块 {plot_index}:{crop.display_name} 已成熟,记得收获!"
|
||||||
)
|
)
|
||||||
await self.send_markdown_message(message, chat_id, user_id)
|
await self.send_markdown_message(message, chat_id, user_id)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user