新增消息集合推送

This commit is contained in:
liulong 2024-09-24 16:05:29 +08:00
parent 961d43fb37
commit bda28e00ae
2 changed files with 34 additions and 3 deletions

23
fn_print.py Normal file
View File

@ -0,0 +1,23 @@
# -*- coding=UTF-8 -*-
# @Project QL_TimingScript
# @fileName fn_print.py
# @author Echo
# @EditTime 2024/9/24
from typing import *
all_print_list = []
def fn_print(*args, sep=' ', end='\n', **kwargs):
global all_print_list
output = ""
# 构建输出字符串
for index, arg in enumerate(args):
if index == len(args) - 1:
output += str(arg)
continue
output += str(arg) + sep
output = output + end
all_print_list.append(output)
# 调用内置的 print 函数打印字符串
print(*args, sep=sep, end=end, **kwargs)

View File

@ -3,7 +3,6 @@
# @fileName sendNotify.py
# @author Echo
# @EditTime 2024/9/13
from curses.ascii import FS
import sys
import os, re
import requests
@ -16,6 +15,8 @@ import urllib.parse
from requests.adapters import HTTPAdapter
from urllib3.util import Retry
from fn_print import all_print_list
cur_path = os.path.abspath(os.path.dirname(__file__))
root_path = os.path.split(cur_path)[0]
sys.path.append(root_path)
@ -465,7 +466,6 @@ def send(title, content):
continue
else:
print('此类推送方式不存在')
print("xxxxxxxxxxxx")
def main():
@ -477,7 +477,15 @@ def send_notification_message(title, content):
dingding_bot(title, content)
except Exception as e:
print("发送通知消息失败")
def send_notification_message_collection(title):
try:
send(title, ''.join(all_print_list))
except Exception as e:
if e:
print('发送通知消息失败!')
async def aysnc_send_notification_message(title, content):
try: