neoxr / neoxr-bot

Baileys WhatsApp Bot
https://api.neoxr.my.id
184 stars 335 forks source link

add button for group #40

Closed HackyN00b closed 1 year ago

HackyN00b commented 1 year ago

can you create add member in group button ?

like /add number, or tagged msg n add, i can kick number from grp with kick but unable to add it with command

ghost commented 1 year ago

add this in action.js

if (command == 'add') return client.groupParticipantsUpdate(m.chat, [number], 'add')

HackyN00b commented 1 year ago

i did it but getting 🚩 @${mention} already logged out or does not exist in this group. these reply

tried both ways, tagging old msg n manually .add number with country code

ghost commented 1 year ago

let mention = number.replace(/@.+/g, '') let users = m.isGroup ? participants.find(u => u.id == number) : {} if (number == client.decodeJid(client.user.id))return client.reply(m.chat, Func.texted('bold', ??), m) if (command == 'add') return client.groupParticipantsUpdate(m.chat, [number], 'add') if (!users) return client.reply(m.chat, Func.texted('bold', 🚩 @${mention} already logged out or does not exist in this group.), m)

HackyN00b commented 1 year ago

number got banned sed, i'll close ticket as soon as confirm that its working

HackyN00b commented 1 year ago

hey number got unbanned then i again started n tried to run .add command n its again banned n got output in heroku

at assertNodeErrorFree (/app/node_modules/@adiwajshing/baileys/lib/WABinary/generic-utils.js:56:15)

2023-04-13T17:55:12.205763+00:00 app[worker.1]: at query (/app/node_modules/@adiwajshing/baileys/lib/Socket/socket.js:139:48) 2023-04-13T17:55:12.205765+00:00 app[worker.1]: at processTicksAndRejections (internal/process/task_queues.js:95:5) 2023-04-13T17:55:12.205765+00:00 app[worker.1]: at async Object.groupParticipantsUpdate (/app/node_modules/@adiwajshing/baileys/lib/Socket/groups.js:66:28) 2023-04-13T17:55:12.205806+00:00 app[worker.1]: (node:15) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) 2023-04-13T17:55:12.205840+00:00 app[worker.1]: (node:15) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

ghost commented 1 year ago

add "`"

ghost commented 1 year ago

tambahkan "`"

let mention = number.replace(/@.+/g, '') let users = m.isGroup ? participants.find(u => u.id == number) : {} if (number == client.decodeJid(client.user.id))return client.reply(m.chat, Func.texted('bold', `\??`), m) if (command == 'add') return client.groupParticipantsUpdate(m.chat, [number], 'add') if (!users) return client.reply(m.chat, Func.texted('bold', `🚩 @${mention} already logged out or does not exist in this group.`), m)

HackyN00b commented 1 year ago

image

is these correct ? coz these was the code where whatsapp getting banned

ghost commented 1 year ago

move if !users under if add

yes, this is quite prone to getting banned the same thing with the .delete command

HackyN00b commented 1 year ago

ohkay let me try once it gets unbanned again,

HackyN00b commented 1 year ago

i did it as you say, still got banned again image