From f14e6625b1fdcee57fa0c6d3daa8017bd2c27357 Mon Sep 17 00:00:00 2001 From: Alex Tzonkov Date: Mon, 21 Jan 2019 23:31:27 -0800 Subject: [PATCH] Update README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 489ea948..7029e447 100644 --- a/README.md +++ b/README.md @@ -201,15 +201,18 @@ def stats(message, start_date=None, end_date=None): pass ``` -If you don't want to expose some bot commands to public, you can add `@allowed_users()` like so: +If you don't want to expose some bot commands to public, you can add `@allowed_users()` or `@allowed_channels()` like so: ```python @respond_to('^admin$') @allow_only_direct_message() #only trigger by direct message, remove this line if you want call this in channel -@allowed_users('Your username or email address here') +@allowed_users('Your username or email address here','user@email.com') # List of usernames or e-mails allowed +@allowed_channels('allowed_channel_1','allowed_channel_2') # List of allowed channels def users_access(message): pass ``` +Keep in mind the order matters! `@respond_to()` and `@listen_to()`must come before the "allowed" decorators. + And add the plugins module to `PLUGINS` list of mmpy_bot settings, e.g. mmpy_bot_settings.py: