Skip to content

Commit

Permalink
start work on static typechecks, based after 'channels' is removed
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewj-brown committed May 7, 2023
1 parent dc2aa2e commit 1670083
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mypy]
plugins = sqlmypy
10 changes: 10 additions & 0 deletions uqcsbot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,23 @@ async def setup_hook(self):
await self.web_server()

async def admin_alert(
<<<<<<< Updated upstream
self,
title: str,
colour: discord.Colour,
description: str = None,
footer: str = None,
fields: List[tuple] = None,
fields_inline: bool = True
=======
self,
title: str,
colour: discord.Colour,
description: str | None = None,
footer: str | None = None,
fields: List[tuple] | None = None,
fields_inline: bool = True,
>>>>>>> Stashed changes
):
""" Sends an alert to the admin channel for logging. """
admin_channel = discord.utils.get(self.uqcs_server.channels, name=ADMIN_ALERTS)
Expand Down
15 changes: 15 additions & 0 deletions uqcsbot/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,13 @@ def encode_text(cls, text: str) -> str:
return text.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")

@classmethod
<<<<<<< Updated upstream
def from_cal_event(cls, cal_event, source: str = "UQCS", recurrence_dt: datetime = None):
=======
def from_cal_event(
cls, cal_event, source: str = "UQCS", recurrence_dt: datetime | None = None
):
>>>>>>> Stashed changes
"""
Converts an ical event to an Event
Expand Down Expand Up @@ -212,7 +218,16 @@ def _handle_calendar(self, calendar) -> List[Event]:

return events

<<<<<<< Updated upstream
async def send_events(self, channel: discord.abc.Messageable, interaction: discord.Interaction = None, *args):
=======
async def send_events(
self,
channel: discord.abc.Messageable,
interaction: discord.Interaction | None = None,
*args,
):
>>>>>>> Stashed changes
current_time = self._get_current_time()
event_filter = EventFilter.from_argument(args)
events = []
Expand Down

0 comments on commit 1670083

Please sign in to comment.