Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
elrebelde21 authored Jul 9, 2024
1 parent cc7f89a commit a0dd1fe
Showing 1 changed file with 90 additions and 92 deletions.
182 changes: 90 additions & 92 deletions lib/simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -1468,20 +1468,20 @@ export function serialize() {

},
cMod: {
/**
/**
* Modify quoted Message
* @param {String} jid
* @param {String} text
* @param {String} sender
* @param {Object} options
*/
value(jid, text = '', sender = this.sender, options = {}) {
return self.conn?.cMod(jid, this.vM, text, sender, options);
},
enumerable: true,

},
delete: {
value(jid, text = '', sender = this.sender, options = {}) {
return self.conn?.cMod(jid, this.vM, text, sender, options)
},
enumerable: true,
},
delete: {
/**
* Delete quoted message
*/
Expand Down Expand Up @@ -1513,93 +1513,91 @@ export function serialize() {
writable: true,
},
text: {
get() {
const msg = this.msg;
const text = (typeof msg === 'string' ? msg : msg?.text) || msg?.caption || msg?.contentText || '';
return typeof this._text === 'string' ? this._text : '' || (typeof text === 'string' ? text : (
get() {
const msg = this.msg
const text = (typeof msg === 'string' ? msg : msg?.text) || msg?.caption || msg?.contentText || ''
return typeof this._text === 'string' ? this._text : '' || (typeof text === 'string' ? text : (
text?.selectedDisplayText ||
text?.hydratedTemplate?.hydratedContentText ||
text
)) || '';
},
set(str) {
return this._text = str;
},
enumerable: true,
},
mentionedJid: {
get() {
return this.msg?.contextInfo?.mentionedJid?.length && this.msg.contextInfo.mentionedJid || [];
},
enumerable: true,
},
name: {
get() {
return !nullish(this.pushName) && this.pushName || this.conn?.getName(this.sender);
},
enumerable: true,
},
download: {
value(saveToFile = false) {
const mtype = this.mediaType;
return this.conn?.downloadM(this.mediaMessage[mtype], mtype.replace(/message/i, ''), saveToFile);
},
enumerable: true,
configurable: true,
},
reply: {
value(text, chatId, options) {
return this.conn?.reply(chatId ? chatId : this.chat, text, this, options);
},
},
copy: {
value() {
const M = proto.WebMessageInfo;
return smsg(this.conn, M.fromObject(M.toObject(this)));
},
enumerable: true,
},
forward: {
value(jid, force = false, options = {}) {
return this.conn?.sendMessage(jid, {
forward: this, force, ...options,
}, {...options});
},
enumerable: true,
},
copyNForward: {
value(jid, forceForward = false, options = {}) {
return this.conn?.copyNForward(jid, this, forceForward, options);
},
enumerable: true,
},
cMod: {
value(jid, text = '', sender = this.sender, options = {}) {
return this.conn?.cMod(jid, this, text, sender, options);
},
enumerable: true,
},
getQuotedObj: {
value() {
if (!this.quoted.id) return null;
const q = proto.WebMessageInfo.fromObject(this.conn?.loadMessage(this.quoted.id) || this.quoted.vM);
return smsg(this.conn, q);
},
enumerable: true,
},
getQuotedMessage: {
get() {
return this.getQuotedObj;
},
},
delete: {
value() {
return this.conn?.sendMessage(this.chat, {delete: this.key});
},
enumerable: true,
},
});
}
)) || ''
},
set(str) {
return this._text = str
},
enumerable: true
},
mentionedJid: {
get() {
return this.msg?.contextInfo?.mentionedJid?.length && this.msg.contextInfo.mentionedJid || []
},
enumerable: true
},
name: {
get() {
return !nullish(this.pushName) && this.pushName || this.conn?.getName(this.sender)
},
enumerable: true
},
download: {
value(saveToFile = false) {
const mtype = this.mediaType
return this.conn?.downloadM(this.mediaMessage[mtype], mtype.replace(/message/i, ''), saveToFile)
},
enumerable: true,
configurable: true
},
reply: {
value(text, chatId, options) {
return this.conn?.reply(chatId ? chatId : this.chat, text, this, options)
}
},
copy: {
value() {
const M = proto.WebMessageInfo
return smsg(this.conn, M.fromObject(M.toObject(this)))
},
enumerable: true
},
forward: {
value(jid, force = false, options = {}) {
return this.conn?.sendMessage(jid, {
forward: this, force, ...options
}, { ...options })
},
enumerable: true
},
copyNForward: {
value(jid, forceForward = false, options = {}) {
return this.conn?.copyNForward(jid, this, forceForward, options)
},
enumerable: true
},
cMod: {
value(jid, text = '', sender = this.sender, options = {}) {
return this.conn?.cMod(jid, this, text, sender, options)
},
enumerable: true
},
getQuotedObj: {
value() {
if (!this.quoted.id) return null
const q = proto.WebMessageInfo.fromObject(this.conn?.loadMessage(this.quoted.id) || this.quoted.vM)
return smsg(this.conn, q)
},
enumerable: true
},
getQuotedMessage: {
get() {
return this.getQuotedObj
}
},
delete: {
value() {
return this.conn?.sendMessage(this.chat, { delete: this.key })
},
enumerable: true
},
//react
react: {
value(text) {
Expand Down

0 comments on commit a0dd1fe

Please sign in to comment.