mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-07 09:52:30 -05:00
Add support for timeouts to Mutes cog (#5604)
Co-authored-by: Michael Oliveira <34169552+Flame442@users.noreply.github.com>
This commit is contained in:
@@ -122,13 +122,13 @@ class VoiceMutes(MixinMeta):
|
||||
channel = user_voice_state.channel
|
||||
audit_reason = get_audit_reason(author, reason, shorten=True)
|
||||
|
||||
success = await self.channel_mute_user(
|
||||
result = await self.channel_mute_user(
|
||||
guild, channel, author, user, until, audit_reason, voice_mute=True
|
||||
)
|
||||
|
||||
if success["success"]:
|
||||
if "reason" in success and success["reason"]:
|
||||
issue_list.append((user, success["reason"]))
|
||||
if result.success:
|
||||
if result.reason:
|
||||
issue_list.append((user, result.reason))
|
||||
else:
|
||||
success_list.append(user)
|
||||
await modlog.create_case(
|
||||
@@ -146,9 +146,9 @@ class VoiceMutes(MixinMeta):
|
||||
user, author, guild, _("Voice mute"), reason, duration
|
||||
)
|
||||
async with self.config.member(user).perms_cache() as cache:
|
||||
cache[channel.id] = success["old_overs"]
|
||||
cache[channel.id] = result.old_overs
|
||||
else:
|
||||
issue_list.append((user, success["reason"]))
|
||||
issue_list.append((user, result.reason))
|
||||
|
||||
if success_list:
|
||||
msg = _("{users} has been muted in this channel{time}.")
|
||||
@@ -198,13 +198,13 @@ class VoiceMutes(MixinMeta):
|
||||
channel = user_voice_state.channel
|
||||
audit_reason = get_audit_reason(author, reason, shorten=True)
|
||||
|
||||
success = await self.channel_unmute_user(
|
||||
result = await self.channel_unmute_user(
|
||||
guild, channel, author, user, audit_reason, voice_mute=True
|
||||
)
|
||||
|
||||
if success["success"]:
|
||||
if "reason" in success and success["reason"]:
|
||||
issue_list.append((user, success["reason"]))
|
||||
if result.success:
|
||||
if result.reason:
|
||||
issue_list.append((user, result.reason))
|
||||
else:
|
||||
success_list.append(user)
|
||||
await modlog.create_case(
|
||||
@@ -222,7 +222,7 @@ class VoiceMutes(MixinMeta):
|
||||
user, author, guild, _("Voice unmute"), reason
|
||||
)
|
||||
else:
|
||||
issue_list.append((user, success["reason"]))
|
||||
issue_list.append((user, result.reason))
|
||||
if success_list:
|
||||
if channel.id in self._channel_mutes and self._channel_mutes[channel.id]:
|
||||
await self.config.channel(channel).muted_users.set(self._channel_mutes[channel.id])
|
||||
|
||||
Reference in New Issue
Block a user