[V3] timed/temporary mutes [Don't review current, see comments] #2140

Closed
mikeshardmind wants to merge 11 commits from V3/timed-mutes into V3/develop
mikeshardmind commented 2018-09-20 05:33:09 +02:00 (Migrated from github.com)

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

Adds support for temporary mutes.

Usage examples:

[p]mute channel @Sinbad#0001 1 day being rude
[p]mute server @Blaze 4hours 20 minutes Won't stop talking about weed in every channel. 
[p]mute channel @AngryGamer 10 minutes muted while a mod mediates

This resolves #2103

### Type - [ ] Bugfix - [x] Enhancement - [X] New feature ### Description of the changes Adds support for temporary mutes. Usage examples: ``` [p]mute channel @Sinbad#0001 1 day being rude ``` ``` [p]mute server @Blaze 4hours 20 minutes Won't stop talking about weed in every channel. ``` ``` [p]mute channel @AngryGamer 10 minutes muted while a mod mediates ``` This resolves #2103
palmtree5 (Migrated from github.com) reviewed 2018-09-20 05:33:09 +02:00
tekulvw (Migrated from github.com) reviewed 2018-09-20 05:33:09 +02:00
Twentysix26 (Migrated from github.com) reviewed 2018-09-20 05:33:09 +02:00
Redjumpman (Migrated from github.com) reviewed 2018-09-20 05:33:09 +02:00
mikeshardmind commented 2018-09-20 12:35:58 +02:00 (Migrated from github.com)

Going to modify the unmute task somewhat to handle time resolution a little more closely.

Going to modify the unmute task somewhat to handle time resolution a little more closely.
Tobotimus commented 2018-10-03 00:37:26 +02:00 (Migrated from github.com)

I understand the appeal of argparse-style commands, but unfortunately I don't agree that they have a place in core commands; not yet at least. My reasons being:

  1. There is no reason why mute should be the only argparse-style command
  2. A considerable proportion of our userbase has never used a unix shell and are unlikely to understand how to use this; users are used to positional command arguments as this is the style of all other bot commands
  3. We now have Greedy and Optional converters which would work perfectly for the purposes of temp mute without the break from convention

In the future I would happily accept a utility for more general argparse-style converters, but if it's to be used in the core bot, it should not force any command signatures to change.

I understand the appeal of argparse-style commands, but unfortunately I don't agree that they have a place in core commands; not yet at least. My reasons being: 1. There is no reason why mute should be the only argparse-style command 2. A considerable proportion of our userbase has never used a unix shell and are unlikely to understand how to use this; users are used to positional command arguments as this is the style of all other bot commands 3. We now have `Greedy` and `Optional` converters which would work perfectly for the purposes of temp mute without the break from convention In the future I would happily accept a utility for more general argparse-style converters, but if it's to be used in the core bot, it should not force any command signatures to change.
mikeshardmind commented 2018-10-08 17:49:01 +02:00 (Migrated from github.com)

Actually, the greedy converter and optional one wont work for this. Greedy behaves more like a typehint for sequence, than a greedy match. And optional does not play nice with arbitrary strings which can exist in a reason. @tobotimus

Actually, the greedy converter and optional one wont work for this. Greedy behaves more like a typehint for sequence, than a greedy match. And optional does not play nice with arbitrary strings which can exist in a reason. @tobotimus
mikeshardmind commented 2018-10-08 17:59:12 +02:00 (Migrated from github.com)

An example:

mute channel LoudUser wont wait 1 minute for a mod to mediate 5 minutes
mute channel user could not shut up for 1 minute

Parse those unambiguously using d.py builtins ( and any other possible one) and I'll agree. Otherwise I'm not budging on implementation.

An example: ``` mute channel LoudUser wont wait 1 minute for a mod to mediate 5 minutes ``` ``` mute channel user could not shut up for 1 minute ``` Parse those unambiguously using d.py builtins ( and any other possible one) and I'll agree. Otherwise I'm not budging on implementation.
mikeshardmind commented 2018-10-08 21:47:06 +02:00 (Migrated from github.com)

Since this has been dropped from RC1, close this if that's the final stance on argparse, and I'll make my own. I'm available on discord, as usual, to discuss up until then.

ED: discussed, and see below

Since this has been dropped from RC1, close this if that's the final stance on argparse, and I'll make my own. I'm available on discord, as usual, to discuss up until then. ED: discussed, and see below
mikeshardmind commented 2018-10-11 00:37:59 +02:00 (Migrated from github.com)

I've updated this to not use argparse and flags. While both the time and reason remain optional, now the time must be provided first if it is going to be provided.

I've updated this to not use argparse and flags. While both the time and reason remain optional, now the time must be provided first if it is going to be provided.
mikeshardmind commented 2018-10-11 00:42:00 +02:00 (Migrated from github.com)

I've also decided to leave the original timedelta converter without reason support in the PR as I do still think this is a useful utility for other creators, but this can be removed if this is no longer wanted there.

I've also decided to leave the original timedelta converter without reason support in the PR as I do still think this is a useful utility for other creators, but this can be removed if this is no longer wanted there.
mikeshardmind commented 2018-10-12 08:36:23 +02:00 (Migrated from github.com)

Stuff here needs some more cleaning up, and likely re-handling after or with #2232 . Stale for now

Stuff here needs some more cleaning up, and likely re-handling after or with #2232 . Stale for now
laggron42 commented 2018-10-23 11:33:26 +02:00 (Migrated from github.com)

Can you move redbot.core.converter.timedelta_converter in a different pull request, or reopen #2126 because I need the converter in my cogs and knowing that this PR is frozen is not really reassuring for me...

Can you move `redbot.core.converter.timedelta_converter` in a different pull request, or reopen #2126 because I need the converter in my cogs and knowing that this PR is frozen is not really reassuring for me...
mikeshardmind commented 2018-10-24 02:33:29 +02:00 (Migrated from github.com)

As 3.0.0 is in RC phase and not receiving new features, you should use a cog local converter if you need it before 3.1 when this would be included.

As 3.0.0 is in RC phase and not receiving new features, you should use a cog local converter if you need it before 3.1 when this would be included.
mikeshardmind commented 2019-02-12 18:23:02 +01:00 (Migrated from github.com)

Closing this as I will not have the time to have a polished implementation of this before 3.1

The approach used here should likely not be reused after conversations in discord anyway.

Closing this as I will not have the time to have a polished implementation of this before 3.1 The approach used here should likely not be reused after conversations in discord anyway.

Pull request closed

Sign in to join this conversation.
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!2140
No description provided.