This commit is contained in:
kf_wuhao 2021-01-13 17:59:17 +08:00
parent c8a5d1a426
commit da0f433eae

View File

@ -14,6 +14,10 @@ __all__ = ('ddsend_msg',)
local_db = get_local_db('admin_game') local_db = get_local_db('admin_game')
dd_conf = local_db['game'].find_one() or {} dd_conf = local_db['game'].find_one() or {}
msg_set = set()
def get_sign(): def get_sign():
timestamp = str(round(time.time() * 1000)) timestamp = str(round(time.time() * 1000))
@ -27,6 +31,13 @@ def get_sign():
def ddsend_msg(msg): def ddsend_msg(msg):
hash_msg = hmac.new(msg.encode('utf-8'), digestmod=hashlib.sha256).digest()
if hash_msg not in hash_msg:
msg_set.add(hash_msg)
else:
return
data = { data = {
'msgtype': 'text', 'msgtype': 'text',
'text': { 'text': {