# 风控处理,随机延迟发送,解决群消息高频发送导致的微信风险
This commit is contained in:
5
robot.py
5
robot.py
@@ -7,6 +7,7 @@ import xml.etree.ElementTree as ET
|
|||||||
from queue import Empty
|
from queue import Empty
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
import random
|
||||||
|
|
||||||
from base.func_epic import is_friday, get_free
|
from base.func_epic import is_friday, get_free
|
||||||
from base.func_zhipu import ZhiPu
|
from base.func_zhipu import ZhiPu
|
||||||
@@ -284,6 +285,10 @@ class Robot(Job):
|
|||||||
:param at_list: 要@的wxid, @所有人的wxid为:notify@all
|
:param at_list: 要@的wxid, @所有人的wxid为:notify@all
|
||||||
"""
|
"""
|
||||||
# msg 中需要有 @ 名单中一样数量的 @
|
# msg 中需要有 @ 名单中一样数量的 @
|
||||||
|
|
||||||
|
# 风控处理,随机延迟发送,解决群消息高频发送导致的微信风险
|
||||||
|
time.sleep(random.uniform(0.3, 1.0))
|
||||||
|
|
||||||
ats = ""
|
ats = ""
|
||||||
if at_list:
|
if at_list:
|
||||||
if at_list == "notify@all": # @所有人
|
if at_list == "notify@all": # @所有人
|
||||||
|
|||||||
Reference in New Issue
Block a user