lily_website

📜 Sender Key

⬅️ Back 🏠 Docs Root

This module defines the SenderKeys class, which provides static methods for generating standardized Redis keys used by the SenderManager. These keys are crucial for organizing and accessing UI-related coordinates and message data stored in Redis.

SenderKeys Class

The SenderKeys class encapsulates the logic for constructing Redis keys, ensuring consistency across the application.

get_user_coords_key Method

@staticmethod
def get_user_coords_key(user_id: int | str) -> str:

Generates a Redis key for storing UI coordinates specific to a particular user in a private chat.

Returns: str: A Redis key in the format sender:user:{user_id}.

Redis Type: HASH Example: sender:user:123456789

get_channel_coords_key Method

@staticmethod
def get_channel_coords_key(session_id: str) -> str:

Generates a Redis key for storing UI coordinates specific to a channel or group, identified by a session ID.

Returns: str: A Redis key in the format sender:channel:{session_id}.

Redis Type: HASH Example: sender:channel:booking_feed_1