Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: dgw <dgw@technobabbl.es>
  • Loading branch information
Exirel and dgw authored Aug 5, 2022
1 parent 7371b73 commit 3431365
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions docs/source/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,8 @@ Loop prevention

In order to prevent the bot from entering a loop (for example when there is
another bot in the same channel, or if a user spams a command), it'll try to
see if the next message to send is repeating too often in the last ten messages
in the last few minutes. If that happens, the bot will send ``...`` a few times
before remaining silent::
see if the next message to send is repeating too often in a short time period.
If that happens, the bot will send ``...`` a few times before remaining silent::

<bot> I repeat myself!
<bot> I repeat myself!
Expand Down Expand Up @@ -394,10 +393,11 @@ For example this configuration::
antiloop_window = 60
antiloop_repeat_text = Ditto.

will activate the loop prevention feature if there is at least one message in
the last 60s, from the last 10 messages, 2 are already the same. In that case
the bot will send ``...``, but only *once*. After that, the bot will remain
silent. This doesn't affect other messages, i.e. messages that don't repeat::
will activate the loop prevention feature if there are at least 2 messages
in the last 60 seconds, **and** exactly 2 of those messages are the same.
After sending ``...`` *once* (a third message), the bot will remain silent.

This doesn't affect other messages, i.e. messages that don't repeat::

<bot> I repeat myself!
<bot> No I don't!
Expand Down
4 changes: 2 additions & 2 deletions sopel/config/core_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class CoreSection(StaticSection):

antiloop_repeat_text = ValidatedAttribute(
'antiloop_repeat_text', default='...')
"""The replacement text when detecting a repeating message.
"""The replacement text sent when detecting a repeated message.
:default: ``...``
Expand Down Expand Up @@ -201,7 +201,7 @@ class CoreSection(StaticSection):
"""

antiloop_window = ValidatedAttribute('antiloop_window', int, default=120)
"""The time window (in seconds) used to activate anti-looping.
"""The time period (in seconds) checked when detecting repeated messages.
:default: ``120``
Expand Down

0 comments on commit 3431365

Please sign in to comment.