Skip to content

Commit a552e68

Browse files
committed
fix(mute/set): >mute set command is broken
1 parent 10fcc97 commit a552e68

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
### Bugfixes
66
- [**Fixed**] Guild only (slash) commands is registered to DMs
7-
- [**Fixed**] Duration parser stop working
7+
- [**Fixed**] Duration parser stopped working
88
- [**Fixed**] `1 spam` is parsed as 1 seconds
9+
- [**Fixed**] `>mute set` command stopped working
910

1011
### Improvements
1112
- [**Changed**] Rename some command (only affecting for slash)

src/main/exts/mod/mod.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from ...core.errors import MissingMuteRole
1717
from ...core.menus import ZMenuPagesView
1818
from ...core.mixin import CogMixin
19+
from ...exts.admin._flags import RoleCreateFlags, RoleSetFlags
1920
from ...exts.timer.timer import Timer, TimerData
2021
from ...utils.cache import CacheUniqueViolation
2122
from ...utils.format import formatDateTime
@@ -310,9 +311,17 @@ async def doMute(self, _n, member: discord.Member, /, reason: str, **kwargs):
310311
usage="[role name]",
311312
)
312313
async def muteCreate(self, ctx, name: Union[discord.Role, str] = "Muted"):
314+
cmd = "create" if isinstance(name, str) else "set"
315+
argString = f"role: {getattr(name, 'id', name)} type: muted"
316+
317+
if cmd == "create":
318+
argument = await RoleCreateFlags.convert(ctx, arguments=argString)
319+
else:
320+
argument = await RoleSetFlags.convert(ctx, arguments=argString)
321+
313322
await ctx.try_invoke(
314-
"role create" if isinstance(name, str) else "role set",
315-
arguments=f"{getattr(name, 'id', name)} type: muted",
323+
f"role {cmd}",
324+
arguments=argument,
316325
)
317326

318327
@commands.command(

0 commit comments

Comments
 (0)