Skip to content

Commit

Permalink
Stylize python code in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
unode committed Aug 13, 2020
1 parent 70f6d81 commit 5e8cdf8
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions docs/decorators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5e8cdf8

Please sign in to comment.