aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| | * | | | | | | | | | | | | Update any calls to Redis 'iscan' to the new name 'scan_iter'Gravatar Chris Lovering2022-08-14-2/+2
| | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | Convert key expiries to integers before passing to RedisGravatar Chris Lovering2022-08-14-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a float is given, Redis will assume the expiry is in milliseconds and must be multiplied by 1000. This is undesirable, as we are already passing the expiry in seconds.
| | * | | | | | | | | | | | | Remove usages of the removed namespace_lock decoratorGravatar Chris Lovering2022-08-14-6/+1
| | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | No longer use the removed RedisSession connection objectGravatar Chris Lovering2022-08-14-51/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has been abstracted away, the correct way to do this now is to directly access the client.
| | * | | | | | | | | | | | | redis-py breaking changesGravatar Chris Lovering2022-08-14-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit resolves all the breaking changes from the aioredis -> redis-py migration.
| | * | | | | | | | | | | | | Bump all deps to latestGravatar Chris Lovering2022-08-14-85/+62
| | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | Bump bot-core versionGravatar Chris Lovering2022-08-14-1216/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bump comes with a move to redis-py over aioredis. As such, pin new transitive dependancies to exact versions.
| | * | | | | | | | | | | | | Remove warnings in error handler testsGravatar Chris Lovering2022-08-14-56/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These warnings were caused by the setup coro from error_handler.py being imported directly, causing a warning about an un-awaited coro whenever the Cog was accessed from the same file.
| | * | | | | | | | | | | | | Remove call to get_event_loop in testsGravatar Chris Lovering2022-08-14-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | get_event_loop is deprecated as of 3.10 if there is no running loop.
| | * | | | | | | | | | | | | Bump to Python 3.10Gravatar Chris Lovering2022-08-14-3/+3
| | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | Update the docker-compose snekbox dep for botGravatar Chris Lovering2022-08-14-1/+1
| |/ / / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bot service was still configured to depend on the snekbox service, even though this service is now optional, in favour of the snekbox-311 service.
| * | | | | | | | | | | | | Merge pull request #2240 from python-discord/2238-purge-cmdGravatar mina2022-08-03-2/+8
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | |_|/ / / / / / / / / / / | |/| | | | | | | | | | | | Updated `purge` to require at least one user
| | * | | | | | | | | | | | Improved `purge` help messageGravatar ionite342022-08-03-1/+1
| | | | | | | | | | | | | |
| | * | | | | | | | | | | | Removed unused importGravatar ionite342022-08-03-1/+1
| | | | | | | | | | | | | |
| | * | | | | | | | | | | | Updated `purge` to require >1 usersGravatar ionite342022-08-03-3/+9
| |/ / / / / / / / / / / /
| | | * / / / / / / / / / Address ReviewGravatar Izan2022-09-17-2/+6
| | | |/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Convert `ids` to a set to remove duplicates - Limit the amount of reminders you can delete at once to 5 in order to prevent API spam
| | | * | | | | | | | | Display mentions instead of name attribute in `!reminder list`Gravatar Izan2022-07-25-3/+2
| | | | | | | | | | | |
| | | * | | | | | | | | Add ability to delete multiple remindersGravatar Izan2022-07-25-13/+58
| | |/ / / / / / / / / | |/| | | | | | | | |
| * | | | | | | | | | Merge pull request #2224 from python-discord/sid/feature/tags/print-returnGravatar ChrisJL2022-07-24-0/+9
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | feat(tags): add print-return tag
| | * \ \ \ \ \ \ \ \ \ Merge branch 'main' into sid/feature/tags/print-returnGravatar mina2022-07-24-8/+9
| | |\ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / | |/| | | | | | | | | |
| * | | | | | | | | | | Merge pull request #2220 from python-discord/fix-bot-2168Gravatar wookie1842022-07-23-8/+9
| |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | Update `!modpings off` confirmation to use a discord timestamp.
| | * \ \ \ \ \ \ \ \ \ \ Merge branch 'main' into fix-bot-2168Gravatar wookie1842022-07-23-181/+1397
| | |\ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / / | |/| | | | | | | | | | |
| | * | | | | | | | | | | Update `!modpings off` confirmation to use a discord timestamp.Gravatar Izan2022-07-23-8/+9
| | | | | | | | | | | | |
| | | * | | | | | | | | | Merge branch 'main' into sid/feature/tags/print-returnGravatar ChrisJL2022-07-21-28/+28
| | | |\ \ \ \ \ \ \ \ \ \ | | |_|/ / / / / / / / / / | |/| | | | | | | | | | |
| * | | | | | | | | | | | Merge pull request #2225 from python-discord/snekbox-snagsGravatar ChrisJL2022-07-21-28/+28
| |\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the view clear on timeout feature from bot-core in snekbox
| | * | | | | | | | | | | | Start 3.11 snekbox container by defaultGravatar Chris Lovering2022-07-21-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since snekbox uses 3.11 by default, it makes sense for this one to be started by default, and the 3.10 container to be opt-in.
| | * | | | | | | | | | | | Update snekbox tests to expect new outputGravatar Chris Lovering2022-07-21-11/+13
| | | | | | | | | | | | | |
| | * | | | | | | | | | | | Include what version of Python was used in snekbox output.Gravatar Chris Lovering2022-07-21-6/+6
| | | | | | | | | | | | | |
| | * | | | | | | | | | | | Use the view clear on timeout feature from bot-core in snekboxGravatar Chris Lovering2022-07-21-9/+7
| |/ / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will mean the buttons will be cleared from the response on interaction timeout.
| | | * | | | | | | | | | fix(tags/print-return): use the raw GitHub URL for the GIFGravatar Siddhesh Mhadnak2022-07-17-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As mentioned in the previous commit, using the raw GitHub URL would be more reliable than a Discord CDN URL.
| | | * | | | | | | | | | chore(tags/print-return): add the GIF to the repoGravatar Siddhesh Mhadnak2022-07-17-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in https://discord.com/channels/267624335836053506/635950537262759947/998235482494353508, using the raw GitHub URL for the GIF would be more reliable than the Discord CDN URL.
| | | * | | | | | | | | | style(tags/print-return): set the `title` property instead of using bolded textGravatar Siddhesh Mhadnak2022-07-17-2/+1
| | | | | | | | | | | | |
| | | * | | | | | | | | | feat(tags): add print-return tagGravatar Siddhesh Mhadnak2022-07-17-0/+10
| | |/ / / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we already create the tag embed from the `embed` object in the metadata, we already have the support to add images in embeds, albeit a bit more verbose than if we had added a `media` property in the metadata containing only the URL.
| * | | | | | | | | | | Merge pull request #2218 from python-discord/3.11-snekboxGravatar ChrisJL2022-07-16-161/+1364
| |\ \ \ \ \ \ \ \ \ \ \
| | * | | | | | | | | | | Use interaction.defer for snekbox version switch buttonGravatar Chris Lovering2022-07-16-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is so that we do not need to spawn the run_job call in a seperate task. This also wraps interaction.message.delete() in a NotFound suppress to cover the case where a user re-runs code and very quickly clicks the button. The log arg on send_job will stop the actual job from running in this case.
| | * | | | | | | | | | | Move snekbox lock error handling to a try/exceptGravatar Chris Lovering2022-07-16-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cog_command_error isn't hit when the run_job function is called from the button interaction, this means if the lock error is raiseed, it doees not get handled.
| | * | | | | | | | | | | Infer the snekbox invoker from contextGravatar Chris Lovering2022-07-16-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than passing around superfluous variables.
| | * | | | | | | | | | | Use generic views from bot0core for snekboxGravatar Chris Lovering2022-07-16-135/+1192
| | | | | | | | | | | | |
| | * | | | | | | | | | | Update snekbox tests to reflect current behaviourGravatar Chris Lovering2022-07-16-23/+37
| | | | | | | | | | | | |
| | * | | | | | | | | | | Allow users to eval code in either 3.11 or 3.10Gravatar Chris Lovering2022-07-16-29/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To do this we need to track, for each user, the active eval's code, python version and response message. This is because a button press can now also trigger a job to continue. If we did not track these, then editing your own code and then re-evaluating it would trigger the wait_fors in continue_job for each time you pressed the button to change languages. Co-authored-by: Mark <[email protected]>
| | * | | | | | | | | | | Add required config and constants for snekbox 3.11Gravatar Chris Lovering2022-07-16-0/+14
| |/ / / / / / / / / / /
* | | | | | | | | | | | Convert all setting entries to pydnatic modelsGravatar mbaruh2022-09-10-150/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to facilitate this change, the init of all setting entries was removed, and as such the base SettingsEntry class doesn't count as abstract anymore, which broke the MUST_SET behavior. It was changed to not raise errors for MUST_SET values of attributes which were set in the current class. Additionally fixed a small bug where filters weren't listed properly in the list command. Despite the pydantic manual not writing it that way, I first made the validators class methods, otherwise it gave linting errors which couldn't be ignored with noqa (because then it complained about blanket noqas).
* | | | | | | | | | | | Add settings display for individual filters and filter listsGravatar mbaruh2022-07-16-108/+248
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The filterlist describe command is changed to include the default settings it contains. The filters group can now take a filter ID, and it will display embed detailing the filter data and settings. The mechanic is similar to how individual infractions can be displayed with `!infraction <id>`. - To be able to quickly find whether the filter with the provided ID is in a specific list, the data structure was changed to a dictionary. - To be able to mark which settings have the default values and which are overrides, resolving the full actions of a filter is deferred to when the filter is actually triggered. This wasn't possible in the beginning of development, but now that each filterlist can resolve the action to be taken with its own internal logic, it is. - Some attribute names of SettingsEntry subclasses were changed to match the name under which they're stored in the DB. This allows displaying the settings with the names that need to be used to edit them. - Each filterlist now contains all settings, even if they're empty, so that they can be displayed. While this is slightly less efficient, I considered it too negligible to make displaying the settings messier than it already is. - Some additional refactoring in the cog was done to avoid code repetition.
* | | | | | | | | | | | Add system description commandsGravatar mbaruh2022-07-16-22/+287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The system is fairly complex, and to avoid having to delve into the source code, this commit adds several commands to show descriptions for various components of the system: - Filters - Filter lists - Settings (both from the DB schema and filter-type-specific) The names that can be described are the ones which are actually being used in the system. So if no tokens list was loaded, it can't be described even if there is an implementation for it. If no name is relayed to the commands, the list of options will be shown instead.
* | | | | | | | | | | | Add filter-type-specific settingsGravatar mbaruh2022-07-16-93/+899
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pydantic is added to the bot's dependencies, allowing easily setting up settings that are specific to a filter type (e.g for domains). The data for those settings is loaded from the "additional_field" JSON field in the Filter table. This commit specifically adds an option to match a domain exactly, without matching subdomains. There are several benefits to using Pydantic: - Built-in serialization to, and de-serialization from JSON, which is useful for reading and writing to the DB. - Type validation on initialization. - By default ignores extra fields when de-serializing, which can prevent things breaking if the extra fields change.
* | | | | | | | | | | | Add domain filteringGravatar mbaruh2022-07-16-12/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The domain filtering works very similarly to the token filtering, and the domain matching itself is based on the implementation in the old system. The deletion setting is accessed explicitly in the domain filter in order to allow DMing the user the domain the message got deleted for. This is fine, since practical uses are more important than the theory this system was designed with. Of course, breaking the design should still be avoided whenever possible.
* | | | | | | | | | | | Fix argument completion for non-last argsGravatar mbaruh2022-07-16-32/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the completed arg would be appended to the end of the message, which didn't work if the missing argument wasn't the last one (for example, a value was given to a following argument because of a failed conversion for previous ones). The select now employs a different strategy of storing the provided args, and the position where the new are should be inserted.
* | | | | | | | | | | | Add guild invite filteringGravatar mbaruh2022-07-16-19/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds the invite filtering implementation to the new system. This also fixes an issue with the implementation of the extension filtering, where there was no way to tell the bot to ignore a user when they posted a non-whitelisted file extension, since there's no relevant filter in this scenario. Instead the extensions and invites filters now use the whitelist validation defaults to dictate when filtering should be done at all. For example, if the list validations are to ignore Helpers, then no invite filtering will occur no matter what. The meaning of this is that the system is somewhat less configurable, because settings overrides in filters belonging to a whitelist are meaningless. Additionally this commit contains the following fixes: - If the user tries to show the filters in a list which doesn't exist, it says it doesn't exist instead of saying there are 0 filters. - The filter context content is `Union[str, set]` instead of `Union[str, set[str]]`. - An empty embed will no longer be created when `dm_embed` is empty.
* | | | | | | | | | | | Add file extension filteringGravatar mbaruh2022-07-16-49/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commmit migrates the AntiMalware cog to a new filter list which goes over a message's attachments. Some changes were needed to accomodate the new list, primarily what a filter list returns for a given context: Instead of returning a list of filters, it will return the action itself that should be taken. This adds the flexibility of not needing existing filters to dictate the action. For example, in the case of the extensions list, an action should be taken when filters were *not* triggered. Or more precisely, when not all attachment extensions are whitelisted. Therefore, the action in that case is dictated by the filter list (stored as the list's default actions). Additionally each filter list can now return its own message for the alert embed, instead of the cog formatting it according to the filters raised. Because again, an action might be taken without any deny filters being triggered. This is going to be especially relevant for the invites list. Additionally, the infraction_and_notification action now doesn't redirect the notification to the context channel when the DM fails, since this can be incredibly noisy in cases of spam. If we want this functionality, a more suitable solution should be found.
* | | | | | | | | | | | Accept strings in channel scope and change role string interpretationGravatar mbaruh2022-07-16-38/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The channel scope settings were changed to accomodate strings. That means that if a string is specified, the bot will look whether the context channel's name matches. If it's a number, it will match the ID. Accordingly the same changed was applied to the bypass roles and pings settings: if it's a non-numeric string, it will look for a role with that name.