Fixed formatting
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
from logging import Logger
|
from logging import Logger
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from discord import User, Guild
|
from discord import Guild, User
|
||||||
from libbot.cache.classes import CacheMemcached, CacheRedis
|
from libbot.cache.classes import CacheMemcached, CacheRedis
|
||||||
from libbot.cache.manager import create_cache_client
|
from libbot.cache.manager import create_cache_client
|
||||||
from libbot.pycord.classes import PycordBot as LibPycordBot
|
from libbot.pycord.classes import PycordBot as LibPycordBot
|
||||||
|
|
||||||
from classes import PycordUser, PycordGuild
|
from classes import PycordGuild, PycordUser
|
||||||
from modules.logging_utils import get_logger
|
from modules.logging_utils import get_logger
|
||||||
|
|
||||||
logger: Logger = get_logger(__name__)
|
logger: Logger = get_logger(__name__)
|
||||||
|
@@ -28,7 +28,7 @@ class PycordGuild:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
async def from_id(
|
async def from_id(
|
||||||
cls, guild_id: int, allow_creation: bool = True, cache: Optional[Cache] = None
|
cls, guild_id: int, allow_creation: bool = True, cache: Optional[Cache] = None
|
||||||
) -> "PycordGuild":
|
) -> "PycordGuild":
|
||||||
"""Find guild in database and create new record if guild does not exist.
|
"""Find guild in database and create new record if guild does not exist.
|
||||||
|
|
||||||
|
@@ -1,4 +1,10 @@
|
|||||||
from discord import SlashCommandGroup, option, CategoryChannel, ApplicationContext, TextChannel
|
from discord import (
|
||||||
|
ApplicationContext,
|
||||||
|
CategoryChannel,
|
||||||
|
SlashCommandGroup,
|
||||||
|
TextChannel,
|
||||||
|
option,
|
||||||
|
)
|
||||||
from discord.ext.commands import Cog
|
from discord.ext.commands import Cog
|
||||||
|
|
||||||
from classes import PycordGuild
|
from classes import PycordGuild
|
||||||
@@ -22,7 +28,7 @@ class Config(Cog):
|
|||||||
@option("category", description="Category where channels for each user will be created", required=True)
|
@option("category", description="Category where channels for each user will be created", required=True)
|
||||||
@option("channel", description="Text channel for admin notifications", required=True)
|
@option("channel", description="Text channel for admin notifications", required=True)
|
||||||
async def command_config_set(
|
async def command_config_set(
|
||||||
self, ctx: ApplicationContext, category: CategoryChannel, channel: TextChannel
|
self, ctx: ApplicationContext, category: CategoryChannel, channel: TextChannel
|
||||||
) -> None:
|
) -> None:
|
||||||
guild: PycordGuild = await self.bot.find_guild(ctx.guild.id)
|
guild: PycordGuild = await self.bot.find_guild(ctx.guild.id)
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
from discord import SlashCommandGroup, option, ApplicationContext, Attachment
|
from discord import ApplicationContext, Attachment, SlashCommandGroup, option
|
||||||
from discord.ext.commands import Cog
|
from discord.ext.commands import Cog
|
||||||
|
|
||||||
from classes import PycordGuild
|
from classes import PycordGuild
|
||||||
@@ -24,12 +24,12 @@ class Event(Cog):
|
|||||||
@option("finish", description="Date when the event finishes (DD.MM.YYYY)", required=True)
|
@option("finish", description="Date when the event finishes (DD.MM.YYYY)", required=True)
|
||||||
@option("thumbnail", description="Thumbnail of the event", required=False)
|
@option("thumbnail", description="Thumbnail of the event", required=False)
|
||||||
async def command_event_create(
|
async def command_event_create(
|
||||||
self,
|
self,
|
||||||
ctx: ApplicationContext,
|
ctx: ApplicationContext,
|
||||||
name: str,
|
name: str,
|
||||||
start: str,
|
start: str,
|
||||||
finish: str,
|
finish: str,
|
||||||
thumbnail: Attachment = None,
|
thumbnail: Attachment = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
guild: PycordGuild = await self.bot.find_guild(ctx.guild.id)
|
guild: PycordGuild = await self.bot.find_guild(ctx.guild.id)
|
||||||
|
|
||||||
@@ -46,13 +46,13 @@ class Event(Cog):
|
|||||||
@option("finish", description="Date when the event finishes (DD.MM.YYYY)", required=False)
|
@option("finish", description="Date when the event finishes (DD.MM.YYYY)", required=False)
|
||||||
@option("thumbnail", description="Thumbnail of the event", required=False)
|
@option("thumbnail", description="Thumbnail of the event", required=False)
|
||||||
async def command_event_edit(
|
async def command_event_edit(
|
||||||
self,
|
self,
|
||||||
ctx: ApplicationContext,
|
ctx: ApplicationContext,
|
||||||
event: str,
|
event: str,
|
||||||
name: str,
|
name: str,
|
||||||
start: str,
|
start: str,
|
||||||
finish: str,
|
finish: str,
|
||||||
thumbnail: Attachment = None,
|
thumbnail: Attachment = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
guild: PycordGuild = await self.bot.find_guild(ctx.guild.id)
|
guild: PycordGuild = await self.bot.find_guild(ctx.guild.id)
|
||||||
|
|
||||||
@@ -65,9 +65,9 @@ class Event(Cog):
|
|||||||
)
|
)
|
||||||
@option("name", description="Name of the event", required=True)
|
@option("name", description="Name of the event", required=True)
|
||||||
async def command_event_cancel(
|
async def command_event_cancel(
|
||||||
self,
|
self,
|
||||||
ctx: ApplicationContext,
|
ctx: ApplicationContext,
|
||||||
name: str,
|
name: str,
|
||||||
) -> None:
|
) -> None:
|
||||||
guild: PycordGuild = await self.bot.find_guild(ctx.guild.id)
|
guild: PycordGuild = await self.bot.find_guild(ctx.guild.id)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user