aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
2021-08-23Remove restriction on snowflake commandGravatar D0rs4n-4/+0
2021-08-23Fix current tests by using MockMember in mention listsGravatar wookie184-3/+5
2021-08-23Escape markdown in user's name for `!user` commandGravatar TizzySaurus-0/+2
2021-08-23Ignore bot mentions in antispam mentions ruleGravatar wookie184-1/+5
2021-08-23Update reminders command to use `UserMentionOrID` instead of ↵Gravatar TizzySaurus-4/+5
`discord.Member` to fix greediness issues. (#1768)
2021-08-23Update time format in reminder message to DAY_TIME from RELATIVE (#1766)Gravatar TizzySaurus-1/+1
* Update time format in reminder message to DAY_TIME from RELATIVE Co-authored-by: Xithrius <[email protected]>
2021-08-22Update outdated commentGravatar Izan-1/+1
2021-08-22Revert `search_user` typehint back to `MemberOrUser`Gravatar Izan-2/+2
2021-08-22Update `infraction_search_group` typehint to `UserMentionOrId`Gravatar Izan-3/+3
2021-08-22Attempt to get user from DB when discord.Object passed to search_userGravatar Izan-2/+6
2021-08-22Remove redundant getattr protectionGravatar Izan-2/+2
2021-08-22Remove redundant fetching of user codeGravatar Izan-11/+4
2021-08-22Add missing call to `escape_markdown`Gravatar Izan-2/+6
2021-08-22Re-add ability to search infractions of deleted accountGravatar Izan-6/+9
2021-08-22Remove redundant functionGravatar Izan-13/+0
2021-08-22Fix isinstance checkGravatar Izan-1/+1
2021-08-22Fix importGravatar Izan-1/+1
2021-08-22Fix import orderGravatar Izan-1/+1
2021-08-22Rename converter from FetchedMember to MemberOrUserGravatar Izan-57/+58
2021-08-22Remove unused importsGravatar TizzySaurus-4/+3
2021-08-22Update to new convertersGravatar TizzySaurus-29/+21
2021-08-22Remove converters made redundant by dpy V1.6's UserConverter updateGravatar TizzySaurus-72/+1
2021-08-22Fix edge-case of `user.joined_at` being `None` in userinfo command.Gravatar TizzySaurus-1/+5
2021-08-22Improve cache iteration speedGravatar Boris Muratov-0/+10
getitem based iteration included operations that aren't necessary when iterating over the cache continuously. Adding an iter method to the class seems to have improved iteration speed by several orders of magnitude.
2021-08-22Add ability to publish metabase questionsGravatar Chris Lovering-0/+14
2021-08-22Trigger typing, to avoid wrapping whole func in a context managerGravatar Chris Lovering-30/+30
2021-08-22Add alias for metabase exportGravatar Chris Lovering-1/+1
2021-08-22Change metabase config to base url, rather than api urlGravatar Chris Lovering-9/+7
2021-08-22Move metabase error handling to a cog error handlerGravatar Chris Lovering-26/+33
2021-08-22Error to info log level on missing reminder message.Gravatar Xithrius-1/+1
2021-08-22Modify reminder response messages to be in the correct formatGravatar D0rs4n-2/+2
2021-08-21Additional comments and tests for slicingGravatar mbaruh-2/+5
2021-08-21Clean up codeGravatar mbaruh-4/+2
Removed unused import, corrected docstring, and removed unnedded type annotation.
2021-08-21Fix MessageCache slicing bugs, improve testsGravatar mbaruh-26/+41
2021-08-21Identify DeletionContext by members, not channelsGravatar mbaruh-17/+14
Since the anti-spam now works cross-channels, it makes no sense to identify it by the channel in which it was invoked. The DeletionContext class was changed to accept a frozenset of members, and the message_deletion_queue dict uses the frozensets as keys. DeletionContext still accepts a channel on creation, because while it might get added more channels, there's only one channel in which the mute message will be sent. Using members as the key can run into the issue of one member becoming irrelevant to the filter while others still are, resulting in another log message being sent, but it's an unlikely edge case since the users should be muted almost immediately, and we're currently not using any multi-member filters in the first place.
2021-08-21AntiSpam deletes from all spammed channelsGravatar mbaruh-7/+16
The anti-spam cog was amended to handle cross-channel spam.
2021-08-21AntiSpam modified to work with cacheGravatar mbaruh-9/+406
The anti-spam cog now uses a cache instead of reading channel history. The cache is for all channels in the guild, and does not remove deleted messages. That means that the anti-spam logic now works cross-channel and counts deleted messages. The size of the cache is determined via a new field in the config YAML file. The cache was implemented as a separate class, MessageCache, which uses circular buffer logic. This allows for constant time addition and removal form either side, and lookup. The cache does not support removal from the middle of the cache. The cache additionally stores a mapping from message ID's to the index of the message in the cache, to allow constant time lookup by message ID. The commit additionally adds accompanying tests, and renames `cache.py` to `caching.py` to better distinguish it from the new `message_cache.py` and convey that it's for general caching utilities.
2021-08-19Add comma separators to member counts in !serverGravatar Chris Lovering-3/+3
2021-08-19Fix linebreak formatting on server commandGravatar Chris Lovering-7/+7
The features part of the embed isn't included in some channels, this leads to there not being a linebreak between voice regions and roles in the embed. By changing it to this, rather than dedent, we specify exact where we want the linebreaks to be.
2021-08-17Move max_interval to initGravatar Boris Muratov-8/+8
The on_message event calculated the max interval value every time for no reason. The value is constant throughout the bot's up time.
2021-08-17Provide jump_url in reminders even when the bot repliesGravatar D0rs4n-1/+1
When the message is in the same channel and the bot replies, from now on it will also provide a jump_url for the sake of consistency
2021-08-16HelpChannels: use utility method to get available channelsGravatar MarkKoz-3/+1
2021-08-16Improve output message consistency in webhook_removerGravatar D0rs4n-1/+1
Co-authored-by: Bluenix <[email protected]>
2021-08-16Patch the regEx pattern in webhook_remover to match edge casesGravatar D0rs4n-1/+4
The regEx pattern did not match the 'https://' part in case of canary urls Thus, from now on the regEx pattern matches the full canary urls as well.
2021-08-16Fix up, and improve code consistency in webhook_removerGravatar D0rs4n-2/+2
2021-08-16Remove the admins mention from the modmail tagGravatar wookie184-1/+1
2021-08-16Improve code consistency in webhook_removerGravatar D0rs4n-9/+7
2021-08-15HelpChannels: simplify formatting of category names in dormant msgGravatar MarkKoz-9/+6
Remove redundant retrieval of category objects. Include the asking guide URL in the message via an f-string.
2021-08-15HelpChannels: fix incomplete init of available channel setGravatar MarkKoz-5/+4
If the cog is reloaded while there are less than the maximum amount of available channels, it makes some channels available until the limit is reached. When a channel is made available, it updates the `available_help_channels` set. The `update_available_help_channels()` function would not update this set if it saw that the set already contains elements. This resulted in only the channels that were just made available being in the set; the set would not contain the channels that were already available when the bot started. Fix this by unconditionally populating the set, but moving it to `init_available()` so it only happens once. Fix BOT-Z1 Fix #1715
2021-08-16Enhance security in the Webhook remover.Gravatar D0rs4n-6/+14
From now on, webhooks that were posted in the chat will be also deleted from Discord in order to eliminate the risk.