Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into asakura-mao
Browse files Browse the repository at this point in the history
  • Loading branch information
ColapsusHD committed Jan 15, 2025
2 parents ef1bc41 + c8ba3b4 commit beadf77
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 338 deletions.
17 changes: 11 additions & 6 deletions plugins/_cmdWithMedia.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
const { proto, generateWAMessage, areJidsSameUser } = (await import("baileys")).default;
const {
proto,
generateWAMessage,
areJidsSameUser,
} = (await import('baileys')).default;

export async function all(m, chatUpdate) {
if (m?.isBaileys) return;
if (!m?.message) return;
if (!m?.msg?.fileSha256) return;
if (m.isBaileys) return;
if (!m.message) return;
if (!m.msg.fileSha256) return;
if (!(Buffer.from(m.msg.fileSha256).toString('base64') in global.db.data.sticker)) return;

const hash = global.db.data.sticker[Buffer.from(m.msg.fileSha256).toString('base64')];
Expand All @@ -12,8 +16,8 @@ export async function all(m, chatUpdate) {
userJid: this.user.id,
quoted: m.quoted && m.quoted.fakeObj,
});
messages.key.fromMe = areJidsSameUser(m.sender, this.user.id);
messages.key.id = m.key.id;
messages.key.fromMe = m.isBaileys || (m.sender === m.conn?.user?.jid)
messages.key.id = m.key.id;
messages.pushName = m.pushName;
if (m.isGroup) messages.participant = m.sender;
const msg = {
Expand All @@ -23,3 +27,4 @@ export async function all(m, chatUpdate) {
};
this.ev.emit('messages.upsert', msg);
}

Loading

0 comments on commit beadf77

Please sign in to comment.