Store Coder
- class telegram_bot_discussion.ext.coder.store_coder.KeyValueStorageInterface[source]
Bases:
ABCKeyValueStorageInterface is interface for external storage where custom values of Params are stored.
- class telegram_bot_discussion.ext.coder.store_coder.StoreCoder(secret, db)[source]
Bases:
CoderInterfaceStoreCoder StoreCoder serializes data and saves its value in an external storage with unique primary key. The primary key is stored in the Button. For deserialization, the data is got from the external storage by primary key.
So there are no any limits for callback query data (long strings, complex multi params, redundant big json and etc.).
- Parameters:
secret (str)
-
secret:
str Secret string is used for making digital signature of data.
- Type:
str
-
db:
KeyValueStorageInterface external storage where custom values of Params are stored.
- Type:
- get_signature(chat_id, serialized_data, sender_id)[source]
- Return type:
str- Parameters:
chat_id (int)
serialized_data (str)
sender_id (int)
- sign(signature, serialized_data)[source]
- Return type:
str- Parameters:
signature (str)
serialized_data (str)