@roidev/kachina-md 2.1.7 → 2.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -76,7 +76,7 @@ export class Client extends EventEmitter {
76
76
  this.config = {
77
77
  sessionId: options.sessionId || 'kachina-session',
78
78
  phoneNumber: options.phoneNumber || '',
79
- owner: options.owners || [],
79
+ owners: options.owners || [],
80
80
  loginMethod: options.loginMethod || 'qr', // 'qr' or 'pairing'
81
81
  browser: options.browser || ['Kachina-MD', 'Chrome', '1.0.0'],
82
82
  logger: options.logger || pino({ level: 'silent' }),
@@ -234,18 +234,18 @@ export class PluginHandler {
234
234
 
235
235
  /**
236
236
  * Check if user is bot owner
237
- * @param {string} jid - User JID to check
237
+ * @param {string} lid - User JID to check
238
238
  * @returns {boolean} True if user is owner
239
239
  * @example
240
240
  * if (handler.isOwner(m.sender)) {
241
241
  * // Owner-only logic
242
242
  * }
243
243
  */
244
- isOwner(jid) {
245
- const owners = this.client.config.owners || this.client.config.owner || [];
244
+ isOwner(lid) {
245
+ const owners = this.client.config.owners || [];
246
246
  const ownerList = Array.isArray(owners) ? owners : [owners];
247
- const number = jid.split('@')[0];
248
- return ownerList.includes(number) || ownerList.includes(jid);
247
+ const number = lid.split('@')[0];
248
+ return ownerList.includes(number) || ownerList.includes(lid);
249
249
  }
250
250
 
251
251
  /**
@@ -64,16 +64,16 @@ export async function serialize(messages, sock) {
64
64
  // Get quoted message
65
65
  const quoted = msg.message?.[type]?.contextInfo?.quotedMessage;
66
66
  if (quoted) {
67
- m.quoted = await serialize({
67
+ m.quoted = await serialize([{
68
68
  key: {
69
69
  remoteJid: m.chat,
70
70
  fromMe: msg.message[type].contextInfo.participant === sock.user.id,
71
71
  id: msg.message[type].contextInfo.stanzaId,
72
- participant: m.isGroup ? m.key?.participantLid : m.key?.participant
72
+ participant: m.isGroup ? m.key.participantLid : m.key.participant
73
73
  },
74
74
  message: quoted,
75
75
  pushName: msg.message[type].contextInfo.pushName || ''
76
- }, sock);
76
+ }], sock);
77
77
  }
78
78
 
79
79
  // Media info
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roidev/kachina-md",
3
- "version": "2.1.7",
3
+ "version": "2.1.8",
4
4
  "description": "WhatsApp Bot Framework - Simple, Fast, and Modular",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",