[Filter] Add filter clear commands #4981

Merged
Kreusada merged 9 commits from patch-26 into V3/develop 2021-09-02 17:55:58 +02:00
Kreusada commented 2021-04-10 20:57:35 +02:00 (Migrated from github.com)

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

Add [p]filter clear and [p]filter channel clear, which will clear the filters.

Closes #4841

### Type - [ ] Bugfix - [ ] Enhancement - [x] New feature ### Description of the changes Add `[p]filter clear` and `[p]filter channel clear`, which will clear the filters. Closes #4841
Jackenmen (Migrated from github.com) requested changes 2021-09-02 01:07:51 +02:00
@ -122,6 +122,22 @@ Examples:
Jackenmen (Migrated from github.com) commented 2021-09-02 00:39:39 +02:00
Clears this channel's filter list.
```suggestion Clears this channel's filter list. ```
@ -164,6 +180,22 @@ Examples:
Jackenmen (Migrated from github.com) commented 2021-09-02 00:39:45 +02:00
Clears this server's filter list.
```suggestion Clears this server's filter list. ```
@ -150,6 +152,29 @@ class Filter(commands.Cog):
"""
Jackenmen (Migrated from github.com) commented 2021-09-02 00:51:04 +02:00
        """Clears this server's filter list."""
```suggestion """Clears this server's filter list.""" ```
Jackenmen (Migrated from github.com) commented 2021-09-02 01:01:48 +02:00

"yes/no" is not conditional on the used language so should not be part of the translated text:

        await ctx.send(_("Are you sure you want to clear this server's filter list?") + " yes/no")
"yes/no" is not conditional on the used language so should not be part of the translated text: ```suggestion await ctx.send(_("Are you sure you want to clear this server's filter list?") + " yes/no") ```
Jackenmen (Migrated from github.com) commented 2021-09-02 01:05:13 +02:00

guild should be preferred over server as a variable name.

`guild` should be preferred over `server` as a variable name.
Jackenmen (Migrated from github.com) commented 2021-09-02 00:51:11 +02:00
        """Clears this channel's filter list."""
```suggestion """Clears this channel's filter list.""" ```
Jackenmen (Migrated from github.com) commented 2021-09-02 01:01:04 +02:00

"yes/no" is not conditional on the used language so should not be part of the translated text:

        await ctx.send(
            _("Are you sure you want to clear this channel's filter list?") + " (yes/no)"
        )
"yes/no" is not conditional on the used language so should not be part of the translated text: ```suggestion await ctx.send( _("Are you sure you want to clear this channel's filter list?") + " (yes/no)" ) ```
Jackenmen (Migrated from github.com) commented 2021-09-02 01:07:30 +02:00
            await self.config.channel(channel).filter.clear()
```suggestion await self.config.channel(channel).filter.clear() ```
Jackenmen (Migrated from github.com) approved these changes 2021-09-02 17:55:24 +02:00
Jackenmen (Migrated from github.com) left a comment

LGTM!

LGTM! ![](https://i.fluffy.cc/tjNCg01nQs8FZh2Kd1zznfVlmp95LkZP.gif)
red-githubbot[bot] commented 2021-09-08 22:10:06 +02:00 (Migrated from github.com)

Thanks Kreusada for the PR 🎉. I'm working now to backport this PR to: 3.4.

Thanks Kreusada for the PR 🎉. I'm working now to backport this PR to: 3.4.
red-githubbot[bot] commented 2021-09-08 22:10:13 +02:00 (Migrated from github.com)

#5283 is a backport of this pull request to Red 3.4.

#5283 is a backport of this pull request to [Red 3.4](https://github.com/Cog-Creators/Red-DiscordBot/tree/3.4).
Sign in to join this conversation.
No reviewers
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot!4981
No description provided.