import message from '#wa/event/message';
import groupParticipants from '#wa/event/group-participants';

export default async function ({ sessionId, sock, events, }) {
    if (events['messages.upsert']) {
        message({ id: sessionId, sock, event: events['messages.upsert'] }).catch((err) => {
            console.error(`[WA: ${sessionId}] Error in message handler:`, err);
        });
    }

    if (events['group-participants.update']) {
        groupParticipants({ id: sessionId, sock, event: events['group-participants.update'] }).catch((err) => {
            console.error(`[WA: ${sessionId}] Error in group-participants handler:`, err);
        });
    }
}
