Skip to content

Commit 3431365

Browse files
Exireldgw
andauthored
Apply suggestions from code review
Co-authored-by: dgw <[email protected]>
1 parent 7371b73 commit 3431365

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

docs/source/configuration.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,8 @@ Loop prevention
355355

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

362361
<bot> I repeat myself!
363362
<bot> I repeat myself!
@@ -394,10 +393,11 @@ For example this configuration::
394393
antiloop_window = 60
395394
antiloop_repeat_text = Ditto.
396395

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

402402
<bot> I repeat myself!
403403
<bot> No I don't!

sopel/config/core_section.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class CoreSection(StaticSection):
135135

136136
antiloop_repeat_text = ValidatedAttribute(
137137
'antiloop_repeat_text', default='...')
138-
"""The replacement text when detecting a repeating message.
138+
"""The replacement text sent when detecting a repeated message.
139139
140140
:default: ``...``
141141
@@ -201,7 +201,7 @@ class CoreSection(StaticSection):
201201
"""
202202

203203
antiloop_window = ValidatedAttribute('antiloop_window', int, default=120)
204-
"""The time window (in seconds) used to activate anti-looping.
204+
"""The time period (in seconds) checked when detecting repeated messages.
205205
206206
:default: ``120``
207207

0 commit comments

Comments
 (0)