mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -05:00
Shorten the audit log reason appropriately, remove unused vars (#4189)
* [Mod] Check for reason length & remove unused vars This PR also remove unused variable. * Blame me * Apply Kowlin order. Text will get truncate in audit logs in case we're going over 512 characters. * This is already handled by ban_user() * Use `get_audit_reason()` in `[p]tempban` * Add a new kwarg to `get_audit_reason()` instead * Include `[p]voiceban` and `[p]voiceunban` * Include Mutes cog Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
@@ -978,7 +978,7 @@ class Mutes(VoiceMutes, commands.Cog, metaclass=CompositeMetaClass):
|
||||
)
|
||||
author = ctx.message.author
|
||||
guild = ctx.guild
|
||||
audit_reason = get_audit_reason(author, reason)
|
||||
audit_reason = get_audit_reason(author, reason, shorten=True)
|
||||
success_list = []
|
||||
issue_list = []
|
||||
for user in users:
|
||||
@@ -1122,7 +1122,7 @@ class Mutes(VoiceMutes, commands.Cog, metaclass=CompositeMetaClass):
|
||||
author = ctx.message.author
|
||||
channel = ctx.message.channel
|
||||
guild = ctx.guild
|
||||
audit_reason = get_audit_reason(author, reason)
|
||||
audit_reason = get_audit_reason(author, reason, shorten=True)
|
||||
issue_list = []
|
||||
success_list = []
|
||||
for user in users:
|
||||
@@ -1187,7 +1187,7 @@ class Mutes(VoiceMutes, commands.Cog, metaclass=CompositeMetaClass):
|
||||
async with ctx.typing():
|
||||
guild = ctx.guild
|
||||
author = ctx.author
|
||||
audit_reason = get_audit_reason(author, reason)
|
||||
audit_reason = get_audit_reason(author, reason, shorten=True)
|
||||
issue_list = []
|
||||
success_list = []
|
||||
if guild.id in self._channel_mute_events:
|
||||
@@ -1252,7 +1252,7 @@ class Mutes(VoiceMutes, commands.Cog, metaclass=CompositeMetaClass):
|
||||
channel = ctx.channel
|
||||
author = ctx.author
|
||||
guild = ctx.guild
|
||||
audit_reason = get_audit_reason(author, reason)
|
||||
audit_reason = get_audit_reason(author, reason, shorten=True)
|
||||
success_list = []
|
||||
issue_list = []
|
||||
for user in users:
|
||||
|
||||
Reference in New Issue
Block a user