Skip to content

Commit

Permalink
Changing allowed channels functionality to ignore direct messages
Browse files Browse the repository at this point in the history
As per the request direct messages shoul dnot be checked against the allowed_channels.
  • Loading branch information
attzonko committed Feb 3, 2019
1 parent 8433803 commit 9b93646
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mmpy_bot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def wrapper(message, *args, **kw):
# Check display_name first
disp_name = message.get_channel_display_name()
url_name = message.get_channel_name()
if not {disp_name, url_name} & set(allowed_channels_list):
is_direct_message = message.is_direct_message()
if (not is_direct_message) and (not {disp_name, url_name} & set(allowed_channels_list)):
return message.reply(
"`This plugin only allowed in these channels:{}`"
.format(list(allowed_channels_list)))
Expand Down

0 comments on commit 9b93646

Please sign in to comment.