aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
2020-09-20Fix relay race condition in duckpond using a lockGravatar Sebastiaan Zeeff-7/+17
Our duckpond suffered from a race condition: If multiple raw reaction events were received in quick succession and a message had enough ducks to take it over the duckpond threshold, the message would be relayed multiple times. The reason this happened is because the green checkmark emoji that stops a message from being relayed multiple times is only added after the message has been relayed. This means that multiple event triggers can make it past the green checkmark check before any of them has a chance to add a green checkmark. The solution was to create a relay lock that needs to be acquired before checking for the presence of a green checkmark and is only released after adding a green checkmark. This prevents multiple events from making it past the sentinel check. As our Cogs are potentially initialized before the event loop is created, the lock is load lazily when needed. Signed-off-by: Sebastiaan Zeeff <[email protected]>
2020-09-20Add channel blacklist for duckpondGravatar Sebastiaan Zeeff-4/+38
As announcements already get a lot of exposure and have a high risk of getting "ducked", duckpond will now ignore those channels and never relay those announcements to our duckpond. Signed-off-by: Sebastiaan Zeeff <[email protected]>
2020-09-20Ignore non-staff messages for our duckpondGravatar Sebastiaan Zeeff-1/+5
Some of our members have expressed concern that their messages would be "ducked" by staff members and relayed to the staff-only duckpond. Since duckpond is supposed to be a funny, staff-only affair, I've made duckpond ignore messages from non-staff members. Signed-off-by: Sebastiaan Zeeff <[email protected]>
2020-09-20Determine eligible duckpond emojis dynamicallyGravatar Sebastiaan Zeeff-70/+27
Instead of maintaining a list of duckpond IDs manually, it's a much better idea to detect ducky emojis dynamically using the new emoji name grouping we've introduced: All emojis that start with `ducky_` will now be counted as a duckpond ducky. The unicode duck emoji obviously still counts in addition to custom emojis with the `ducky_` prefix. Signed-off-by: Sebastiaan Zeeff <[email protected]>
2020-09-16remove random space in `upvotes` valueGravatar Senjan21-1/+1
2020-09-16update the reddit emojis to actual emojis'Gravatar Senjan21-3/+3
2020-09-16Updating names of reddit emotes.Gravatar Senjan21-3/+4
2020-09-11Verification: update & improve docstringsGravatar kwzrd-12/+11
After moving constants to config, the docstring references were not updated accordingly, and remained uppercase. This commit also removed the redundant list indentation.
2020-09-10Verification: move constants to configGravatar kwzrd-25/+43
2020-09-05Disable everyone_ping filter in AntiSpam cogGravatar Sebastiaan Zeeff-4/+8
As there are a few bugs in the implementation, I've temporarily disabled the at-everyone ping filter in the AntiSpam cog. We can disable it after we've fixed the bugs. Signed-off-by: Sebastiaan Zeeff <[email protected]>
2020-09-04Move bolding markdown outside of text link.Gravatar Numerlor-2/+2
On some devices the markdown gets rendered improperly, leaving the asterisks in the message without bolding.
2020-09-04Disable burst_shared filter of the AntiSpam cogGravatar Sebastiaan Zeeff-4/+9
Our AntiSpam cog suffers from a race condition that causes it to try and infract the same user multiple times. As that happens frequently with the burst_shared filter, it means that our bot joins in and starts spamming the channel with error messages. Another issue is that burst_shared may cause our bot to send a lot of DMs to a lot of different members. This caused our bot to get a DM ban from Discord after a recent `everyone` ping incident. I've decided to disable the `burst_shared` filter by commenting out the relevant lines but leave the code in place otherwise. This means we still have the implementation handy in case we want to re-enable it on short notice. Signed-off-by: Sebastiaan Zeeff <[email protected]>
2020-09-01Fixed old tests and added 2 new onesGravatar wookie184-0/+22
2020-09-01Added checks to ignore webhook and bot messagesGravatar wookie184-0/+4
2020-08-31Removed loading of the Wolfram cog.Gravatar Xithrius-1/+0
2020-08-31Removed ImagePaginator testing.Gravatar Xithrius-15/+0
2020-08-31Removed image pagination utility.Gravatar Xithrius-164/+0
2020-08-31Everyone Ping: Fixed regex to catch *all* pingsGravatar MrAwesomeRocks-2/+2
2020-08-31Everyone Ping: Regex FixGravatar MrAwesomeRocks-2/+2
Changed the regex to not punish users who have text other than `@everyone` in their codeblocks. Multiline codeblocks can now have `@everyone` in them.
2020-08-30Everyone Ping: PR Review 2Gravatar MrAwesomeRocks-8/+13
Removed redundant comments. Switched to regex to avoid punishing users for putting `@everyone` in codeblocks. Changed log message since this isn't a anti-spam rule based off of frequency. Added check for `<@&{guild_id}>` ping, also checks for codeblocks.
2020-08-30Allow moderators to use defconGravatar Dennis Pham-6/+6
2020-08-30Everyone Ping: NEGATIVE_REPLIES in titleGravatar MrAwesomeRocks-8/+2
The NEGATIVE_REPLIES header is now the title of the embed.
2020-08-30Everyone Ping: PR ReviewGravatar MrAwesomeRocks-8/+13
Changed cryptic variable name. Changed ping response to use `bot.constants.NEGATIVE_REPLIES`. Changed ping repsonse to only ping user once.
2020-08-30Everyone ping: added formatting to member countGravatar MrAwesomeRocks-1/+1
Seperated the member count by commas every three digits.
2020-08-30Everyone ping: Changed message, cleaned fileGravatar MrAwesomeRocks-7/+1
Changed the message to say the raw member count, not just thousands. Also cleaned up some unused variables and imports in the file.
2020-08-29Everyone Ping: Fixed linting errorGravatar MrAwesomeRocks-1/+1
Switched from string.format to f-string for server member count.
2020-08-29Everyone Ping: Changed embed text and locationGravatar MrAwesomeRocks-15/+5
The you can view the embed text in the `everyone_ping.py` file. The embed also now sends in the server instead of a DM.
2020-08-29Everyone Ping: Removed debug `print`, spellingGravatar MrAwesomeRocks-2/+2
Removed a debug `print` statement, fixed a spelling mistake. Also added a comment for the DM string.
2020-08-29Everyone ping: Send embed on ping, fixed checkGravatar MrAwesomeRocks-3/+29
When a user pings the everyone role, they now get an embed explaining why what they did was wrong. The ping detection was also fixed to not thing that every message was a ping (changed form `>=` to `>`).
2020-08-29Everyone Ping: Fixed rule, edited configGravatar MrAwesomeRocks-12/+8
Changed the method of checking for an everyone ping. Also changed the config to act as `min pings` instead of `ping enabled/disabled`.
2020-08-29Everyone Ping: Added required values to configGravatar MrAwesomeRocks-2/+3
The `max` and `interval` values were required, so they were added to the config file and the rule was modified to accept these new values.
2020-08-29Everyone Ping: Added rule to recognized rulesGravatar MrAwesomeRocks-1/+3
Added mapping to anti-spam cog, then also edited __init__ in the rules folder to expose the apply function.