diff --git a/modules/moderation.py b/modules/moderation.py index 9d03feb..c0c9962 100644 --- a/modules/moderation.py +++ b/modules/moderation.py @@ -281,25 +281,26 @@ async def _infraction_editing( logging.error(f'[Moderation] _infraction_duration: {e}') error = '' - try: - member = await interaction.guild.fetch_member(doc['user']) - if duration: - await member.send(tools.format_pundm('duration-update', reason, details=(doc['type'], expireStr))) + if doc['type'] != 'note': + try: + member = await interaction.guild.fetch_member(doc['user']) + if duration: + await member.send(tools.format_pundm('duration-update', reason, details=(doc['type'], expireStr))) - else: - await member.send( - tools.format_pundm( - 'reason-update', - reason, - details=( - doc['type'], - f'', - ), + else: + await member.send( + tools.format_pundm( + 'reason-update', + reason, + details=( + doc['type'], + f'', + ), + ) ) - ) - except (discord.NotFound, discord.Forbidden, AttributeError): - error = '. I was not able to DM them about this action' + except (discord.NotFound, discord.Forbidden, AttributeError): + error = '. I was not able to DM them about this action' await interaction.followup.send( f'{config.greenTick} The {doc["type"]} {"duration" if duration else "reason"} has been successfully updated for {user} ({user.id}){error}',