fix: potentially fixed shortmute yes not working
This commit is contained in:
parent
c3b99c48f0
commit
a6368dd715
1 changed files with 5 additions and 5 deletions
|
@ -68,7 +68,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}\nTarget: {target.mention}\nDuration: {readable_duration}\nReason: `{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({
|
||||||
|
@ -92,15 +92,15 @@ class Shortmute(commands.Cog):
|
||||||
reason = self.passed_info['reason']
|
reason = self.passed_info['reason']
|
||||||
old_interaction = self.passed_info['interaction']
|
old_interaction = self.passed_info['interaction']
|
||||||
timedelta = parse(f'{duration} minutes')
|
timedelta = parse(f'{duration} minutes')
|
||||||
edit_embed = discord.Embed(title="Shortmute confirmed!", description=f"Moderator: {old_interaction.user.mention}\nTarget: {target.mention}\nDuration: `{readable_duration}`\nReason: `{reason}`", color=await self.bot.get_embed_color(None))
|
edit_embed = discord.Embed(title="Shortmute confirmed!", description=f"Moderator: {old_interaction.user.mention}\nTarget: {target.mention}\nDuration: {readable_duration}\nReason: `{reason}`", color=await self.bot.get_embed_color(None))
|
||||||
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)
|
||||||
old_message = await old_interaction.edit_original_response(embed=edit_embed, view=None)
|
old_message = await interaction.response.edit_message(embed=edit_embed, view=None)
|
||||||
await target.timeout(until=timedelta, reason=f"User shortmuted for {readable_duration} by {old_interaction.user.name} ({old_interaction.user.id}) for: {reason}")
|
await target.timeout(until=timedelta, reason=f"User shortmuted for {readable_duration} by {old_interaction.user.name} ({old_interaction.user.id}) for: {reason}")
|
||||||
await interaction.channel.send(content=f"{target.mention} shortmuted for {readable_duration} by {old_interaction.user.mention} for: `{reason}`")
|
await interaction.channel.send(content=f"{target.mention} 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=await self.bot.get_embed_color(None))
|
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=await self.bot.get_embed_color(None))
|
||||||
if evidence:
|
if evidence:
|
||||||
dm_embed.set_image(url=evidence)
|
dm_embed.set_image(url=evidence)
|
||||||
try:
|
try:
|
||||||
|
@ -109,7 +109,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="Shortmute", description=f"Moderator: {old_interaction.user.mention} ({old_interaction.user.id})\nTarget: {target.mention} ({target.id})\nDuration: `{readable_duration}`\nReason: `{reason}`", color=await self.bot.get_embed_color(None))
|
logging_embed = discord.Embed(title="Shortmute", description=f"Moderator: {old_interaction.user.mention} ({old_interaction.user.id})\nTarget: {target.mention} ({target.id})\nDuration: {readable_duration}\nReason: `{reason}`", color=await self.bot.get_embed_color(None))
|
||||||
if evidence:
|
if evidence:
|
||||||
logging_embed.set_image(url=evidence)
|
logging_embed.set_image(url=evidence)
|
||||||
for channel_id in logging_channels_list:
|
for channel_id in logging_channels_list:
|
||||||
|
|
Loading…
Reference in a new issue