From 465b81e10d5c97352a1e8bf75478835fe699cb2b Mon Sep 17 00:00:00 2001 From: "Songyang.Huo" Date: Sat, 2 Dec 2023 19:11:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AE=A9TestAdapter=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=8F=91=E9=80=81=E6=97=A0ID=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amiyabot/adapters/test/builder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/amiyabot/adapters/test/builder.py b/amiyabot/adapters/test/builder.py index 32c2a5c..43d8676 100644 --- a/amiyabot/adapters/test/builder.py +++ b/amiyabot/adapters/test/builder.py @@ -10,7 +10,10 @@ async def build_message_send(chain: Chain, custom_chain: Optional[CHAIN_LIST] = chain_data = [] voice_list = [] - event_id = chain.data.message_id + if chain.data and chain.data.message_id: + event_id = chain.data.message_id + else: + event_id = str(uuid.uuid4()) if chain_list: for item in chain_list: From 0eecd02201fd9a9b6c8ee559a2e5a6da69c3ac8d Mon Sep 17 00:00:00 2001 From: Vivien <34387011+vivien8261@users.noreply.github.com> Date: Fri, 5 Jan 2024 11:48:50 +0800 Subject: [PATCH 2/2] Update builder.py --- amiyabot/adapters/test/builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amiyabot/adapters/test/builder.py b/amiyabot/adapters/test/builder.py index 43d8676..7c1b20d 100644 --- a/amiyabot/adapters/test/builder.py +++ b/amiyabot/adapters/test/builder.py @@ -1,4 +1,4 @@ -import os +import uuid import base64 from amiyabot.builtin.messageChain import Chain