Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve coverage of flood_max_wait setting #2323

Merged
merged 1 commit into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/source/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,9 @@ sending any new message (0.5s + 0.428s).
You can **deactivate** this extra wait penalty by setting
:attr:`~CoreSection.flood_penalty_ratio` to 0.

To **deactivate all flood prevention (at your own risk)**, you need only to
set :attr:`~CoreSection.flood_max_wait` to 0.

The default configuration works fine with most tested networks, but individual
bots' owners are invited to tweak as necessary to respect their network's flood
policy.
Expand All @@ -341,9 +344,6 @@ policy.
Even more additional configuration options: ``flood_max_wait``,
``flood_text_length``, and ``flood_penalty_ratio``.

It is now possible to deactivate the extra penalty for longer messages by
setting ``flood_penalty_ratio`` to 0.

.. note::

``@dgw`` said once about Sopel's flood protection logic:
Expand Down
6 changes: 5 additions & 1 deletion sopel/config/core_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,14 @@ class CoreSection(StaticSection):
"""

flood_max_wait = ValidatedAttribute('flood_max_wait', float, default=2)
"""How much time to wait at most when flood protection kicks in.
"""How many seconds to wait at most when flood protection kicks in.

:default: ``2``

.. note::

If the maximum wait is 0, flood protection is effectively disabled.

This is equivalent to the default value:

.. code-block:: ini
Expand Down