Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
z44d committed Sep 20, 2024
1 parent b9303bc commit 40c11aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tgram/storage/redis_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ class RedisStorage(StorageBase):
def __init__(self, bot: "tgram.TgBot", client=None) -> None:
super().__init__(bot, "redis", client)

self._bot_id = bot.me.id

async def set(self, key: str, value: Any) -> bool:
return await self.client.hset("tgram-" + str(self.bot.me.id), key, value)
return await self.client.hset("tgram-" + str(self._bot_id), key, value)

async def get(self, key: str) -> Any:
return await self.client.hget("tgram-" + str(self.bot.me.id), key)
return await self.client.hget("tgram-" + str(self._bot_id), key)

async def add_chat(self, chat: "tgram.types.Chat") -> bool:
chat_json = chat.json
Expand Down

0 comments on commit 40c11aa

Please sign in to comment.