Thursday 20 April 2017

Discord chat bot change channel post permissions

I'm currently writing a discord bot for a role-play bar. I want it to close down the bar (i.e. restrict post permissions to just me) when I tell it to.

Here's the code:

const Discord = require("discord.js");
const bot = new Discord.Client();

bot.on("message", (message) => {

    switch (message.content) {
        case "Close down the bar for me":
            if (message.author.discriminator == ) { // this isn't a typo i just haven't put it in for posting
                message.postMessage("*Ushers people out, closes the cabinets, changes sign to closed, checks for stragglers, locks the doors, shuts the metal barriers, gets on motorbike and rides home*");

        }
}

});

bot.login(''); // the token is meant to be here, I'm just not putting it on the internet!

what should I put after the message.postMessage to change the default chat permissions to no posting?



via tomtomy8

No comments:

Post a Comment