Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to tag a contact? #297

Open
AleixoLucas42 opened this issue Nov 18, 2024 · 1 comment
Open

How to tag a contact? #297

AleixoLucas42 opened this issue Nov 18, 2024 · 1 comment

Comments

@AleixoLucas42
Copy link

Hello, your project is awesome!! I just want to know how to tag a contact like @github while sending message via /message/reply/{sessionId}

I'm have this python function as example of how I'm implementing:

def send_wpp_msg(msg):
    logging.info("Sending whatsapp message")
    url = f"{os.environ['WHATSAPP_URL']}/message/reply/{os.environ['WHATSAPP_SESSION']}"

    payload = json.dumps(
        {
            "chatId": f"{os.environ['WHATSAPP_CHAT_ID']}",
            "messageId": f"{last_prompt_message_id}",
            "contentType": "string",
            "content": f"{msg}",
        }
    )
    headers = {"accept": "*/*", "Content-Type": "application/json"}

    response = requests.request(
        "POST", url, headers=headers, data=payload, verify=False
    )

    if response.status_code != 200:
        logging.error(response.text)

    logging.debug(response.text)

@avoylenko
Copy link
Collaborator

You are interested in mentions property while sending the reply message:
https://docs.wwebjs.dev/global.html#MessageSendOptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants