From 07906aaea137adf3b3477fa773fbeaad520e5b7f Mon Sep 17 00:00:00 2001 From: imcompiling Date: Thu, 1 Aug 2024 21:46:16 -0400 Subject: [PATCH] Spell check and ruff fixes. --- .vscode/settings.json | 10 ++++++++++ utils.py | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f1b7934 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "cSpell.words": [ + "aiofiles", + "blurple", + "CLANLEADER", + "Dakiny", + "DISCORDMANAGER", + "highcouncil" + ] +} \ No newline at end of file diff --git a/utils.py b/utils.py index e02ada8..ce4ddd9 100644 --- a/utils.py +++ b/utils.py @@ -137,7 +137,7 @@ def build_votes_str(config: DakinyConfig, guild: nextcord.Guild) -> str: Creates a string that contains all nominees and their votes to be sent as a discord message. Args: - config (DakinyConfig): Daking config object + config (DakinyConfig): Dakiny config object guild (nextcord.Guild): The guild object. Used to get display names for sorting. Returns: @@ -173,7 +173,7 @@ def build_highcouncil_votes_str(config: DakinyConfig, guild: nextcord.Guild) -> Creates a string that contains all high council nominees and their votes to be sent as a discord message. Args: - config (DakinyConfig): Daking config object + config (DakinyConfig): Dakiny config object guild (nextcord.Guild): The guild object. Used to get display names for sorting. Returns: @@ -374,7 +374,7 @@ def get_allowed_points(session: Session, points_limit: int, user: str, points: i add_points = ( points if limit.Points + points <= points_limit - else (points_limit - limit.Points if points_limit - limit.Points > 0 else 0) + else (max(0, points_limit - limit.Points)) ) limit.Points += add_points @@ -512,7 +512,7 @@ async def edit_clan_message( async def edit_clan_council_info(guild: nextcord.Guild, config: DakinyConfig) -> None: """ - Gets the winners of the elections and updates the perminant message that states the current council. + Gets the winners of the elections and updates the permanent message that states the current council. Args: guild (nextcord.Guild): Guild object that to use to get channel.