aboutsummaryrefslogtreecommitdiffstats
path: root/tests/base.py (unfollow)
Commit message (Collapse)AuthorLines
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
2020-08-04Verification: repurpose & rename `_check_users`Gravatar kwzrd-10/+8
Let's only use this function to check on the guild status. It can be exposed via a command in the future. Name adjusted to be more accurate w.r.t. Discord terminology.
2020-08-04Verification: implement `_verify_kick` helperGravatar kwzrd-0/+63
This will be used to guard the call to `_kick_members`.
2020-08-04Verification: implement `_kick_members` helperGravatar kwzrd-3/+21
2020-08-04Verification: implement `_give_role` helperGravatar kwzrd-2/+21
2020-08-04Verification: implement `check_users` coroutineGravatar kwzrd-1/+59
See docstring for details. The coroutine will be registered as a task at a later point.
2020-08-04Verification: define time constantsGravatar kwzrd-0/+3
2020-08-04Verification: refactor `discord` importsGravatar kwzrd-11/+13
Let's access these via the qualified name. The amount of imported names was starting to get unwieldy.
2020-08-04Verification: add @Unverified role to configGravatar kwzrd-2/+3
2020-08-04Revert "Disabled burst_shared filter temporarily"Gravatar Joseph Banks-0/+4
This reverts commit be14db91b1c70993773e67cfa663fef0cfa85666.
2020-08-03Add support for plural FilterList types.Gravatar Leon Sandøy-5/+17
This will allow mods to use '!whitelist get guild_invites' in addition to '!whitelist get guild_invite' This is just a naive implementation which works if the plural form is a simple s at the end of the word. It's implemented into the converter.
2020-08-03Add some feedback to the _sync_data helper.Gravatar Leon Sandøy-7/+15
Previously, this would not provide any feedback at all, which is really terrible UX. Sorry about that. This also adds error handling in case the API call fails.
2020-08-03Move function params to 4-space indentation.Gravatar Leon Sandøy-2/+17