Skip to content

Commit

Permalink
add quoted message and media message to properties
Browse files Browse the repository at this point in the history
  • Loading branch information
nartos9090 committed Mar 13, 2023
1 parent 0686b69 commit c56aef6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/fw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,14 @@ function handleSock(sock) {
groupJid: null,
textMessage,
message: msg.message,
imageMessage: msg.message.imageMessage || null,
audioMessage: msg.message.audioMessage || null,
videoMessage: msg.message.videoMessage || null,
documentMessage: msg.message.documentMessage || null,
stickerMessage: msg.message.stickerMessage || null,
msg,
remoteJid: msg.key.remoteJid,
quotedMessage: msg.message?.extendedTextMessage?.contextInfo?.quotedMessage || null,
}

if (properties.isGroup) {
Expand Down
14 changes: 13 additions & 1 deletion src/interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import {WAMessage, WASocket} from '@adiwajshing/baileys'
import {proto, WAMessage, WASocket} from '@adiwajshing/baileys'
import IMessage = proto.IMessage;
import IImageMessage = proto.Message.IImageMessage;
import IAudioMessage = proto.Message.IAudioMessage;
import IVideoMessage = proto.Message.IVideoMessage;
import IDocumentMessage = proto.Message.IDocumentMessage;
import IStickerMessage = proto.Message.IStickerMessage;

export interface Properties {
command: string,
Expand All @@ -10,6 +16,12 @@ export interface Properties {
textMessage?: string | null
message: any,
msg: WAMessage,
quotedMessage?: IMessage|null,
imageMessage: IImageMessage|null,
audioMessage: IAudioMessage|null,
videoMessage: IVideoMessage|null,
documentMessage: IDocumentMessage|null,
stickerMessage: IStickerMessage|null,
[key: string]: any
}

Expand Down

0 comments on commit c56aef6

Please sign in to comment.