@areumtecnologia/baileys 1.1.0 → 1.1.1

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.
@@ -53,6 +53,11 @@ class GroupHandler {
53
53
  this.client._validateConnection();
54
54
  return this.client.sock.groupMetadata(groupId);
55
55
  }
56
+ /** Obtém a URL da foto de perfil de um grupo. */
57
+ async getProfilePicture(jid) {
58
+ this.client._validateConnection();
59
+ return this.client.sock.profilePictureUrl(jid, 'image');
60
+ }
56
61
 
57
62
  /** Cria um novo grupo a partir de uma lista de jids. */
58
63
  async create(subject, participantsJids) {
package/index.js CHANGED
@@ -168,7 +168,16 @@ class Client extends EventEmitter {
168
168
  break;
169
169
 
170
170
  case 'open':
171
- this.user = this.sock.user;
171
+ const wid = this.sock.user.id.replace(/:.*?@/, "@");
172
+ const statusMessage = await this.sock.fetchStatus(wid);
173
+ this.user = {
174
+ id: wid,
175
+ lid: this.sock.user.lid.replace(/:.*?@/, "@"),
176
+ name: this.sock.user.name,
177
+ slogan: statusMessage[0]?.status || null,
178
+ picture: await this.sock.profilePictureUrl(wid),
179
+ business: await this.sock.getBusinessProfile(wid),
180
+ };
172
181
  this.qrCode = null; // Limpa o QR code após a conexão
173
182
  this.connected = true;
174
183
  this.manualDisconnect = false;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@areumtecnologia/baileys",
3
- "version": "1.1.0",
4
- "description": "More baileys fork",
3
+ "version": "1.1.1",
4
+ "description": "More baileys Wrapper",
5
5
  "license": "ISC",
6
6
  "author": "Áreum Tecnologia",
7
7
  "type": "commonjs",
@@ -209,11 +209,16 @@ class MessageNormalizer {
209
209
  pollUpdate.pollCreationMessageKey.remoteJid,
210
210
  pollUpdate.pollCreationMessageKey.id
211
211
  );
212
+
213
+ if (!creationMsg) {
214
+ return null;
215
+ }
216
+
212
217
  creationMsg.raw.message.pollCreationMessage = creationMsg.raw.message.pollCreationMessage ? creationMsg.raw.message.pollCreationMessage :
213
218
  creationMsg.raw.message.pollCreationMessageV3;
214
219
 
215
220
  // Verifica se a mensagem de criação existe e tem a estrutura correta
216
- if (!creationMsg) {
221
+ if (!creationMsg.raw.message.pollCreationMessage) {
217
222
  console.warn("Mensagem de criação da enquete não encontrada na store ou sem estrutura válida");
218
223
  return {
219
224
  pollCreationMessageId: pollUpdate.pollCreationMessageKey?.id,