feat: Pin and unpin Chats (#166)

* Added Pinning
- chat.pin() to pin
- chat.unpin() to unpin

Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
This commit is contained in:
Aliyss Snow 2020-10-11 21:50:12 +02:00 • committed by GitHub
commit aedf41b762
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 74 additions and 2 deletions

View file

@ -166,9 +166,12 @@ client.on('message', async msg => {
} else {
msg.reply('I can only delete my own messages');
}
} else if (msg.body === '!pin') {
const chat = await msg.getChat();
await chat.pin();
} else if (msg.body === '!archive') {
const chat = await msg.getChat();
chat.archive();
await chat.archive();
} else if (msg.body === '!mute') {
const chat = await msg.getChat();
// mute the chat for 20 seconds