Each entry in the groups list is now a button. Tapping shows a group detail
view with [📝 Send Test Text]. Operator replies with the message body and
the bot sends it to the selected WhatsApp group via the live Baileys session,
records the action in audit_log, and shows success/failure inline.
This is a small forerunner of the full reminder send pipeline that plan 2
will build out (with media, scheduling, retries). Useful right now to
validate the end-to-end Telegram-to-WhatsApp send path during pairing tests.
11 lines
320 B
TypeScript
11 lines
320 B
TypeScript
import type { WASocket } from "@whiskeysockets/baileys";
|
|
|
|
export async function sendTextToGroup(
|
|
socket: WASocket,
|
|
groupJid: string,
|
|
text: string,
|
|
): Promise<{ messageId: string | undefined }> {
|
|
const result = await socket.sendMessage(groupJid, { text });
|
|
return { messageId: result?.key?.id ?? undefined };
|
|
}
|