misc: improved formatting

This commit is contained in:
Seaswimmer 2023-08-08 01:36:22 -04:00
parent 1252e19668
commit 17a5a952e2
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -69,7 +69,7 @@ class Shortmute(commands.Cog):
elif duration < 1: elif duration < 1:
await interaction.response(content=f"Please shortmute the user for longer than {readable_duration}! The maximum duration is 30 minutes.", ephemeral=True) await interaction.response(content=f"Please shortmute the user for longer than {readable_duration}! The maximum duration is 30 minutes.", ephemeral=True)
return return
embed = discord.Embed(title="Are you sure?", description=f"Moderator: {interaction.user.mention}\nTarget: {target.mention}\nDuration: {readable_duration}\nReason: `{reason}`", color=await self.bot.get_embed_color(None)) embed = discord.Embed(title="Are you sure?", description=f"**Moderator:** {interaction.user.mention}\n**Target:** {target.mention}\n**Duration:** {readable_duration}\n**Reason:** `{reason}`", color=await self.bot.get_embed_color(None))
if evidence: if evidence:
embed.set_image(url=evidence) embed.set_image(url=evidence)
passed_info.update({ passed_info.update({
@ -94,7 +94,7 @@ class Shortmute(commands.Cog):
old_interaction = self.passed_info['interaction'] old_interaction = self.passed_info['interaction']
color = self.passed_info['color'] color = self.passed_info['color']
timedelta = parse(f'{duration} minutes', as_timedelta=True) timedelta = parse(f'{duration} minutes', as_timedelta=True)
edit_embed = discord.Embed(title="Shortmute confirmed!", description=f"Moderator: {old_interaction.user.mention}\nTarget: {target.mention}\nDuration: {readable_duration}\nReason: `{reason}`", color=color) edit_embed = discord.Embed(title="Shortmute confirmed!", description=f"**Moderator:** {old_interaction.user.mention}\n**Target:** {target.mention}\n**Duration:** {readable_duration}\n**Reason:** `{reason}`", color=color)
if self.passed_info.get('evidence'): if self.passed_info.get('evidence'):
evidence = self.passed_info['evidence'] evidence = self.passed_info['evidence']
edit_embed.set_image(url=evidence) edit_embed.set_image(url=evidence)
@ -102,7 +102,7 @@ class Shortmute(commands.Cog):
await target.timeout(timedelta, reason=f"User shortmuted for {readable_duration} by {old_interaction.user.name} ({old_interaction.user.id}) for: {reason}") await target.timeout(timedelta, reason=f"User shortmuted for {readable_duration} by {old_interaction.user.name} ({old_interaction.user.id}) for: {reason}")
await old_interaction.channel.send(content=f"{target.mention} was shortmuted for {readable_duration} by {old_interaction.user.mention} for: `{reason}`") await old_interaction.channel.send(content=f"{target.mention} was shortmuted for {readable_duration} by {old_interaction.user.mention} for: `{reason}`")
if await self.config.guild(old_interaction.guild).dm() is True: if await self.config.guild(old_interaction.guild).dm() is True:
dm_embed = discord.Embed(title=f"You've been shortmuted in {old_interaction.guild.name}!", description=f"Moderator: {old_interaction.user.mention}\nTarget: {target.mention}\nDuration: {readable_duration}\nReason: `{reason}`", color=color) dm_embed = discord.Embed(title=f"You've been shortmuted in {old_interaction.guild.name}!", description=f"**Moderator:** {old_interaction.user.mention}\n**Target:** {target.mention}\n**Duration:** {readable_duration}\n**Reason:** `{reason}`", color=color)
if evidence: if evidence:
dm_embed.set_image(url=evidence) dm_embed.set_image(url=evidence)
try: try:
@ -111,7 +111,7 @@ class Shortmute(commands.Cog):
await old_message.edit(content="Could not message the target, user most likely has Direct Messages disabled.") await old_message.edit(content="Could not message the target, user most likely has Direct Messages disabled.")
logging_channels_list = await self.config.guild(old_interaction.guild).logging_channels() logging_channels_list = await self.config.guild(old_interaction.guild).logging_channels()
if logging_channels_list: if logging_channels_list:
logging_embed = discord.Embed(title="User Shortmuted", description=f"Moderator: {old_interaction.user.mention} ({old_interaction.user.id})\nTarget: {target.mention} ({target.id})\nDuration: {readable_duration}\nReason: `{reason}`", color=color) logging_embed = discord.Embed(title="User Shortmuted", description=f"**Moderator:** {old_interaction.user.mention} ({old_interaction.user.id})\n**Target:** {target.mention} ({target.id})\n**Duration:** {readable_duration}\n**Reason:** `{reason}`", color=color)
logging_embed.set_footer(text="/shortmute") logging_embed.set_footer(text="/shortmute")
if evidence: if evidence:
logging_embed.set_image(url=evidence) logging_embed.set_image(url=evidence)