mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 19:59:20 +00:00
feat: handle group messages
This commit is contained in:
@@ -9,7 +9,9 @@ export const GetWbotMessage = async (
|
||||
): Promise<WbotMessage> => {
|
||||
const wbot = await GetTicketWbot(ticket);
|
||||
|
||||
const wbotChat = await wbot.getChatById(`${ticket.contact.number}@c.us`);
|
||||
const wbotChat = await wbot.getChatById(
|
||||
`${ticket.contact.number}@${ticket.isGroup ? "g" : "c"}.us`
|
||||
);
|
||||
|
||||
try {
|
||||
const chatMessages = await wbotChat.fetchMessages({ limit: 20 });
|
||||
|
||||
Reference in New Issue
Block a user