diff options
| author | 2020-07-24 10:42:09 +0200 | |
|---|---|---|
| committer | 2020-07-24 10:42:09 +0200 | |
| commit | 02e7672623dd1aea11a715e5187eaef7f8633d17 (patch) | |
| tree | 7dffd67694c42b134fccb7ff67b652a589b579ba | |
| parent | Add sanity to partner and verification check in filtering.py. (diff) | |
More explicit dict indexing
Addresses reviews from MarkKoz
Co-authored-by: Mark <[email protected]>
| -rw-r--r-- | bot/cogs/antimalware.py | 2 | ||||
| -rw-r--r-- | bot/cogs/filtering.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/bot/cogs/antimalware.py b/bot/cogs/antimalware.py index 38ff1133d..5b56f937f 100644 --- a/bot/cogs/antimalware.py +++ b/bot/cogs/antimalware.py @@ -40,7 +40,7 @@ class AntiMalware(Cog): def _get_whitelisted_file_formats(self) -> list: """Get the file formats currently on the whitelist.""" - return [item.get('content') for item in self.bot.allow_deny_list_cache['file_format.True']] + return [item['content'] for item in self.bot.allow_deny_list_cache['file_format.True']] def _get_disallowed_extensions(self, message: Message) -> t.Iterable[str]: """Get an iterable containing all the disallowed extensions of attachments.""" diff --git a/bot/cogs/filtering.py b/bot/cogs/filtering.py index 98a60f489..8897cbaf9 100644 --- a/bot/cogs/filtering.py +++ b/bot/cogs/filtering.py @@ -104,9 +104,9 @@ class Filtering(Cog): items = self.bot.allow_deny_list_cache.get(f"{list_type.upper()}.{allowed}", []) if compiled: - return [re.compile(fr'{item.get("content")}', flags=re.IGNORECASE) for item in items] + return [re.compile(fr'{item["content"]}', flags=re.IGNORECASE) for item in items] else: - return [item.get("content") for item in items] + return [item["content"] for item in items] @staticmethod def _expand_spoilers(text: str) -> str: |