🏛️ Classes
🧵 Topic
Como obter: `createTopic(canal, nome, opts?)`
Propriedades
| Nome | Tipo | Descrição |
| id | string | Topic ID |
| name | string | Topic name |
| type | number | Topic type (1 = public, 2 = private) |
| channelId | string | ID of the channel where the topic was created |
Métodos
| Assinatura | Parâmetro(s) | Descrição |
| send(texto, opts?) |
- |
Sends a message in the topic |
| addMember(usuario) |
- |
Adds a member to the topic |
| removeMember(usuario) |
- |
Removes a member from the topic |
| rename(nome) |
- |
Renames the topic |
| archive() |
- |
Archives the topic |
| unarchive() |
- |
Unarchives the topic |
| lock() |
- |
Locks the topic (only moderators can unarchive it afterwards) |
| unlock() |
- |
Unlocks the topic |
| delete() |
- |
Permanently deletes the topic |
Exemplo de uso
on command("duvida", message, args)
let topico = createTopic(message.channel, "Dúvida de " .. message.author.username, { type: 1 })
topico.send("Conta pra gente qual é sua dúvida! 🙋")
topico.addMember(message.author)
end
on command("duvida-privada", message, args)
let topico = createTopic(message.channel, "Atendimento privado", { type: 2 })
topico.addMember(message.author)
topico.send("Esse tópico é só seu, " .. message.author.username .. ".")
end
Funções ou páginas relacionadas