Initial commit
This commit is contained in:
39
discord-bot/src/models.py
Normal file
39
discord-bot/src/models.py
Normal file
@@ -0,0 +1,39 @@
|
||||
from enum import Enum
|
||||
from typing import List, Optional
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class BotStatus(str, Enum):
|
||||
PLAYING = "Playing"
|
||||
IDLE = "Idle"
|
||||
|
||||
|
||||
class MessageType(str, Enum):
|
||||
PLAYBACK_INFORMATION = "PLAYBACK_INFORMATION"
|
||||
ERROR = "ERROR"
|
||||
MESSAGE = "MESSAGE"
|
||||
|
||||
|
||||
class SongItem(BaseModel):
|
||||
filename: str
|
||||
duration: int
|
||||
|
||||
|
||||
class SongQueueStatus(BaseModel):
|
||||
song_file_list: list[SongItem]
|
||||
position: int
|
||||
|
||||
|
||||
class PlaybackInformation(BaseModel):
|
||||
file_name: str
|
||||
current_position: float
|
||||
duration: float
|
||||
|
||||
|
||||
class BotResponse(BaseModel):
|
||||
message_type: MessageType
|
||||
status: BotStatus
|
||||
error: Optional[str] = None
|
||||
message: Optional[str] = None
|
||||
playback_information: Optional[PlaybackInformation] = None
|
||||
song_queue: Optional[SongQueueStatus] = None
|
||||
Reference in New Issue
Block a user