camper-gitter-bot icon indicating copy to clipboard operation
camper-gitter-bot copied to clipboard

Ability to limit commands to certain channels

Open ltegman opened this issue 9 years ago • 2 comments

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.

ltegman avatar Feb 10 '16 23:02 ltegman

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.

SaintPeter avatar Feb 11 '16 01:02 SaintPeter

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.

t3h2mas avatar Feb 11 '16 07:02 t3h2mas