mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -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 import Config, checks, commands
|
||||||
from redbot.core.i18n import Translator, cog_i18n
|
from redbot.core.i18n import Translator, cog_i18n
|
||||||
from redbot.core.utils.chat_formatting import box
|
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 redbot.core.utils.predicates import MessagePredicate
|
||||||
|
|
||||||
from .announcer import Announcer
|
from .announcer import Announcer
|
||||||
@ -170,7 +171,8 @@ class Admin(commands.Cog):
|
|||||||
await ctx.send(_(NEED_MANAGE_ROLES))
|
await ctx.send(_(NEED_MANAGE_ROLES))
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
await member.add_roles(role)
|
reason = get_audit_reason(ctx.author)
|
||||||
|
await member.add_roles(role, reason=reason)
|
||||||
except discord.Forbidden:
|
except discord.Forbidden:
|
||||||
await ctx.send(_(GENERIC_FORBIDDEN))
|
await ctx.send(_(GENERIC_FORBIDDEN))
|
||||||
else:
|
else:
|
||||||
@ -200,7 +202,8 @@ class Admin(commands.Cog):
|
|||||||
await ctx.send(_(NEED_MANAGE_ROLES))
|
await ctx.send(_(NEED_MANAGE_ROLES))
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
await member.remove_roles(role)
|
reason = get_audit_reason(ctx.author)
|
||||||
|
await member.remove_roles(role, reason=reason)
|
||||||
except discord.Forbidden:
|
except discord.Forbidden:
|
||||||
await ctx.send(_(GENERIC_FORBIDDEN))
|
await ctx.send(_(GENERIC_FORBIDDEN))
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user