Skip to content

Commit

Permalink
fix undefined message key
Browse files Browse the repository at this point in the history
  • Loading branch information
nartos9090 committed Mar 9, 2023
1 parent ebd171a commit 0686b69
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/fw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function handleSock(sock) {
groupJid: null,
textMessage,
message: msg.message,
msg,
remoteJid: msg.key.remoteJid,
}

Expand Down
3 changes: 2 additions & 1 deletion src/interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WASocket } from '@adiwajshing/baileys'
import {WAMessage, WASocket} from '@adiwajshing/baileys'

export interface Properties {
command: string,
Expand All @@ -9,6 +9,7 @@ export interface Properties {
groupJid?: string | null,
textMessage?: string | null
message: any,
msg: WAMessage,
[key: string]: any
}

Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ async function sendMessageWithTyping (sock, jid: string, content: AnyMessageCont
}

async function quoteReply(sock, props: Properties, content: AnyMessageContent, options?: MiscMessageGenerationOptions) {
await sock.sendMessage(props.remoteJid, content, { quoted: props.message, ...options })
await sock.sendMessage(props.remoteJid, content, { quoted: props.msg, ...options })
}

async function quoteReplyWithTyping(sock, props: Properties, content: AnyMessageContent, options?: MiscMessageGenerationOptions) {
await sendMessageWithTyping(sock, props.remoteJid, content, { quoted: props.message,...options })
await sendMessageWithTyping(sock, props.remoteJid, content, { quoted: props.msg,...options })
}

export {
Expand Down

0 comments on commit 0686b69

Please sign in to comment.