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:
Predeactor
2020-12-23 03:22:59 +01:00
committed by GitHub
parent d3ffb22e86
commit d53ff57794
4 changed files with 29 additions and 27 deletions

View File

@@ -121,7 +121,7 @@ class VoiceMutes(MixinMeta):
guild = ctx.guild
author = ctx.author
channel = user_voice_state.channel
audit_reason = get_audit_reason(author, reason)
audit_reason = get_audit_reason(author, reason, shorten=True)
success = await self.channel_mute_user(
guild, channel, author, user, until, audit_reason
@@ -194,7 +194,7 @@ class VoiceMutes(MixinMeta):
guild = ctx.guild
author = ctx.author
channel = user_voice_state.channel
audit_reason = get_audit_reason(author, reason)
audit_reason = get_audit_reason(author, reason, shorten=True)
success = await self.channel_unmute_user(
guild, channel, author, user, audit_reason