feat: add or remove labels (#1915)
* add or remove labels * Strings use singlequote * add event chat change labels * Revert "add event chat change labels"
This commit is contained in:
parent
8e8d0c9b3e
commit
8fc6e6098c
1 changed files with 55 additions and 0 deletions
12
example.js
12
example.js
|
|
@ -210,6 +210,18 @@ client.on('message', async msg => {
|
|||
msg.reply('I can only edit my own messages');
|
||||
}
|
||||
}
|
||||
} else if (msg.body === '!updatelabels') {
|
||||
const chat = await msg.getChat();
|
||||
await chat.changeLabels([0, 1]);
|
||||
} else if (msg.body === '!addlabels') {
|
||||
const chat = await msg.getChat();
|
||||
let labels = (await chat.getLabels()).map(l => l.id);
|
||||
labels.push('0');
|
||||
labels.push('1');
|
||||
await chat.changeLabels(labels);
|
||||
} else if (msg.body === '!removelabels') {
|
||||
const chat = await msg.getChat();
|
||||
await chat.changeLabels([]);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue