nficano/tangerine

Is it possible to specified a channel for the bot to handle?

chiyiliao opened this issue · 2 comments

Is it possible to specified a channel for the slack-bot to handle?

Example with "#general" channel:

Method1

@tangerine.listen_for("hello")
def hello(user, message, channel):
if channel == "#general":
return "world"

Or

Method2

@tangerine.listen_for("hello", "#general")
def hello(user, message):
return "world"

I prefer combine both Method1 and Method2. Just like:

Method3

@tangerine.listen_for("hello", ["#general", "chatroom", "faq"])
def hello(user, message, channel):
if channel == "#general":
return "world"
elif channel == "#chatroom":
return "hello"
elif channel == "#faq":
return "WORLD"

If I have read the config file correctly, you can specify a channel in the config.yml file.

https://github.com/nficano/tangerine/blob/master/instance/config.yml.sample

This seems to be at the global level while these examples are on a per command basis