forked from ibrahimaitech/BWM-NORMAL-BOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_getmsg.js
23 lines (22 loc) · 776 Bytes
/
_getmsg.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//import db from '../lib/database.js'
export async function all(m) {
if (!m.chat.endsWith('.net') || m.fromMe || m.key.remoteJid.endsWith('status@broadcast')) return
if (global.db.data.chats[m.chat].isBanned) return
if (global.db.data.users[m.sender].banned) return
if (m.isBaileys) return
let msgs = global.db.data.msgs
if (!(m.text in msgs)) return
let _m = this.serializeM(JSON.parse(JSON.stringify(msgs[m.text]), (_, v) => {
if (
v !== null &&
typeof v === 'object' &&
'type' in v &&
v.type === 'Buffer' &&
'data' in v &&
Array.isArray(v.data)) {
return Buffer.from(v.data)
}
return v
}))
await _m.copyNForward(m.chat, true)
}