mirror of
https://github.com/kurbezz/discord-bot.git
synced 2025-12-06 15:15:37 +01:00
Update
This commit is contained in:
12
src/domain/auth.py
Normal file
12
src/domain/auth.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from enum import StrEnum
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class OAuthProvider(StrEnum):
|
||||
TWITCH = "twitch"
|
||||
|
||||
|
||||
class OAuthData(BaseModel):
|
||||
id: str
|
||||
email: str | None
|
||||
17
src/domain/users.py
Normal file
17
src/domain/users.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
from domain.auth import OAuthProvider, OAuthData
|
||||
|
||||
|
||||
class User(BaseModel):
|
||||
id: str
|
||||
|
||||
oauths: dict[OAuthProvider, OAuthData]
|
||||
|
||||
is_admin: bool
|
||||
|
||||
|
||||
class CreateUser(BaseModel):
|
||||
oauths: dict[OAuthProvider, OAuthData]
|
||||
|
||||
is_admin: bool = False
|
||||
Reference in New Issue
Block a user