twtb.logic.shared.db.channels_info
#
Module for channels_info
attribute.
Module Contents#
Classes#
Class for channel info into object instead of |
|
Class for storing channel info in database. |
- class ChannelInfo[source]#
Class for channel info into object instead of
dict
.
- exception ChannelNotFoundOrIsInvalidError(channel_name: str)[source]#
Bases:
Exception
Exception raised when you try to get and save channel, which doesn’t exist or is invalid.
- exception ProvidedIdIsNotAChannelError(channel_name: str, actual_type_name: str)[source]#
Bases:
Exception
Exception raised when you try to get and save something, which is not a channel.
- class ChannelInfoInDB(connection: redis.asyncio.Redis[bytes])[source]#
Class for storing channel info in database.
- async get(id: str, *, _optimize: bool = True) → ChannelInfo | None[source]#
Get channel info from database.
- async set(id: str, value: ChannelInfo, *, expire: float | None = None, _optimize: bool = True) → bool[source]#
Set channel info in database.
- async get_and_save(id: str, client: telethon.TelegramClient) → ChannelInfo[source]#
Get channel info from database, and save it if it’s not there.