to
can be <phone Number>@c.us
, <phone Number>-<groupId>@g.us
, or <phone Number><groupId>@g.us
.To use these functions, it is necessary to initialize the bot.
Click here to learn more.
Get all Group
await client.getAllChatsGroups()
.then((result) => {
console.log(result); // message result
}).catch((error) => {
console.log(error); // message error
});
Create group
await client.createGroup('Group name', ['111111111111@c.us', '222222222222@c.us'])
.then((result) => {
console.log(result); // message result
}).catch((error) => {
console.log(error); // message error
});
Add participant
await client.addParticipant('00000000-000000@g.us', ['111111111111@c.us', '222222222222@c.us'])
.then((result) => {
console.log(result); // message result
}).catch((error) => {
console.log(error); // message error
});
Change group description
await client.setGroupDescription('00000000-000000@g.us', 'group description')
.then((result) => {
console.log(result); // message result
}).catch((error) => {
console.log(error); // message error
});
Change group image
await client.setGroupImage('00000000000000@g.us', './file.jpg')
.then((result) => {
console.log(result); // message result
}).catch((error) => {
console.log(error); // message error
});
Get all participants in the group
await client
.getGroupParticipant('00000000000-0000000000@g.us')
.then((result) => {
console.log('Participants: ', result);
})
.catch((error) => {
console.log('Error Participants: ', error);
});
Generated using TypeDoc