Changed line length to 108 in black
This commit is contained in:
@@ -36,14 +36,18 @@ class CogConfig(Cog):
|
||||
@option(
|
||||
"category",
|
||||
description=_("description", "commands", "config_set", "options", "category"),
|
||||
description_localizations=in_every_locale("description", "commands", "config_set", "options", "category"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "config_set", "options", "category"
|
||||
),
|
||||
required=True,
|
||||
)
|
||||
@option("channel", description="Text channel for admin notifications", required=True)
|
||||
@option(
|
||||
"timezone",
|
||||
description=_("description", "commands", "config_set", "options", "timezone"),
|
||||
description_localizations=in_every_locale("description", "commands", "config_set", "options", "timezone"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "config_set", "options", "timezone"
|
||||
),
|
||||
autocomplete=basic_autocomplete(autocomplete_timezones),
|
||||
required=True,
|
||||
)
|
||||
@@ -59,7 +63,9 @@ class CogConfig(Cog):
|
||||
try:
|
||||
timezone_parsed: ZoneInfo = ZoneInfo(timezone)
|
||||
except ZoneInfoNotFoundError:
|
||||
await ctx.respond(self.bot._("timezone_invalid", "messages", locale=ctx.locale).format(timezone=timezone))
|
||||
await ctx.respond(
|
||||
self.bot._("timezone_invalid", "messages", locale=ctx.locale).format(timezone=timezone)
|
||||
)
|
||||
return
|
||||
|
||||
await guild.update(
|
||||
@@ -79,7 +85,9 @@ class CogConfig(Cog):
|
||||
@option(
|
||||
"confirm",
|
||||
description=_("description", "commands", "config_reset", "options", "confirm"),
|
||||
description_localizations=in_every_locale("description", "commands", "config_reset", "options", "confirm"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "config_reset", "options", "confirm"
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
async def command_config_reset(self, ctx: ApplicationContext, confirm: bool = False) -> None:
|
||||
|
@@ -11,7 +11,7 @@ from discord import (
|
||||
)
|
||||
from discord.ext.commands import Cog
|
||||
from discord.utils import basic_autocomplete
|
||||
from libbot.i18n import in_every_locale, _
|
||||
from libbot.i18n import _, in_every_locale
|
||||
|
||||
from classes import PycordEvent, PycordEventStage, PycordGuild
|
||||
from classes.pycord_bot import PycordBot
|
||||
|
@@ -5,13 +5,13 @@ from typing import List
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
from bson.errors import InvalidId
|
||||
from discord import ApplicationContext, Cog, option, slash_command, TextChannel, File
|
||||
from discord import ApplicationContext, Cog, File, TextChannel, option, slash_command
|
||||
from discord.utils import basic_autocomplete
|
||||
from libbot.i18n import in_every_locale, _
|
||||
from libbot.i18n import _, in_every_locale
|
||||
|
||||
from classes import PycordEvent, PycordGuild, PycordUser, PycordEventStage
|
||||
from classes import PycordEvent, PycordEventStage, PycordGuild, PycordUser
|
||||
from classes.pycord_bot import PycordBot
|
||||
from modules.utils import autocomplete_active_events, get_unix_timestamp, get_logger
|
||||
from modules.utils import autocomplete_active_events, get_logger, get_unix_timestamp
|
||||
|
||||
logger: Logger = get_logger(__name__)
|
||||
|
||||
|
@@ -4,7 +4,7 @@ from bson.errors import InvalidId
|
||||
from discord import ApplicationContext, Attachment, SlashCommandGroup, option
|
||||
from discord.ext.commands import Cog
|
||||
from discord.utils import basic_autocomplete
|
||||
from libbot.i18n import in_every_locale, _
|
||||
from libbot.i18n import _, in_every_locale
|
||||
|
||||
from classes import PycordEvent, PycordEventStage, PycordGuild
|
||||
from classes.pycord_bot import PycordBot
|
||||
@@ -67,7 +67,9 @@ class CogStage(Cog):
|
||||
if not (await is_event_status_valid(ctx, pycord_event)):
|
||||
return
|
||||
|
||||
processed_media: List[Dict[str, Any]] = [] if media is None else await self.bot.process_attachments([media])
|
||||
processed_media: List[Dict[str, Any]] = (
|
||||
[] if media is None else await self.bot.process_attachments([media])
|
||||
)
|
||||
|
||||
event_stage: PycordEventStage = await self.bot.create_event_stage(
|
||||
event=pycord_event,
|
||||
@@ -146,7 +148,9 @@ class CogStage(Cog):
|
||||
await ctx.respond("Stage sequence out of range.")
|
||||
return
|
||||
|
||||
processed_media: List[Dict[str, Any]] = [] if media is None else await self.bot.process_attachments([media])
|
||||
processed_media: List[Dict[str, Any]] = (
|
||||
[] if media is None else await self.bot.process_attachments([media])
|
||||
)
|
||||
|
||||
if not (question is None and answer is None and media is None and remove_media is False):
|
||||
await event_stage.update(
|
||||
|
@@ -1,7 +1,7 @@
|
||||
from bson.errors import InvalidId
|
||||
from discord import ApplicationContext, Cog, option, slash_command
|
||||
from discord.utils import basic_autocomplete
|
||||
from libbot.i18n import in_every_locale, _
|
||||
from libbot.i18n import _, in_every_locale
|
||||
|
||||
from classes import PycordEvent, PycordGuild, PycordUser
|
||||
from classes.pycord_bot import PycordBot
|
||||
|
@@ -54,7 +54,9 @@ class CogUser(Cog):
|
||||
description="Selected user",
|
||||
)
|
||||
@option("confirm", description="Confirmation of the operation", required=False)
|
||||
async def command_user_delete_channel(self, ctx: ApplicationContext, user: User, confirm: bool = False) -> None:
|
||||
async def command_user_delete_channel(
|
||||
self, ctx: ApplicationContext, user: User, confirm: bool = False
|
||||
) -> None:
|
||||
await ctx.respond("Not implemented.")
|
||||
|
||||
# TODO Introduce i18n
|
||||
@@ -81,7 +83,9 @@ class CogUser(Cog):
|
||||
await pycord_user.jail(self.bot.cache)
|
||||
|
||||
# TODO Introduce i18n
|
||||
await ctx.respond(f"User **{user.display_name}** has been jailed and cannot interact with events anymore.")
|
||||
await ctx.respond(
|
||||
f"User **{user.display_name}** has been jailed and cannot interact with events anymore."
|
||||
)
|
||||
|
||||
# TODO Introduce i18n
|
||||
@command_group.command(
|
||||
@@ -107,7 +111,9 @@ class CogUser(Cog):
|
||||
await pycord_user.unjail(self.bot.cache)
|
||||
|
||||
# TODO Introduce i18n
|
||||
await ctx.respond(f"User **{user.display_name}** has been unjailed and can interact with events again.")
|
||||
await ctx.respond(
|
||||
f"User **{user.display_name}** has been unjailed and can interact with events again."
|
||||
)
|
||||
|
||||
|
||||
def setup(bot: PycordBot) -> None:
|
||||
|
@@ -25,17 +25,29 @@ class CogUtility(Cog):
|
||||
return
|
||||
|
||||
if activity_type == "playing":
|
||||
await self.bot.change_presence(activity=Activity(type=ActivityType.playing, name=activity_message))
|
||||
await self.bot.change_presence(
|
||||
activity=Activity(type=ActivityType.playing, name=activity_message)
|
||||
)
|
||||
elif activity_type == "watching":
|
||||
await self.bot.change_presence(activity=Activity(type=ActivityType.watching, name=activity_message))
|
||||
await self.bot.change_presence(
|
||||
activity=Activity(type=ActivityType.watching, name=activity_message)
|
||||
)
|
||||
elif activity_type == "listening":
|
||||
await self.bot.change_presence(activity=Activity(type=ActivityType.listening, name=activity_message))
|
||||
await self.bot.change_presence(
|
||||
activity=Activity(type=ActivityType.listening, name=activity_message)
|
||||
)
|
||||
elif activity_type == "streaming":
|
||||
await self.bot.change_presence(activity=Activity(type=ActivityType.streaming, name=activity_message))
|
||||
await self.bot.change_presence(
|
||||
activity=Activity(type=ActivityType.streaming, name=activity_message)
|
||||
)
|
||||
elif activity_type == "competing":
|
||||
await self.bot.change_presence(activity=Activity(type=ActivityType.competing, name=activity_message))
|
||||
await self.bot.change_presence(
|
||||
activity=Activity(type=ActivityType.competing, name=activity_message)
|
||||
)
|
||||
elif activity_type == "custom":
|
||||
await self.bot.change_presence(activity=Activity(type=ActivityType.custom, name=activity_message))
|
||||
await self.bot.change_presence(
|
||||
activity=Activity(type=ActivityType.custom, name=activity_message)
|
||||
)
|
||||
else:
|
||||
return
|
||||
|
||||
|
Reference in New Issue
Block a user