4
1
Fork 1
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.
qBitDownload-Bot/tubot/db/types.py

53 lines
874 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
#############################
# Types for DataBase module #
#############################
# Imports
from enum import Enum
class CacheDBTypes(Enum):
"""
Types of CacheDB
"""
PythonPKL = "python"
class UserStates(Enum):
"""
Types of User status
"""
...
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,
}