Closed q0u04bj3 closed 6 years ago
I have not started using this bot yet so there might be a better and/or cleaner way but I think you can check the channel name in the callback like this:
message.channel._body['name']
I use a decorator like this:
def in_allowed_channel(func):
def allowed_channel(message, *args, **kwargs):
if message.body['channel'] not in ALLOWED_CHANNELS:
message.reply('Please ask that in <#C12345|#botchannel>'
return
return func(message, *args, **kwargs)
# Copy the docstring to the decorated func so help works
allowed_channel.__doc__ = func.__doc__
return allowed_channel```
I know how to use "listen_to" when anyone mentions certain words in a comment. Is it possible to limit this to certain channels?