camper-gitter-bot
camper-gitter-bot copied to clipboard
Ability to limit commands to certain channels
As suggested by @SaintPeter. Could also lead to confusion about what features are available where, so this is a feature we may want to approach with caution, but it's worth putting up for discussion.
I'm thinking that if there are particularly spammy commands we would limit them. The command could be replaced with a message like:
Command
commandName
is not available in this channel due to the volume of its output.
Or something simple like that. We wouldn't fail silently.
Thinking about how to do this:
var disableCommands = {
'roomName' = [
"commandName1",
"commandName2",
"commandName3"
]
};
We could also use that with:
var spammyCommands = [
"commandName1",
"commandName2",
"commandName3"
];
To assign them quickly to many rooms.
Then it's just a matter of checking the object for the room name and doing an indexOf
on the array.
It took a little digging... Looks like GBot.findAnyReply
and GBot.parseInput
are good places to start. My question would be should the blacklist be a prop of GBot or BotCommandList and should the blacklist be written there or in a more accessible place?
It also looks like message.room or input.message.room depending on what function you're in hold the calling room.