Skip to content
This repository has been archived by the owner on Oct 20, 2018. It is now read-only.

Ability to limit commands to certain channels #54

Open
ltegman opened this issue Feb 10, 2016 · 2 comments
Open

Ability to limit commands to certain channels #54

ltegman opened this issue Feb 10, 2016 · 2 comments

Comments

@ltegman
Copy link
Member

ltegman commented Feb 10, 2016

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.

@SaintPeter
Copy link
Member

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.

@t3h2mas
Copy link
Contributor

t3h2mas commented Feb 11, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants