mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-05 17:02:32 -05:00
Reformat with Black 22.1.0
This commit is contained in:
@@ -182,7 +182,6 @@ class PlaylistCompat23:
|
||||
tracks: Optional[List[MutableMapping]] = None,
|
||||
guild: Union[discord.Guild, int, None] = None,
|
||||
):
|
||||
|
||||
self.bot = bot
|
||||
self.guild = guild
|
||||
self.scope = standardize_scope(scope)
|
||||
|
||||
@@ -192,7 +192,6 @@ class ScopeParser(commands.Converter):
|
||||
async def convert(
|
||||
self, ctx: commands.Context, argument: str
|
||||
) -> Tuple[Optional[str], discord.User, Optional[discord.Guild], bool]:
|
||||
|
||||
target_scope: Optional[str] = None
|
||||
target_user: Optional[Union[discord.Member, discord.User]] = None
|
||||
target_guild: Optional[discord.Guild] = None
|
||||
@@ -302,7 +301,6 @@ class ComplexScopeParser(commands.Converter):
|
||||
Optional[discord.Guild],
|
||||
bool,
|
||||
]:
|
||||
|
||||
target_scope: Optional[str] = None
|
||||
target_user: Optional[Union[discord.Member, discord.User]] = None
|
||||
target_guild: Optional[discord.Guild] = None
|
||||
|
||||
@@ -244,7 +244,7 @@ class EqualizerCommands(MixinMeta, metaclass=CompositeMetaClass):
|
||||
eq_name_msg = await self.bot.wait_for(
|
||||
"message",
|
||||
timeout=15.0,
|
||||
check=MessagePredicate.regex(fr"^(?!{re.escape(ctx.prefix)})", ctx),
|
||||
check=MessagePredicate.regex(rf"^(?!{re.escape(ctx.prefix)})", ctx),
|
||||
)
|
||||
eq_preset = eq_name_msg.content.split(" ")[0].strip('"').lower()
|
||||
except asyncio.TimeoutError:
|
||||
|
||||
@@ -224,7 +224,6 @@ class PlaylistCommands(MixinMeta, metaclass=CompositeMetaClass):
|
||||
*,
|
||||
scope_data: ComplexScopeParser = None,
|
||||
):
|
||||
|
||||
"""Copy a playlist from one scope to another.
|
||||
|
||||
**Usage**:
|
||||
@@ -962,7 +961,6 @@ class PlaylistCommands(MixinMeta, metaclass=CompositeMetaClass):
|
||||
scope, author, guild, specified_user = scope_data
|
||||
async with ctx.typing():
|
||||
if scope is None:
|
||||
|
||||
global_matches = await get_all_playlist(
|
||||
scope=PlaylistScope.GLOBAL.value,
|
||||
bot=self.bot,
|
||||
|
||||
@@ -31,7 +31,6 @@ class RedEvents(MixinMeta, metaclass=CompositeMetaClass):
|
||||
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
|
||||
user_id: int,
|
||||
):
|
||||
|
||||
await self.cog_ready_event.wait()
|
||||
|
||||
if requester in ("discord_deleted_user", "owner"):
|
||||
|
||||
@@ -167,7 +167,6 @@ class FormattingUtilities(MixinMeta, metaclass=CompositeMetaClass):
|
||||
ctx, title=_("This track is not allowed in this server.")
|
||||
)
|
||||
elif guild_data["maxlength"] > 0:
|
||||
|
||||
if self.is_track_length_allowed(search_choice, guild_data["maxlength"]):
|
||||
search_choice.extras.update(
|
||||
{
|
||||
|
||||
@@ -258,7 +258,7 @@ class MiscellaneousUtilities(MixinMeta, metaclass=CompositeMetaClass):
|
||||
return msg.format(d, h, m, s)
|
||||
|
||||
def format_time(self, time: int) -> str:
|
||||
""" Formats the given time into DD:HH:MM:SS """
|
||||
"""Formats the given time into DD:HH:MM:SS"""
|
||||
seconds = time / 1000
|
||||
days, seconds = divmod(seconds, 24 * 60 * 60)
|
||||
hours, seconds = divmod(seconds, 60 * 60)
|
||||
|
||||
@@ -11,7 +11,7 @@ from ..cog_utils import CompositeMetaClass
|
||||
|
||||
log = getLogger("red.cogs.Audio.cog.Utilities.Parsing")
|
||||
|
||||
STREAM_TITLE: Final[re.Pattern] = re.compile(br"StreamTitle='([^']*)';")
|
||||
STREAM_TITLE: Final[re.Pattern] = re.compile(rb"StreamTitle='([^']*)';")
|
||||
|
||||
|
||||
class ParsingUtilities(MixinMeta, metaclass=CompositeMetaClass):
|
||||
|
||||
@@ -676,7 +676,6 @@ class PlaylistUtilities(MixinMeta, metaclass=CompositeMetaClass):
|
||||
def humanize_scope(
|
||||
self, scope: str, ctx: Union[discord.Guild, discord.abc.User, str] = None, the: bool = None
|
||||
) -> Optional[str]:
|
||||
|
||||
if scope == PlaylistScope.GLOBAL.value:
|
||||
return _("the Global") if the else _("Global")
|
||||
elif scope == PlaylistScope.GUILD.value:
|
||||
|
||||
Reference in New Issue
Block a user