aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
2020-08-29Verification: add helper for stopping tasksGravatar kwzrd-5/+17
2020-08-27Verification: improve allowed mentions handlingGravatar kwzrd-7/+10
I really didn't like the constants, but the construction of allowed mentions instances is syntactically noisy, so I prefer to keep it out of the important logic. Abstracting it behind a function seems to be the best approach yet.
2020-08-27Verification: document StopExecution handlingGravatar kwzrd-0/+3
2020-08-26Verification: stop kicking members on suspicious 403Gravatar kwzrd-1/+16
A Discord error code 50_0007 signifies that the DM dispatch failed because the target user does not accept DMs from the bot. Such errors are ignored as before. Any other 403s will however cause the bot to stop making requests. This is in case the bot gets caught by an anti-spam filter and should immediately stop.
2020-08-26Verification: add helper for alerting adminsGravatar kwzrd-0/+18
2020-08-26Verification: retain ping in edited confirmation msgGravatar kwzrd-7/+8
Prevent a ghost ping from occurring upon reaction. Co-authored-by: Senjan21 <[email protected]>
2020-08-26Verification: remove explicit everyones from allowed mentionsGravatar kwzrd-6/+2
If the kwarg isn't passed, it uses the value that was given to the bot on init (False), despite the kwarg defaulting to True. Thanks to Mark and Senjan for helping me understand this. Co-authored-by: MarkKoz <[email protected]> Co-authored-by: Senjan21 <[email protected]>
2020-08-26Verification: separate guild invite by empty lineGravatar kwzrd-0/+1
Co-authored-by: Joe Banks <[email protected]>
2020-08-26Verification: send guild invite with kick messageGravatar kwzrd-1/+2
Makes it easy for users to re-join. Co-authored-by: Joe Banks <[email protected]>
2020-08-26Verification: add guild invite to configGravatar kwzrd-0/+2
2020-08-19Verification: add missing word to task status messageGravatar kwzrd-2/+2
2020-08-14Verification: pause request execution after each batchGravatar kwzrd-4/+23
The Limit values are mostly assumptions, as this feature is very difficult to test at scale. Please see docstring amendmends for further information.
2020-08-13Verification: adjust coroutines to use generic dispatchGravatar kwzrd-32/+11
2020-08-13Verification: add `_send_requests` helperGravatar kwzrd-0/+30
Generic request dispatch method to avoid code duplication with error handling & bad status logging.
2020-08-08Verification: improve confirmation message handlingGravatar kwzrd-4/+10
Suppress errors coming from Discord when changing the confirmation message in case it gets deleted, or something else goes wrong. This commit also adds either the ok hand or the warning emoji to the edited message content, as with the guild syncer confirmation. Co-authored-by: MarkKoz <[email protected]>
2020-08-08Verification: strip reminder message once and for allGravatar kwzrd-2/+2
Co-authored-by: MarkKoz <[email protected]>
2020-08-08Verification: widen set type annotationGravatar kwzrd-2/+2
Co-authored-by: MarkKoz <[email protected]>
2020-08-08Verification: only take reactions from core devsGravatar kwzrd-1/+3
Co-authored-by: MarkKoz <[email protected]>
2020-08-08Verification: improve `is_verified` checkGravatar kwzrd-1/+1
This just reads better. Co-authored-by: MarkKoz <[email protected]>
2020-08-07Verification: address member update race conditionGravatar kwzrd-8/+21
In an edge case, the `_kick_members` and `_give_role` could act on a member who has verified *after* being marked by `_check_members` as unverified. To address this, we perform one additional check just before sending the request. Testing seems to indicate that the `discord.Member` instance get updates as appropriate, so this should at least reduce the chances of such a race happening to very close to nil.
2020-08-07Verification: rename cache & document new useGravatar kwzrd-9/+15
2020-08-07Verification: persist task settings in RedisGravatar kwzrd-3/+19
If tasks are stopped manually, they will not automatically restart on cog reload or bot restart. Using `maybe_start_tasks` is necessary because we cannot interface with Redis from a sync context. We're using 1 and 0 because RedisCache does not currently permit bool values due to a typestring conversion bug.
2020-08-06Verification: add command interface for task managementGravatar kwzrd-2/+60
Allow checking whether tasks are running, starting them, and stopping them. Currently, the tasks cannot be started or stopped separately. It is not believed that we would need such a level of granularity. Calling `cancel` on a task that isn't running is a no-op.
2020-08-06Deps: update discord.py to 1.4.0Gravatar MarkKoz-79/+51
It was released on PyPI. No longer need to clone via git.
2020-08-06Verification: extend cog docstringGravatar kwzrd-1/+17
2020-08-06Verification: make on-join message more accurateGravatar kwzrd-2/+4
It now explains that new users can only see a limited amount of public channels, and that there will be more once they verify. Co-authored-by: Sebastiaan Zeeff <[email protected]>
2020-08-06Verification: bump confirmation threshold to 1%Gravatar kwzrd-1/+1
2020-08-06Verification: send DM to kicked membersGravatar kwzrd-0/+8
2020-08-06Verification: enable role pingsGravatar kwzrd-2/+10
2020-08-06Verification: disable burst shared filter in verificationGravatar kwzrd-1/+10
We will begin pinging users in the verification channel, prompting them to join. This can cause a surge of activity that may trigger the filter. A better solution would involve allowing per-filter channel config, but after internal discussion this is seen as unnecessary for now.
2020-08-06Verification: add stats collectionGravatar kwzrd-0/+28
2020-08-06Verification: remove unverified role on acceptGravatar kwzrd-0/+5
2020-08-05Guild invite regex: Add support for dashes in the invite codeGravatar Dennis Pham-1/+1
2020-08-05Revert "HelpChannels: use more reliable check for claimed channel"Gravatar kwzrd-1/+1
This reverts commit 59c62162
2020-08-05Redis: remove erroneous `_redis` aliasGravatar kwzrd-9/+8
If a RedisCache instance was being accessed before bot has created the `redis_cache` instance, the `_redis` alias was being set to None, causing AttributeErrors in lookups. See: #1090
2020-08-05Verification: schedule ping taskGravatar kwzrd-3/+5
2020-08-05Verification: implement unverified role ping taskGravatar kwzrd-0/+52
We're making good use of d.py's tasks framework. RedisCache is used to persist the reminder message ids, which can conveniently be converted into timestamps. It is therefore trivial to determine the time to sleep before the first ping. After that, the bot simply pings every n hours.
2020-08-04HelpChannels: use more reliable check for claimed channelGravatar MarkKoz-1/+1
Using the channel's category isn't reliable since it may take Discord a while to actually move the channel once it's received a request from the bot. I suppose using redis technically has the same problem, but it should be much faster and less susceptible to lag than Discord. Fixes #1074
2020-08-04Source: remove redundant check for help commandsGravatar MarkKoz-4/+1
The code is identical to the else block and there's no reason for help commands to have an explicit check.
2020-08-04Source: raise BadArgument for dynamically-created objectsGravatar MarkKoz-3/+14
Commands, cogs, etc. created via internal eval won't have a source file associated with them, making source retrieval impossible. Fixes #1083 Fixes BOT-7K
2020-08-04Cancel scheduled tasks when cogs unloadGravatar MarkKoz-1/+14
When cogs reload, they used new Scheduler instances, which aren't aware of previously scheduled tasks. This led to duplicate scheduled tasks when cogs re-scheduled tasks upon initialisation. Fixes #1080 Fixes BOT-7H
2020-08-04Verification: ignore verification reminder message eventGravatar kwzrd-0/+3
2020-08-04Verification: add reminder cacheGravatar kwzrd-0/+5
2020-08-04Verification: comment message usesGravatar kwzrd-0/+3
2020-08-04Verification: add reminder ping message & frequencyGravatar kwzrd-0/+11
2020-08-04Verification: move time constants above messagesGravatar kwzrd-10/+10
Allows referencing the constants within the message bodies.
2020-08-04Verification: make authorization message ping core devsGravatar kwzrd-2/+3
2020-08-04Verification: schedule member update taskGravatar kwzrd-1/+12
Turns out that it's necessary to cancel the task manually. Otherwise, duplicate tasks can be running concurrently should the extension be reloaded.
2020-08-04Verification: add region comments & move property to topGravatar kwzrd-4/+17
Cog is getting large so let's allow collapsing related bits.
2020-08-04Verification: create task to update unverified membersGravatar kwzrd-0/+37