Added a stub for #11 and slightly improved typing
This commit is contained in:
@@ -5,7 +5,7 @@ class EventStageNotFoundError(Exception):
|
|||||||
"""PycordEventStage could not find event with such an ID in the database"""
|
"""PycordEventStage could not find event with such an ID in the database"""
|
||||||
|
|
||||||
def __init__(self, stage_id: str | ObjectId) -> None:
|
def __init__(self, stage_id: str | ObjectId) -> None:
|
||||||
self.stage_id = stage_id
|
self.stage_id: str | ObjectId = stage_id
|
||||||
|
|
||||||
super().__init__(f"Stage with id {self.stage_id} was not found")
|
super().__init__(f"Stage with id {self.stage_id} was not found")
|
||||||
|
|
||||||
|
@@ -2,6 +2,6 @@ class GuildNotFoundError(Exception):
|
|||||||
"""PycordGuild could not find guild with such an ID in the database"""
|
"""PycordGuild could not find guild with such an ID in the database"""
|
||||||
|
|
||||||
def __init__(self, guild_id: int) -> None:
|
def __init__(self, guild_id: int) -> None:
|
||||||
self.guild_id = guild_id
|
self.guild_id: int = guild_id
|
||||||
|
|
||||||
super().__init__(f"Guild with id {self.guild_id} was not found")
|
super().__init__(f"Guild with id {self.guild_id} was not found")
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
from logging import Logger
|
from logging import Logger
|
||||||
|
|
||||||
from discord import Activity, ActivityType, Cog
|
from discord import Activity, ActivityType, Cog, Member
|
||||||
from discord.ext import commands
|
|
||||||
|
|
||||||
from classes.pycord_bot import PycordBot
|
from classes.pycord_bot import PycordBot
|
||||||
from modules.utils import get_logger
|
from modules.utils import get_logger
|
||||||
@@ -13,7 +12,7 @@ class CogUtility(Cog):
|
|||||||
def __init__(self, bot: PycordBot):
|
def __init__(self, bot: PycordBot):
|
||||||
self.bot: PycordBot = bot
|
self.bot: PycordBot = bot
|
||||||
|
|
||||||
@commands.Cog.listener()
|
@Cog.listener()
|
||||||
async def on_ready(self) -> None:
|
async def on_ready(self) -> None:
|
||||||
"""Listener for the event when bot connects to Discord and becomes "ready"."""
|
"""Listener for the event when bot connects to Discord and becomes "ready"."""
|
||||||
logger.info("Logged in as %s", self.bot.user)
|
logger.info("Logged in as %s", self.bot.user)
|
||||||
@@ -42,6 +41,11 @@ class CogUtility(Cog):
|
|||||||
|
|
||||||
logger.info("Set activity type to %s with message %s", activity_type, activity_message)
|
logger.info("Set activity type to %s with message %s", activity_type, activity_message)
|
||||||
|
|
||||||
|
# TODO Implement #11
|
||||||
|
@Cog.listener()
|
||||||
|
async def on_member_join(self, member: Member) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def setup(bot: PycordBot) -> None:
|
def setup(bot: PycordBot) -> None:
|
||||||
bot.add_cog(CogUtility(bot))
|
bot.add_cog(CogUtility(bot))
|
||||||
|
Reference in New Issue
Block a user