Skip to content

Commit

Permalink
fix: Fixed WPP.chat.forwardMessage (#1301) (fix #1300)
Browse files Browse the repository at this point in the history
  • Loading branch information
keyurboss committed Aug 26, 2023
1 parent 331de74 commit 67089d7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/chat/functions/forwardMessage.ts
Expand Up @@ -15,8 +15,8 @@
*/

import { assertFindChat } from '../../assert';
import { MsgKey, Wid } from '../../whatsapp';
import { getMessageById, RawMessage } from '..';
import { ChatStore, MsgKey, Wid } from '../../whatsapp';
import { getMessageById } from '..';

export interface ForwardMessagesOptions {
displayCaptionText?: boolean;
Expand All @@ -38,14 +38,13 @@ export async function forwardMessage(
toChatId: string | Wid,
msgId: string | MsgKey,
options: ForwardMessagesOptions = {}
): Promise<RawMessage[]> {
): Promise<boolean> {
const chat = await assertFindChat(toChatId);

const msg = await getMessageById(msgId);

return await chat.forwardMessages(
return await ChatStore.forwardMessagesToChats(
[msg],
options.multicast,
[chat],
options.displayCaptionText
);
}

0 comments on commit 67089d7

Please sign in to comment.