mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[Admin] add reasoning to addrole & removerole. (#5927)
Co-authored-by: Matt <psykzz@users.noreply.github.com>
This commit is contained in:
parent
fb3dc51fe2
commit
333e359bbb
@ -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
|
||||
@ -170,7 +171,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:
|
||||
@ -200,7 +202,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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user