style: format direct send json

This commit is contained in:
Peter Steinberger
2026-01-07 01:21:03 +00:00
parent 2ce5df3efc
commit dd78c26e6d

View File

@@ -65,16 +65,20 @@ export async function sendCommand(
if (opts.json) { if (opts.json) {
runtime.log( runtime.log(
JSON.stringify( JSON.stringify(
{ {
provider, provider,
via: "direct", via: "direct",
to: opts.to, to: opts.to,
messageId: last?.messageId ?? "unknown", messageId: last?.messageId ?? "unknown",
...(last && "chatId" in last ? { chatId: last.chatId } : {}), ...(last && "chatId" in last ? { chatId: last.chatId } : {}),
...(last && "channelId" in last ? { channelId: last.channelId } : {}), ...(last && "channelId" in last
...(last && "timestamp" in last ? { timestamp: last.timestamp } : {}), ? { channelId: last.channelId }
mediaUrl: opts.media ?? null, : {}),
}, ...(last && "timestamp" in last
? { timestamp: last.timestamp }
: {}),
mediaUrl: opts.media ?? null,
},
null, null,
2, 2,
), ),