Fix parsing phone and add redis storage for FSM in telegram bot
This commit is contained in:
16
birthday_pool_bot/telegram_bot/storage/settings.py
Normal file
16
birthday_pool_bot/telegram_bot/storage/settings.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from typing import Literal
|
||||
|
||||
|
||||
class StorageSettings(BaseModel):
|
||||
type: StorageTypeEnum
|
||||
|
||||
|
||||
class MemoryStorageSettings(StorageSettings):
|
||||
type: Literal[StorageType.MEMORY.value] = StorageTypeEnum.MEMORY.value
|
||||
|
||||
|
||||
class RedisStorageSettings(StorageSettings):
|
||||
type: Litreal[StorageType.REDIS.value] = StorageTypeEnum.REDIS.value
|
||||
host: str = "localhost"
|
||||
port: int = 6379
|
||||
database: int = 0
|
||||
Reference in New Issue
Block a user