Add setting channel overwrites

This commit is contained in:
Amish Shah
2016-08-22 18:47:21 +01:00
parent 00505d099a
commit 6f2caffd32
4 changed files with 87 additions and 6 deletions

View File

@@ -181,5 +181,15 @@ client.on('message', message => {
if (message.content === '?perms?') {
console.log(message.author.username, 'asked for perms in', message.channel.name, ':');
console.log(message.channel.permissionsFor(message.author).serialize());
} else if (message.content === '???test???') {
message.channel.overwritePermissions('', {
SEND_MESSAGES: false,
})
.then(() => {
message.channel.overwritePermissions('', {
SEND_MESSAGES: true,
});
})
.catch(console.log);
}
});