Fix parsing phone and add redis storage for FSM in telegram bot

This commit is contained in:
2026-01-17 20:03:33 +03:00
parent a065c6b7be
commit 05aa637b0f
14 changed files with 159 additions and 27 deletions

View File

@@ -0,0 +1,20 @@
from typing import Literal
from pydantic import BaseModel
from .enums import StorageTypeEnum
class StorageSettings(BaseModel):
type: StorageTypeEnum
class MemoryStorageSettings(StorageSettings):
type: Literal[StorageTypeEnum.MEMORY.value] = StorageTypeEnum.MEMORY.value
class RedisStorageSettings(StorageSettings):
type: Literal[StorageTypeEnum.REDIS.value] = StorageTypeEnum.REDIS.value
host: str = "localhost"
port: int = 6379
database: int = 0