#/@everyone on chatbot

4 messages · Page 1 of 1 (latest)

white wedge
#
client.on('message_create', message => {
    console.log(message.body);
    if (message.body === '!ping') {
        // send back "pong" to the chat the message was sent in
        client.sendMessage(message.from, 'pong:ping_pong:!!');
    }
    if (message.body === '!info') {
        client.sendMessage(message.from, '*------------------------------------------------*\n*RaposoTech Whatsapp - Respostas e Interações Automáticas*\n_RaposoTech Whatsapp - Auto Interactions and Responses_\n*v*(*0.0.1b*)\nDesenvolvido por *Vitor Morais*\nDeveloped by *Vitor Morais*\n*------------------------------------------------*');
    }
    if (message.body === '@everyone'){
        const chat = message.getChat();
        var mention = [];
        var text = '';
        for (var participant of chat.participants) {
            mention.push(`${participant.id.user}@c.us`);
            text += `@${participant.id.user} `;
            client.sendMessage(message.from, text);
        }
    }
});```
Someone know a way to easily mention all group members ( if possible, without multiple mentions, just one )
#

i hope i don't marked everybody on this post

woven blaze
#

Send group.participants in mention. You need to pass inside third sendMessage parameter "options"

Sendmessage(msg.from,text,{mentions:mention})

#

You don't even need to add the @number text if you want, it's optional.