[PR #12] [FEATURE]: listener for labels association events created #51

Open
opened 2026-02-27 10:25:40 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mimamch/wa-multi-session/pull/12
Author: @MateoMax-hub
Created: 7/24/2023
Status: 🔄 Open

Base: masterHead: feature/labels-association-event


📝 Commits (2)

  • d642f7f listener for labels association events created
  • f058ea4 labels edit event listener created

📊 Changes

3 files changed (+37 additions, -2 deletions)

View changed files

📝 package-lock.json (+23 -2)
📝 src/Defaults/index.ts (+2 -0)
📝 src/Socket/index.ts (+12 -0)

📄 Description

FEATURE:
event for labels.association are now assigned to a a new listener "ON_LABEL_ASSOCIATION" and used on the function "onLabelAssociation", the function will receive a callback to execute each time the events get triggered (adding o removing a label on a chat), in the parameters of the callback you will receive an obj like this:

{
  'labels.association': {
    type: 'add',
    association: {
      type: 'label_jid',
      chatId: '(number-of-the-chat-here)@s.whatsapp.net',
      labelId: '3'
    }
  }
}

type can be add or remove depending if you are adding or removing a label, and labelId is an id for the label selected to do this event, i'm planning on making a function to get the labels an maybe i can at that point integrate it with this so you can get the labelId and it's name too


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mimamch/wa-multi-session/pull/12 **Author:** [@MateoMax-hub](https://github.com/MateoMax-hub) **Created:** 7/24/2023 **Status:** 🔄 Open **Base:** `master` ← **Head:** `feature/labels-association-event` --- ### 📝 Commits (2) - [`d642f7f`](https://github.com/mimamch/wa-multi-session/commit/d642f7f8fe66b5607d3052fc11903d27a153dd1c) listener for labels association events created - [`f058ea4`](https://github.com/mimamch/wa-multi-session/commit/f058ea417cee9ee164e20c0c58aa1d8db3b3f124) labels edit event listener created ### 📊 Changes **3 files changed** (+37 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `package-lock.json` (+23 -2) 📝 `src/Defaults/index.ts` (+2 -0) 📝 `src/Socket/index.ts` (+12 -0) </details> ### 📄 Description FEATURE: event for labels.association are now assigned to a a new listener "ON_LABEL_ASSOCIATION" and used on the function "onLabelAssociation", the function will receive a callback to execute each time the events get triggered (adding o removing a label on a chat), in the parameters of the callback you will receive an obj like this: ``` { 'labels.association': { type: 'add', association: { type: 'label_jid', chatId: '(number-of-the-chat-here)@s.whatsapp.net', labelId: '3' } } } ``` type can be add or remove depending if you are adding or removing a label, and labelId is an id for the label selected to do this event, i'm planning on making a function to get the labels an maybe i can at that point integrate it with this so you can get the labelId and it's name too --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/wa-multi-session-mimamch#51
No description provided.