Merge pull request #14 from thsrite/main

This commit is contained in:
jxxghp
2023-11-29 15:19:28 +08:00
committed by GitHub
3 changed files with 37 additions and 6 deletions

View File

@@ -182,7 +182,7 @@
"MessageForward": {
"name": "消息转发",
"description": "根据正则转发通知到其他WeChat应用。",
"version": "1.0",
"version": "1.1",
"icon": "forward.png",
"color": "#32ABD1",
"author": "thsrite",
@@ -263,7 +263,7 @@
"InvitesSignin": {
"name": "药丸签到",
"description": "药丸论坛签到。",
"version": "1.1",
"version": "1.2",
"icon": "invites.png",
"color": "#FFFFFF",
"author": "thsrite",

View File

@@ -22,7 +22,7 @@ class InvitesSignin(_PluginBase):
# 插件图标
plugin_icon = "invites.png"
# 插件版本
plugin_version = "1.1"
plugin_version = "1.2"
# 插件作者
plugin_author = "thsrite"
# 作者主页
@@ -141,6 +141,13 @@ class InvitesSignin(_PluginBase):
if not res or res.status_code != 200:
logger.error("药丸签到失败")
# 发送通知
if self._notify:
self.post_message(
mtype=NotificationType.SiteMessage,
title="【药丸签到任务完成】",
text="签到失败请检查cookie是否失效")
return
sign_dict = json.loads(res.text)

View File

@@ -19,7 +19,7 @@ class MessageForward(_PluginBase):
# 插件图标
plugin_icon = "forward.png"
# 插件版本
plugin_version = "1.0"
plugin_version = "1.1"
# 插件作者
plugin_author = "thsrite"
# 作者主页
@@ -104,7 +104,7 @@ class MessageForward(_PluginBase):
'component': 'VTextarea',
'props': {
'model': 'wechat',
'rows': '3',
'rows': '5',
'label': '应用配置',
'placeholder': 'appid:corpid:appsecret一行一个配置'
}
@@ -126,7 +126,7 @@ class MessageForward(_PluginBase):
'component': 'VTextarea',
'props': {
'model': 'pattern',
'rows': '3',
'rows': '6',
'label': '正则配置',
'placeholder': '对应上方应用配置,一行一个,一一对应'
}
@@ -155,6 +155,28 @@ class MessageForward(_PluginBase):
]
}
]
},
{
'component': 'VRow',
'content': [
{
'component': 'VCol',
'props': {
'cols': 12,
},
'content': [
{
'component': 'VAlert',
'props': {
'type': 'info',
'variant': 'tonal',
'text': '应用配置可加注释:'
'appid:corpid:appsecret#站点通知'
}
}
]
}
]
}
]
}
@@ -209,6 +231,8 @@ class MessageForward(_PluginBase):
# 解析配置
wechats = self._wechat.split("\n")
for index, wechat in enumerate(wechats):
# 排除注释
wechat = wechat.split("#")[0]
wechat_config = wechat.split(":")
if len(wechat_config) != 3:
logger.error(f"{wechat} 应用配置不正确")