Skip to content

Commit

Permalink
Merge pull request #2323 from sopel-irc/flood-docs
Browse files Browse the repository at this point in the history
docs: improve coverage of `flood_max_wait` setting
  • Loading branch information
dgw authored Jul 22, 2022
2 parents 68f12cc + abcbd36 commit 71380df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
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

0 comments on commit 71380df

Please sign in to comment.