feat:模块健康检查
This commit is contained in:
@ -18,6 +18,15 @@ class TelegramModule(_ModuleBase):
|
||||
def stop(self):
|
||||
self.telegram.stop()
|
||||
|
||||
def test(self) -> Tuple[bool, str]:
|
||||
"""
|
||||
测试模块连接性
|
||||
"""
|
||||
state = self.telegram.get_state()
|
||||
if state:
|
||||
return True, ""
|
||||
return False, "Telegram未就续,请检查参数设置和网络连接"
|
||||
|
||||
def init_setting(self) -> Tuple[str, Union[str, bool]]:
|
||||
return "MESSAGER", "telegram"
|
||||
|
||||
|
Reference in New Issue
Block a user