diff --git a/discordbot.py b/discordbot.py index e66840fb..d3681c1b 100644 --- a/discordbot.py +++ b/discordbot.py @@ -21,6 +21,7 @@ import sqlalchemy.exc import coloredlogs import errors import math +import enum logging.getLogger().disabled = True logger = logging.getLogger(__name__) @@ -137,7 +138,7 @@ else: sentry = Succ() -class Video: +class OldVideo: """A video to be played in the bot.""" def __init__(self, url: str = None, file: str = None, info: dict = None, enqueuer: discord.Member = None): @@ -217,6 +218,92 @@ class Video: raise errors.FileNotDownloadedError() self.audio_source = discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(f"{self.file}", **ffmpeg_settings)) + def suggestion(self) -> typing.Optional[str]: + """The suggested video to add to the queue after this one.""" + raise NotImplementedError() + + +class Video: + def __init__(self, enqueuer: typing.Optional[discord.Member]=None): + self.is_ready = False + self.name = None + self.enqueuer = enqueuer + self.audio_source = None + + def __str__(self): + return self.name + + def plain_text(self): + """Title without formatting to be printed on terminals.""" + return self.name + + def database_text(self): + """The text to be stored in the database for the stats. Usually the same as plain_text().""" + return self.name + + def __repr__(self): + return f"