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:
tofers 2023-06-25 22:25:49 +03:00 • committed by GitHub
commit 8fc6e6098c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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([]);
}
});