Skip to content

Commit

Permalink
Add type hints in responses and tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalk0 committed Nov 5, 2023
1 parent 3e53438 commit 4f63748
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion responses.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
from __future__ import annotations

from typing import TYPE_CHECKING

import discord

from src.latex_render import latex_process

if TYPE_CHECKING:
from bot import ChouetteBot


async def responses(client, channel: discord.abc.Messageable, message: str, username: str) -> str:
async def responses(client: ChouetteBot, channel: discord.abc.Messageable, message: str, username: str) -> str:
# Checks if a message ends with quoi
if ''.join(filter(str.isalpha, message)).lower().endswith("quoi"):
return "**FEUR**"
Expand Down
8 changes: 7 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
from __future__ import annotations

from datetime import time
from typing import TYPE_CHECKING

from discord.ext import tasks

if TYPE_CHECKING:
from bot import ChouetteBot


async def tasks_list(client):
async def tasks_list(client: ChouetteBot):
# Hours for the loop
even_hours = [time(0), time(2), time(4), time(6), time(8), time(10),
time(12), time(14), time(16), time(18), time(20), time(22)]
Expand Down

0 comments on commit 4f63748

Please sign in to comment.