Skip to content

Commit

Permalink
Fixed various typing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
49Indium committed Mar 7, 2024
1 parent 0c38624 commit 760102e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]

4 changes: 3 additions & 1 deletion uqcsbot/error_handler.py
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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`"
Expand Down
2 changes: 1 addition & 1 deletion uqcsbot/uptime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions uqcsbot/working_on.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(
Expand Down

0 comments on commit 760102e

Please sign in to comment.