mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 01:12:33 -05:00
Co-authored-by: Lemon Rose <78662983+japandotorg@users.noreply.github.com> Co-authored-by: Matt <psykzz@users.noreply.github.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import discord
|
||||
from redbot.core import Config, checks, commands
|
||||
from redbot.core.i18n import Translator, cog_i18n
|
||||
from redbot.core.utils.chat_formatting import box
|
||||
from redbot.core.utils.mod import get_audit_reason
|
||||
from redbot.core.utils.predicates import MessagePredicate
|
||||
|
||||
from .announcer import Announcer
|
||||
@@ -177,7 +178,8 @@ class Admin(commands.Cog):
|
||||
await ctx.send(_(NEED_MANAGE_ROLES))
|
||||
return
|
||||
try:
|
||||
await member.add_roles(role)
|
||||
reason = get_audit_reason(ctx.author)
|
||||
await member.add_roles(role, reason=reason)
|
||||
except discord.Forbidden:
|
||||
await ctx.send(_(GENERIC_FORBIDDEN))
|
||||
else:
|
||||
@@ -207,7 +209,8 @@ class Admin(commands.Cog):
|
||||
await ctx.send(_(NEED_MANAGE_ROLES))
|
||||
return
|
||||
try:
|
||||
await member.remove_roles(role)
|
||||
reason = get_audit_reason(ctx.author)
|
||||
await member.remove_roles(role, reason=reason)
|
||||
except discord.Forbidden:
|
||||
await ctx.send(_(GENERIC_FORBIDDEN))
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user