awaitinteraction.response.send_message(content="You've provided both the `evidence_image` and the `evidence_link` arguments! Please only use one or the other.")
return
elifevidence_link:
evidence=evidence_link
elifevidence_image:
evidence=str(evidence_image)
ifduration==1orduration==-1:
readable_duration=f"{duration} minute"
passed_info.update({
"readable_duration":readable_duration
})
else:
readable_duration=f"{duration} minutes"
passed_info.update({
"readable_duration":readable_duration
})
ifduration>30:
awaitinteraction.response(content=f"{readable_duration} is longer than the 30 minutes you are allowed to shortmute users for.",ephemeral=True)
return
elifduration<1:
awaitinteraction.response(content=f"Please shortmute the user for longer than {readable_duration}! The maximum duration is 30 minutes.",ephemeral=True)
return
embed=discord.Embed(title="Are you sure?",description=f"Moderator: {interaction.user.mention}\nTarget: {target.mention}\nDuration: `{readable_duration}`\nReason: `{reason}`",color=awaitself.bot.get_embed_color(None))
awaittarget.timeout(until=timedelta,reason=f"User shortmuted for {readable_duration} by {old_interaction.user.name} ({old_interaction.user.id}) for: {reason}")
awaitinteraction.response.send_message(content=f"{target.mention} shortmuted for {readable_duration} by {old_interaction.user.mention} for: `{reason}`")
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=awaitself.bot.get_embed_color(None))
ifevidence:
dm_embed.set_image(evidence)
try:
awaittarget.send(embed=dm_embed)
exceptdiscord.HTTPExceptionaserror:
awaitold_message.edit(content="Could not message the target, user most likely has Direct Messages disabled.")