Prevent modlog action prompt from opening multiple cases, closes #140
This commit is contained in:
parent
9188b13695
commit
f906886512
1 changed files with 30 additions and 21 deletions
|
@ -799,6 +799,15 @@ class Jarvis(Client):
|
||||||
note = Note(
|
note = Note(
|
||||||
admin=context.author.id, content="Moderation case opened via message"
|
admin=context.author.id, content="Moderation case opened via message"
|
||||||
)
|
)
|
||||||
|
modlog = await Modlog.find_one(
|
||||||
|
q(user=user.id, guild=context.guild.id, open=True)
|
||||||
|
)
|
||||||
|
if modlog:
|
||||||
|
self.logger.debug("User already has active case in guild")
|
||||||
|
await context.send(
|
||||||
|
f"User already has open case: {modlog.nanoid}", ephemeral=True
|
||||||
|
)
|
||||||
|
else:
|
||||||
modlog = Modlog(
|
modlog = Modlog(
|
||||||
user=user.id,
|
user=user.id,
|
||||||
admin=context.author.id,
|
admin=context.author.id,
|
||||||
|
|
Loading…
Add table
Reference in a new issue