collinvandyck / gesture

an irc bot that does helpful things
MIT License
7 stars 5 forks source link

Let listeners ignore all messaegs on a set of channels. #32

Closed blinsay closed 9 years ago

blinsay commented 11 years ago

Tweak the internal listener struct so that listeners can ignore a set of channels. Changes the exposed methods on Gobot so there's now a ListenForExcluding in addition to ListenFor.

collinvandyck commented 11 years ago

This is good. I think an improvement would be if we just had a function like:

func newListener(re *regexp.Regexp, 
                 cb func(Message, []string) Response, 
                 config map[string]interface{})

that would query the config for the "excludes" optional member and build the set from there. What do you think? That would simplify the plugin callbacks quite a bit, make only one newListener method necessary, and even though the API would change a bit, it would become more easily extensible later (imagine supporting an "includeOnly" option as well in the future)

blinsay commented 9 years ago

lol hi collon

collinvandyck commented 9 years ago

THREAD NECROMANCY