Allow tempban by ID and ban downgrade #5978
No reviewers
Labels
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 project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!5978
Loading…
Reference in a new issue
No description provided.
Delete branch "tempban"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description of the changes
ctx.assume_yesevaluates toTrueFixes #5915
Have the changes in this PR been tested?
Yes.
Additional Notes
This is my first PR to this repo and I'm quite new to Python. Suggestions for improvement to my PR are very welcome.
I don't think allowing tempban to be run on a schedule would be best here.
I'm only implementing this based on Jack's last statement in the issue discussion, it can be raised for discussion again if needed.
I personally think it's okay to include it since prompt only appear if user is already banned anyway, my concern is that whether it should be the default choice to downgrade instead of skipping it completely.
It's not for scheduling, it's to allow for implementing a command that skips the prompt if someone prefers it that way.
@ -638,18 +644,19 @@ class KickBanMixin(MixinMeta):_("I cannot let you do that. Self-harm is bad {}").format("\N{PENSIVE FACE}")Use i18n
@ -665,9 +672,39 @@ class KickBanMixin(MixinMeta):returnThis can be vastly simplified by using the
ConfirmView:Also, you weren't using i18n for the strings (i.e. they weren't wrapped in
_()), the above suggestion fixes that as well.Bu the way, considering this inner function is only used once, it may make more sense to just put this code directly where the function is used.
No need to use the context manager when we're only reading the value:
The
not inoperator is more readable when testing whether something is not in a collection: