mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[Mute] Indicate that a guild mute/unmute is currently being processed. (#4172)
Co-authored-by: fixator10
This commit is contained in:
parent
05ef5fa3a6
commit
35b0224690
@ -3,6 +3,7 @@ from typing import cast, Optional
|
|||||||
|
|
||||||
import discord
|
import discord
|
||||||
from redbot.core import commands, checks, i18n, modlog
|
from redbot.core import commands, checks, i18n, modlog
|
||||||
|
from redbot.core.utils import AsyncIter
|
||||||
from redbot.core.utils.chat_formatting import format_perms_list
|
from redbot.core.utils.chat_formatting import format_perms_list
|
||||||
from redbot.core.utils.mod import get_audit_reason, is_allowed_by_hierarchy
|
from redbot.core.utils.mod import get_audit_reason, is_allowed_by_hierarchy
|
||||||
from .abc import MixinMeta
|
from .abc import MixinMeta
|
||||||
@ -254,10 +255,10 @@ class MuteMixin(MixinMeta):
|
|||||||
audit_reason = get_audit_reason(author, reason)
|
audit_reason = get_audit_reason(author, reason)
|
||||||
|
|
||||||
mute_success = []
|
mute_success = []
|
||||||
|
async with ctx.typing():
|
||||||
for channel in guild.channels:
|
for channel in guild.channels:
|
||||||
success, issue = await self.mute_user(guild, channel, author, user, audit_reason)
|
success, issue = await self.mute_user(guild, channel, author, user, audit_reason)
|
||||||
mute_success.append((success, issue))
|
mute_success.append((success, issue))
|
||||||
await asyncio.sleep(0.1)
|
|
||||||
await modlog.create_case(
|
await modlog.create_case(
|
||||||
self.bot,
|
self.bot,
|
||||||
guild,
|
guild,
|
||||||
@ -373,12 +374,21 @@ class MuteMixin(MixinMeta):
|
|||||||
audit_reason = get_audit_reason(author, reason)
|
audit_reason = get_audit_reason(author, reason)
|
||||||
|
|
||||||
unmute_success = []
|
unmute_success = []
|
||||||
|
async with ctx.typing():
|
||||||
for channel in guild.channels:
|
for channel in guild.channels:
|
||||||
success, message = await self.unmute_user(guild, channel, author, user, audit_reason)
|
success, message = await self.unmute_user(
|
||||||
|
guild, channel, author, user, audit_reason
|
||||||
|
)
|
||||||
unmute_success.append((success, message))
|
unmute_success.append((success, message))
|
||||||
await asyncio.sleep(0.1)
|
|
||||||
await modlog.create_case(
|
await modlog.create_case(
|
||||||
self.bot, guild, ctx.message.created_at, "sunmute", user, author, reason, until=None,
|
self.bot,
|
||||||
|
guild,
|
||||||
|
ctx.message.created_at,
|
||||||
|
"sunmute",
|
||||||
|
user,
|
||||||
|
author,
|
||||||
|
reason,
|
||||||
|
until=None,
|
||||||
)
|
)
|
||||||
await ctx.send(_("User has been unmuted in this server."))
|
await ctx.send(_("User has been unmuted in this server."))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user