This repository has been archived on 2024-08-07. You can view files and clone it, but cannot push or open issues or pull requests.
2024-08-05 12:40:52 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
#############################
|
|
|
|
# Types for DataBase module #
|
|
|
|
#############################
|
|
|
|
|
|
|
|
# Imports
|
|
|
|
from enum import Enum
|
|
|
|
|
|
|
|
|
|
|
|
class CacheDBTypes(Enum):
|
|
|
|
"""
|
|
|
|
Types of CacheDB
|
|
|
|
"""
|
2024-08-05 13:43:00 +00:00
|
|
|
|
|
|
|
PythonPKL = "python"
|
2024-08-05 12:40:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
class UserStates(Enum):
|
|
|
|
"""
|
|
|
|
Types of User status
|
|
|
|
"""
|
2024-08-05 13:43:00 +00:00
|
|
|
|
2024-08-05 12:40:52 +00:00
|
|
|
...
|
2024-08-05 13:43:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
class User(object):
|
|
|
|
"""
|
|
|
|
User class
|
|
|
|
"""
|
|
|
|
|
|
|
|
tg_id: int
|
|
|
|
name: str
|
|
|
|
state: UserStates | None = None
|
|
|
|
auth: bool = False
|
|
|
|
|
|
|
|
def __init__(
|
|
|
|
self, tg_id: int, name: str, state: UserStates | None = None, auth: bool = False
|
|
|
|
) -> None:
|
|
|
|
self.tg_id = tg_id
|
|
|
|
self.name = name
|
|
|
|
self.state = state
|
|
|
|
self.auth = auth
|
|
|
|
|
|
|
|
@property
|
|
|
|
def dict(self):
|
|
|
|
return {
|
|
|
|
"tg_id": self.tg_id,
|
|
|
|
"name": self.name,
|
|
|
|
"state": self.state,
|
|
|
|
"auth": self.auth,
|
|
|
|
}
|