diff --git a/pyproject.toml b/pyproject.toml index b6c2175..f954857 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,15 +43,12 @@ build-backend = "poetry.core.masonry.api" strict = ["**"] exclude = [ "**/bot.py", - "**/error_handler.py", "**/events.py", "**/gaming.py", "**/member_counter.py", "**/remindme.py", "**/snailrace.py", "**/starboard.py", - "**/uptime.py", - "**/working_on.py", "**/utils/snailrace_utils.py", ] diff --git a/uqcsbot/error_handler.py b/uqcsbot/error_handler.py index 98a55bc..e6a1ec0 100644 --- a/uqcsbot/error_handler.py +++ b/uqcsbot/error_handler.py @@ -1,6 +1,8 @@ from discord.ext import commands from discord.ext.commands.errors import MissingRequiredArgument import logging +from typing import Any +from uqcsbot.bot import UQCSBot """ TODO: this is bundled with advent.py and should be removed. @@ -9,7 +11,7 @@ class ErrorHandler(commands.Cog): @commands.Cog.listener() - async def on_command_error(self, ctx: commands.Context, err): + async def on_command_error(self, ctx: commands.Context[UQCSBot], err: Any): if isinstance(err, MissingRequiredArgument): await ctx.send( "Missing required argument. For further information refer to `!help`" diff --git a/uqcsbot/uptime.py b/uqcsbot/uptime.py index ad38d7c..f1caaa2 100644 --- a/uqcsbot/uptime.py +++ b/uqcsbot/uptime.py @@ -22,7 +22,7 @@ async def on_ready(self): self.bot.uqcs_server.channels, name=self.CHANNEL_NAME ) - if channel is not None: + if isinstance(channel, discord.TextChannel): if random.randint(1, 100) == 1: await channel.send("Oopsie, I webooted uwu >_<") else: diff --git a/uqcsbot/working_on.py b/uqcsbot/working_on.py index e3af632..8ebfea1 100644 --- a/uqcsbot/working_on.py +++ b/uqcsbot/working_on.py @@ -19,7 +19,7 @@ def __init__(self, bot: UQCSBot): async def workingon(self): """5pm ping for 2 lucky server members to share what they have been working on.""" members = list(self.bot.get_all_members()) - message = [] + message: list[str] = [] while len(message) < 2: chosen = choice(members) @@ -33,7 +33,7 @@ async def workingon(self): self.bot.uqcs_server.channels, name=GENERAL_CHANNEL ) - if general_channel is not None: + if isinstance(general_channel, discord.TextChannel): await general_channel.send( "\n".join(message), allowed_mentions=discord.AllowedMentions(