From 5e8cdf8cfaf2256d27b5a56b482e721cba0f71c3 Mon Sep 17 00:00:00 2001 From: Renato Alves Date: Thu, 13 Aug 2020 02:19:28 +0200 Subject: [PATCH] Stylize python code in documentation --- docs/decorators.rst | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/docs/decorators.rst b/docs/decorators.rst index 3a4ec90d..6f294088 100644 --- a/docs/decorators.rst +++ b/docs/decorators.rst @@ -4,7 +4,9 @@ Built-in decorators =================== -Allowed users:: +Allowed users: + +.. code-block:: python from mmpy_bot.utils import allowed_users from mmpy_bot.bot import respond_to @@ -17,7 +19,9 @@ Allowed users:: -Direct messages:: +Direct messages: + +.. code-block:: python from mmpy_bot.utils import allow_only_direct_message from mmpy_bot.bot import respond_to @@ -30,7 +34,9 @@ Direct messages:: -Actions just after plugin initilization :: +Actions just after plugin initilization: + +.. code-block:: python from mmpy_bot.bot import at_start @@ -45,13 +51,17 @@ Real case --------- For example we have some users on our chat. We want allow some functionality -to some users. We can create constants with allowed users on bot settings:: +to some users. We can create constants with allowed users on bot settings: + +.. code-block:: python ADMIN_USERS = ['admin', 'root', 'root@admin.com'] SUPPORT_USERS = ['mike', 'nick', 'nick@nick-server.com'] -So now we can close access to some functions on plugins:: +So now we can close access to some functions on plugins: + +.. code-block:: python from mmpy_bot.utils import allow_only_direct_message from mmpy_bot.utils import allowed_users