|
|
|
@ -53,11 +53,13 @@ export class WebhookServer {
|
|
|
|
|
|
|
|
|
|
private static async handleMessageUpsert(data: any) {
|
|
|
|
|
// Basic message validation
|
|
|
|
|
if (!data?.key?.remoteJid || !data.message) return;
|
|
|
|
|
if (!data?.key?.remoteJid || !data.message || !data.message.conversation) return;
|
|
|
|
|
|
|
|
|
|
// Forward to command service if applicable
|
|
|
|
|
// Forward to command service only if:
|
|
|
|
|
// 1. It's a text message (has conversation field)
|
|
|
|
|
// 2. Starts with /tarea command
|
|
|
|
|
const messageText = data.message.conversation;
|
|
|
|
|
if (messageText?.startsWith('/tarea')) {
|
|
|
|
|
if (typeof messageText === 'string' && messageText.trim().startsWith('/tarea')) {
|
|
|
|
|
const responses = await CommandService.handle({
|
|
|
|
|
sender: data.key.participant,
|
|
|
|
|
groupId: data.key.remoteJid,
|
|
|
|
|