This commit is contained in:
seb
2026-10-07 13:36:16 +02:00
parent 7045fe5e69
commit 8f46e59f08
19 changed files with 299 additions and 66 deletions

View File

@@ -966,16 +966,14 @@ const actions = {
* @param {object[]} [maybeAttachments]
*/
async sendMessage(textOrPayload, maybeAttachments = []) {
let trimmed = '';
let fileAttachments = [];
if (typeof textOrPayload === 'object' && textOrPayload !== null) {
trimmed = (textOrPayload.text || '').trim();
fileAttachments = Array.isArray(textOrPayload.attachments) ? textOrPayload.attachments : [];
} else {
trimmed = (textOrPayload || '').trim();
fileAttachments = Array.isArray(maybeAttachments) ? maybeAttachments : [];
}
const trimmed =
typeof textOrPayload === 'object' && textOrPayload !== null
? (textOrPayload.text || '').trim()
: (textOrPayload || '').trim();
const fileAttachments =
typeof textOrPayload === 'object' && textOrPayload !== null
? (Array.isArray(textOrPayload.attachments) ? textOrPayload.attachments : [])
: (Array.isArray(maybeAttachments) ? maybeAttachments : []);
if (!trimmed && fileAttachments.length === 0) return;