Set expirations on interactive modlog keys

This commit is contained in:
Zeva Rose 2022-05-03 01:36:32 -06:00
parent e7c3b664db
commit 692200ea47

View file

@ -1,5 +1,6 @@
"""Cog wrapper for command caching."""
import logging
from datetime import timedelta
from jarvis_core.db import q
from jarvis_core.db.models import Ban, Kick, Mute, Setting, Warning
@ -102,6 +103,8 @@ class ModcaseCog(Cog):
)
]
message = await channel.send(embed=embed, components=components)
await self.bot.redis.set(lookup_key, f"{name.lower()}|{action.id}")
await self.bot.redis.set(f"msg|{message.id}", user.id)
await self.bot.redis.set(
lookup_key, f"{name.lower()}|{action.id}", ex=timedelta(days=7)
)
await self.bot.redis.set(f"msg|{message.id}", user.id, ex=timedelta(days=7))