From abcbd36e7ed619665d7ea2720ee9cb5750cd3bb0 Mon Sep 17 00:00:00 2001 From: dgw Date: Fri, 15 Jul 2022 07:35:13 -0500 Subject: [PATCH] docs: improve coverage of `flood_max_wait` setting --- docs/source/configuration.rst | 6 +++--- sopel/config/core_section.py | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index 17a4eeb44e..dcecd4101e 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -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. @@ -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: diff --git a/sopel/config/core_section.py b/sopel/config/core_section.py index 998b8a65a7..63e0710fac 100644 --- a/sopel/config/core_section.py +++ b/sopel/config/core_section.py @@ -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