This commit is contained in:
jxxghp
2025-01-15 08:03:19 +08:00
parent 88f49da36b
commit 257df31131
2 changed files with 12 additions and 9 deletions

View File

@@ -491,11 +491,14 @@
"name": "Bark消息推送",
"description": "支持使用Bark发送消息通知。",
"labels": "消息通知",
"version": "1.1",
"version": "1.2",
"icon": "Bark_A.png",
"author": "jxxghp",
"level": 1,
"v2": true
"v2": true,
"history": {
"v1.2": "支持多人消息发送"
}
},
"PushDeerMsg": {
"name": "PushDeer消息推送",

View File

@@ -16,7 +16,7 @@ class BarkMsg(_PluginBase):
# 插件图标
plugin_icon = "Bark_A.png"
# 插件版本
plugin_version = "1.1"
plugin_version = "1.2"
# 插件作者
plugin_author = "jxxghp"
# 作者主页
@@ -139,7 +139,7 @@ class BarkMsg(_PluginBase):
'props': {
'model': 'apikey',
'label': '密钥',
'placeholder': '',
'placeholder': '每行一个用户密钥',
}
}
]
@@ -217,7 +217,7 @@ class BarkMsg(_PluginBase):
try:
if not self._server or not self._apikey:
return False, "参数未配置"
for apikey in self._apikey.split()
for apikey in self._apikey.split():
sc_url = "%s/%s/%s/%s" % (self._server, apikey, quote_plus(title), quote_plus(text))
if self._params:
sc_url = "%s?%s" % (sc_url, self._params)
@@ -227,13 +227,13 @@ class BarkMsg(_PluginBase):
code = ret_json['code']
message = ret_json['message']
if code == 200:
logger.info("Bark消息发送成功")
logger.info(f"{apikey} Bark消息发送成功")
else:
logger.warn(f"Bark消息发送失败{message}")
logger.warn(f"{apikey} Bark消息发送失败{message}")
elif res is not None:
logger.warn(f"Bark消息发送失败错误码{res.status_code},错误原因:{res.reason}")
logger.warn(f"{apikey} Bark消息发送失败错误码{res.status_code},错误原因:{res.reason}")
else:
logger.warn(f"Bark消息发送失败未获取到返回信息")
logger.warn(f"{apikey} Bark消息发送失败未获取到返回信息")
except Exception as msg_e:
logger.error(f"Bark消息发送失败{str(msg_e)}")