mirror of
https://github.com/TDSCDMAA/AutoMihoyoBBS.git
synced 2026-06-03 02:49:12 +08:00
推送相关修改
This commit is contained in:
parent
a4de4cb5c0
commit
9dcb3f0f4e
@ -52,7 +52,7 @@ def main_multi(autorun: bool):
|
||||
time.sleep(random.randint(3, 10))
|
||||
print("")
|
||||
push_message = f'脚本执行完毕,共执行{len(config_list)}个配置文件,成功{len(results["ok"])}个,没执行{len(results["close"])}个,失败{len(results["error"])}个'\
|
||||
f'\r\n没执行的脚本: {results["close"]}\r\n执行失败的脚本: {results["error"]}'
|
||||
f'\r\n没执行的配置文件: {results["close"]}\r\n执行失败的配置文件: {results["error"]}'
|
||||
log.info(push_message)
|
||||
push.push(0,push_message)
|
||||
|
||||
|
||||
4
push.py
4
push.py
@ -1,5 +1,6 @@
|
||||
import os
|
||||
from request import http
|
||||
from loghelper import log
|
||||
from configparser import ConfigParser
|
||||
|
||||
cfg = ConfigParser()
|
||||
@ -57,10 +58,13 @@ def push(status, push_message):
|
||||
return 0
|
||||
if cfg.getboolean('setting', 'enable'):
|
||||
push_server = cfg.get('setting', 'push_server').lower()
|
||||
log.info("正在执行推送......")
|
||||
log.debug(f"推送所用的服务为:{push_server}")
|
||||
if push_server == "cqhttp":
|
||||
cq_http(status, push_message)
|
||||
elif push_server == "ftqq":
|
||||
ftqq(status, push_message)
|
||||
elif push_server == "pushplus":
|
||||
pushplus(status, push_message)
|
||||
log.info("推送完毕......")
|
||||
return 0
|
||||
|
||||
@ -24,7 +24,7 @@ if opt_id != 0:
|
||||
data={
|
||||
"token": SendKey,
|
||||
"title": "「米游社-签到」Error!",
|
||||
"content": opt_info.split()[-1] + "\n这里是运行相关日志:\r\n" + opt_info,
|
||||
"content": opt_info.split()[-1] + "\nHello!推送相关的设置已修改,请注意更新!\n这里是运行相关日志:\r\n" + opt_info,
|
||||
}
|
||||
)
|
||||
else:
|
||||
@ -34,7 +34,7 @@ else:
|
||||
data={
|
||||
"token": SendKey,
|
||||
"title": "「米游社-签到」OK!",
|
||||
"content": opt_info.split()[-1] + "\n这里是运行相关日志:\r\n" + opt_info,
|
||||
"content": opt_info.split()[-1] + "\nHello!推送相关的设置已修改,请注意更新!\n这里是运行相关日志:\r\n" + opt_info,
|
||||
}
|
||||
)
|
||||
exit(0)
|
||||
|
||||
@ -23,7 +23,7 @@ if opt_id != 0:
|
||||
url=send_Url,
|
||||
data={
|
||||
"title": "米游社脚本执行出错!",
|
||||
"desp": "这里是运行相关日志:\r\n" + opt_info
|
||||
"desp": "\nHello!推送相关的设置已修改,请注意更新!\n这里是运行相关日志:\r\n" + opt_info
|
||||
}
|
||||
)
|
||||
else:
|
||||
@ -31,7 +31,7 @@ else:
|
||||
url=send_Url,
|
||||
data={
|
||||
"title": "米游社脚本执行成功",
|
||||
"desp": "这里是运行相关日志:\r\n" + opt_info
|
||||
"desp": "\nHello!推送相关的设置已修改,请注意更新!\n这里是运行相关日志:\r\n" + opt_info
|
||||
}
|
||||
)
|
||||
print("OK!")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user