mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-25 06:27:03 +01:00
Enforce more keys to expire
This commit is contained in:
parent
4b254bbc54
commit
ae05ac766d
@ -124,10 +124,11 @@ class RedisQueue:
|
|||||||
member = self.bot.get_guild(int(params["guild_id"])).get_member(int(params["user_id"]))
|
member = self.bot.get_guild(int(params["guild_id"])).get_member(int(params["user_id"]))
|
||||||
if not member:
|
if not member:
|
||||||
await self.connection.set(key, "")
|
await self.connection.set(key, "")
|
||||||
|
await self.enforce_expiring_key(key)
|
||||||
return
|
return
|
||||||
user = get_formatted_user(member)
|
user = get_formatted_user(member)
|
||||||
await self.enforce_expiring_key(key)
|
|
||||||
await self.connection.set(key, json.dumps(user, separators=(',', ':')))
|
await self.connection.set(key, json.dumps(user, separators=(',', ':')))
|
||||||
|
await self.enforce_expiring_key(key)
|
||||||
|
|
||||||
async def on_get_guild_member_named(self, key, params):
|
async def on_get_guild_member_named(self, key, params):
|
||||||
guild = self.bot.get_guild(int(params["guild_id"]))
|
guild = self.bot.get_guild(int(params["guild_id"]))
|
||||||
@ -148,6 +149,7 @@ class RedisQueue:
|
|||||||
get_guild_member_param = {"guild_id": guild.id, "user_id": result_id}
|
get_guild_member_param = {"guild_id": guild.id, "user_id": result_id}
|
||||||
await self.on_get_guild_member(get_guild_member_key, get_guild_member_param)
|
await self.on_get_guild_member(get_guild_member_key, get_guild_member_param)
|
||||||
await self.connection.set(key, result)
|
await self.connection.set(key, result)
|
||||||
|
await self.enforce_expiring_key(key)
|
||||||
|
|
||||||
async def on_list_guild_members(self, key, params):
|
async def on_list_guild_members(self, key, params):
|
||||||
guild = self.bot.get_guild(int(params["guild_id"]))
|
guild = self.bot.get_guild(int(params["guild_id"]))
|
||||||
@ -185,6 +187,7 @@ class RedisQueue:
|
|||||||
guild = self.bot.get_guild(int(params["guild_id"]))
|
guild = self.bot.get_guild(int(params["guild_id"]))
|
||||||
if not guild:
|
if not guild:
|
||||||
await self.connection.set(key, "")
|
await self.connection.set(key, "")
|
||||||
|
await self.enforce_expiring_key(key)
|
||||||
return
|
return
|
||||||
if guild.me.guild_permissions.manage_webhooks:
|
if guild.me.guild_permissions.manage_webhooks:
|
||||||
try:
|
try:
|
||||||
@ -213,6 +216,7 @@ class RedisQueue:
|
|||||||
user = self.bot.get_user(int(params["user_id"]))
|
user = self.bot.get_user(int(params["user_id"]))
|
||||||
if not user:
|
if not user:
|
||||||
await self.connection.set(key, "")
|
await self.connection.set(key, "")
|
||||||
|
await self.enforce_expiring_key(key)
|
||||||
return
|
return
|
||||||
user_formatted = {
|
user_formatted = {
|
||||||
"id": user.id,
|
"id": user.id,
|
||||||
@ -221,4 +225,5 @@ class RedisQueue:
|
|||||||
"avatar": user.avatar,
|
"avatar": user.avatar,
|
||||||
"bot": user.bot
|
"bot": user.bot
|
||||||
}
|
}
|
||||||
await self.connection.set(key, json.dumps(user_formatted, separators=(',', ':')))
|
await self.connection.set(key, json.dumps(user_formatted, separators=(',', ':')))
|
||||||
|
await self.enforce_expiring_key(key)
|
Loading…
Reference in New Issue
Block a user