Group Roles
We created the easiest way to create groups with Superchats
Create group
Create a group with participants
//name of group, array with number of contacts
let response = await client.createGroup("Name Group", ["556181590153", "5561981819855"])
Successful return
{
session: 'Marketing',
device: "551152204957",
status: 200,
type: 'create-group',
groupId: "15815954040-1631239154"
}
Erro return
{
session: 'Marketing',
device: "551152204957",
status: 404,
type: 'create-group',
message: 'message of erro'
}
Create Community
Create one community
//name of community
let response = await client.createCommunity("Name Community")
Retorno de sucesso
{
session: 'Marketing',
device: "551152204957",
status: 200,
type: 'create-community',
groupId: "158159540401631239154"
}
Retorno de erro
{
session: 'Marketing',
device: "551152204957",
status: 404,
type: 'create-community',
message: 'message of erro'
}
Add participants
Add participants to the group
//id of group, array with number of contacts
let response = await client.addParticipantsGroup("15815954040-1631239154", ["556181590153", "5561981819855"])
Successful return
{
session: 'Marketing',
device: "551152204957",
status: 200,
type: 'add-participants-group',
}
Erro return
{
session: 'Marketing',
device: "551152204957",
status: 404,
type: 'add-participants-group',
message: 'message of erro'
}
Add Admins
Add or remove admin
//id of group, array with number of contacts
let response = await client.addGroupAdmins("15815954040-1631239154", ["556181590153", "5561981819855"])
//id of group, array with number of contacts
let response = await client.removeGroupAdmins("15815954040-1631239154", ["556181590153", "5561981819855"])
Successful return
{
session: 'Marketing',
device: "551152204957",
status: 200,
type: 'add-group-admins',
}
Erro return
{
session: 'Marketing',
device: "551152204957",
status: 404,
type: 'add-group-admins',
message: 'message of erro'
}
Alterar Nome do Grupo
Modify the group name
//id of group, name group
let response = await client.groupTitle("15815954040-1631239154", "new name of group")
Successful return
{
session: 'Marketing',
device: "551152204957",
status: 200,
type: 'group-title',
}
Erro return
{
session: 'Marketing',
device: "551152204957",
status: 404,
type: 'group-title',
message: 'message of erro'
}
Alterar Descrição do Grupo
Modifica descrição do Grupo
//id of group, name group
let response = await client.groupDescription("15815954040-1631239154", "description of group")
Successful return
{
session: 'Marketing',
device: "551152204957",
status: 200,
type: 'group-description',
}
Erro return
{
session: 'Marketing',
device: "551152204957",
status: 404,
type: 'group-description',
message: 'message of erro'
}
Entrar em Grupo
Entra em um grupo especifico
//id of group
let response = await client.joinGroup("15815954040-1631239154")
Successful return
{
session: 'Marketing',
device: "551152204957",
status: 200,
type: 'join-group',
}
Erro return
{
session: 'Marketing',
device: "551152204957",
status: 404,
type: 'join-group',
message: 'message of erro'
}
Sair de Grupo
Sai de um grupo especifico
//id of group
let response = await client.leaveGroup("15815954040-1631239154")
Successful return
{
session: 'Marketing',
device: "551152204957",
status: 200,
type: 'leave-group',
}
Erro return
{
session: 'Marketing',
device: "551152204957",
status: 404,
type: 'leave-group',
message: 'message of erro'
}
Atualiza o Link do Grupo
Atualiza o link de um grupo especifico
//id of group
let response = await client.revokeGroupLink("15815954040-1631239154")
Successful return
{
session: 'Marketing',
device: "551152204957",
status: 200,
type: 'revoke-group-link',
linkGroup: 'G3M81fQbuwDB2cuAdPIv0h'
}
Erro return
{
session: 'Marketing',
device: "551152204957",
status: 404,
type: 'revoke-group-link',
message: 'message of erro'
}
Group Information
Returns information from a specific group
//id of group
let response = await client.infoGroup("15815954040-1631239154")
Successful return
{
session: 'Marketing',
device: "551152204957",
type: 'info-group',
status: 200,
id: '15795662985-1631581942',
owner: '15795662985@c.us',
title: 'Teste Grupo Live',
create: 1631581942,
participants: [
{
id: '556181590153',
name: 'Joe Dutra',
short: 'Joe',
isAdmin: false,
isSuperAdmin: false
},
{
id: '5521991977392',
name: 'Israel - Fabrica de Sonhos',
short: 'Israel - Fabrica',
isAdmin: false,
isSuperAdmin: false
}
]
}
Erro return
{
session: 'Marketing',
device: "551152204957",
status: 404,
type: 'info-group',
message: 'message of erro'
}
Modify Settings
Modify settings for a specific group
Set group messaging to admins only
//id of group, type, boolean
let response = await client.setGroupSettings("15815954040-1631239154", "message", true)
Set group change settings for admins only
//id of group, type, boolean
let response = await client.setGroupSettings("15815954040-1631239154", "settings", true)
Successful return
{
session: 'Marketing',
device: "551152204957",
status: 200,
type: 'set-group-settings',
}
Erro return
{
session: 'Marketing',
device: "551152204957",
status: 404,
type: 'set-group-settings',
message: 'message of erro'
}
Get Groups List
Get all groups list
let response = await client.getGroups()
Successful return
{
session: 'Marketing',
device: "551152204957",
status: 200,
type: 'get-groups',
chats: [
{ id: '5511982743910-1596072761', name: 'Venom Support' },
{ id: '556181590153-1625838636', name: 'Venom Business' }
]
}
Erro return
{
session: 'Marketing',
device: "551152204957",
status: 404,
type: 'get-groups',
message: 'message of erro'
}