From e58006670547126dfe9db1e5f1427240deaf2ca8 Mon Sep 17 00:00:00 2001 From: zhourunlai Date: Tue, 7 Jan 2025 00:40:58 +0800 Subject: [PATCH] fix empty input text --- packages/client-direct/src/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/client-direct/src/index.ts b/packages/client-direct/src/index.ts index 8f7f224b00..561365d60f 100644 --- a/packages/client-direct/src/index.ts +++ b/packages/client-direct/src/index.ts @@ -226,6 +226,12 @@ export class DirectClient { ); const text = req.body.text; + // if empty text, directly return + if (!text) { + res.json([]); + return; + } + const messageId = stringToUuid(Date.now().toString()); const attachments: Media[] = [];