cinchrb / cinch

The IRC Bot Building Framework
http://www.rubydoc.info/gems/cinch
MIT License
1k stars 180 forks source link

Global nick filter #78

Closed jhass closed 8 years ago

jhass commented 12 years ago

Related to #67 I'd like to be able to specify a list of nicks and/or hostmasks that are completely ignored. This would be especially useful to filter other bots or users abusing the bot in any way.

dominikh commented 12 years ago

It's on the todo list. Technically it's not really related to #67 though the filtering will be lower down in the processing.

greenbigfrog commented 9 years ago

+1

woodruffw commented 9 years ago

+1

dominikh commented 9 years ago

Cinch has support for hooks for dropping messages. One could easily write a module and include that in every plugin class that should abide by the blacklist.

I've used a similar approach for a more complex ACL system here: https://github.com/dominikh/Mathetes/blob/cinch_rewrite/bot.rb

The lines of interest are 3-15. https://github.com/dominikh/Mathetes/blob/cinch_rewrite/lib/cinch/plugins/dictionary.rb for example demonstrates the use of it on line 9. Instead of monkeypatching, one could write a proper mixin, and the "enable_acl" call could be automated with the included callback of Ruby.

woodruffw commented 9 years ago

Thank you!

Namasteh commented 9 years ago

Thank you, that will be really useful.

dominikh commented 8 years ago

Closing this issue because it can be implemented by users via the aforementioned filter hook.