diff --git a/OlivaDiceLogger/app.json b/OlivaDiceLogger/app.json index bfc5f4a..a1c2be4 100644 --- a/OlivaDiceLogger/app.json +++ b/OlivaDiceLogger/app.json @@ -4,8 +4,8 @@ "namespace" : "OlivaDiceLogger", "message_mode" : "old_string", "info" : "本模块为OlivaDice的日志模块,提供了跑团日志记录器,它可以在跑团过程中对日志进行记录,并由结果生成跑团日志,与在线的跑团日志渲染器进行联动、或发送日志邮件。", - "version" : "3.0.8", - "svn" : 16, + "version" : "3.0.9", + "svn" : 17, "compatible_svn" : 101, "priority" : 20030, "support" : [ diff --git a/OlivaDiceLogger/data.py b/OlivaDiceLogger/data.py index 9ff46ed..910e287 100644 --- a/OlivaDiceLogger/data.py +++ b/OlivaDiceLogger/data.py @@ -15,8 +15,8 @@ ''' -OlivaDiceLogger_ver = '3.0.8' -OlivaDiceLogger_svn = 16 +OlivaDiceLogger_ver = '3.0.9' +OlivaDiceLogger_svn = 17 OlivaDiceLogger_ver_short = '%s(%s)' % (str(OlivaDiceLogger_ver), str(OlivaDiceLogger_svn)) dataPath = './plugin/data/OlivaDice/unity' diff --git a/OlivaDiceLogger/msgReply.py b/OlivaDiceLogger/msgReply.py index 4b5ae59..30bd35d 100644 --- a/OlivaDiceLogger/msgReply.py +++ b/OlivaDiceLogger/msgReply.py @@ -20,7 +20,10 @@ import hashlib import time +from datetime import datetime, timezone, timedelta import uuid +import json +import traceback def unity_init(plugin_event, Proc): pass @@ -275,6 +278,64 @@ def unity_reply(plugin_event, Proc): ) tmp_reply_str = OlivaDiceCore.msgCustomManager.formatReplySTR(dictStrCustom['strLoggerLogUrl'], dictTValue) replyMsg(plugin_event, tmp_reply_str) + try: + if plugin_event.indeAPI.hasAPI('create_message'): + plugin_event.indeAPI.create_message( + chat_type = 'group', + chat_id = plugin_event.data.group_id, + content_type = 10, + content = json.dumps( + [ + { + "type": "card", + "theme": "primary", + "color": "#009FE9", + "size": "lg", + "modules": [ + { + "type": "header", + "text": { + "type": "plain-text", + "content": "您的日志将在如下时间后过期,请尽快点击按钮提取" + } + }, + { + "type": "countdown", + "mode": "day", + "endTime": int((int(datetime.now(timezone.utc).timestamp()) + 7 * 24 * 60 * 60) * 1000) + }, + { + "type": "action-group", + "elements": [ + { + "type": "button", + "theme": "info", + "value": str(dictTValue['tLogUrl']), + "click": "link", + "text": { + "type": "plain-text", + "content": "点我提取日志" + } + } + ] + }, + { + "type": "context", + "elements": [ + { + "type": "plain-text", + "content": "OlivaDice - 青果核心掷骰机器人" + } + ] + } + ] + } + ], + ensure_ascii=False + ) + ) + except Exception as e: + traceback.print_exc() else: tmp_reply_str = OlivaDiceCore.msgCustomManager.formatReplySTR(dictStrCustom['strLoggerLogAlreadyEnd'], dictTValue) replyMsg(plugin_event, tmp_reply_str)