devlikeapro / waha

WAHA - WhatsApp HTTP API (REST API) that you can configure in a click!
https://waha.devlike.pro/
Apache License 2.0
806 stars 247 forks source link

[BUG][NOWEB] - Kick Participants #359

Closed bobykurniawan11 closed 4 weeks ago

bobykurniawan11 commented 4 weeks ago

I'm trying to kick participants. Here is what i do

[POST]
https://api_URL/api/07eda2a6-7a0f-475a-b4b6-6f3376a1f388/groups/120363214670635971@g.us/participants/remove

Here is the body

{
    "participants": [
        {
            "id": "xxx@s.whatsapp.net"
        },
        {
            "id": "xxx@s.whatsapp.net"
        }
    ]
}

I get this response

{
    "statusCode": 500,
    "timestamp": "2024-06-04T06:06:03.874Z",
    "exception": {
        "stack": "Error: bad-request\n    at assertNodeErrorFree (/app/node_modules/@adiwajshing/baileys/lib/WABinary/generic-utils.js:56:15)\n    at query (/app/node_modules/@adiwajshing/baileys/lib/Socket/socket.js:145:48)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async Object.groupParticipantsUpdate (/app/node_modules/@adiwajshing/baileys/lib/Socket/groups.js:142:28)\n    at async /app/node_modules/@nestjs/core/router/router-execution-context.js:46:28\n    at async /app/node_modules/@nestjs/core/router/router-proxy.js:9:17",
        "message": "bad-request",
        "data": 400,
        "isBoom": true,
        "isServer": true,
        "output": {},
        "name": "Error"
    },
    "request": {
        "path": "/api/07eda2a6-7a0f-475a-b4b6-6f3376a1f388/groups/120363214670635971@g.us/participants/remove",
        "method": "POST",
        "body": {
            "participants": [
                {
                    "id": "xxx@s.whatsapp.net"
                }
            ]
        },
        "query": {}
    },
    "version": {
        "version": "2024.6.1",
        "engine": "NOWEB",
        "tier": "PLUS",
        "browser": "/usr/bin/chromium"
    }
}

I did check the number if it is registered , the the results are true

patron:PLUS

bobykurniawan11 commented 4 weeks ago

Found the fix.

So the group list will return this

{
  "xxxx214670635971@g.us": {
    "id": "xxxx214670635971@g.us",
    "subject": "dummy",
    "subjectOwner": "xxx@s.whatsapp.net",
    "subjectTime": 1707296133,
    "size": 3,
    "creation": 1707296133,
    "owner": "xxx@s.whatsapp.net",
    "desc": "Hi everyone! This community is for members to chat in topic-based groups and get important announcements.",
    "descId": "63697.10434-246",
    "restrict": false,
    "announce": false,
    "isCommunity": true,
    "isCommunityAnnounce": false,
    "joinApprovalMode": false,
    "memberAddMode": false,
    "participants": [

    ]
  },
  "xxxx216786143542@g.us": {
    "id": "xxxx216786143542@g.us",
    "subject": "dummy",
    "subjectOwner": "xxx@s.whatsapp.net",
    "subjectTime": 1707296133,
    "size": 3,
    "creation": 1707296133,
    "owner": "xxx@s.whatsapp.net",
    "desc": "Hi everyone! This community is for members to chat in topic-based groups and get important announcements.",
    "descId": "63697.10434-246",
    "linkedParent": "xxxx214670635971@g.us",
    "restrict": false,
    "announce": true,
    "isCommunity": false,
    "isCommunityAnnounce": true,
    "joinApprovalMode": false,
    "memberAddMode": false,
    "participants": [

    ]
  }
}

I need to use xxxx216786143542@g.us instead of xxxx214670635971@g.us

patron:PLUS

devlikepro commented 3 weeks ago

Thank you for sharing the details about the fix! :1st_place_medal:

patron:PRO