From 62893646e5036c8d99fe1941da41afc65e26d5e5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 16:33:04 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- bot.py | 1 + constants.py | 1 + logs/__init__.py | 1 + logs/elo.py | 1 + logs/elo_cog.py | 1 + logs/logs.py | 1 + logs/logstf_api.py | 1 + logs/searcher.py | 1 + logs/stats.py | 1 + pug/__init__.py | 1 + pug/manual.py | 4 ++-- pug/med_immunity.py | 1 + pug/pug.py | 17 +++++++++++------ pug/setup.py | 4 ++-- registration/__init__.py | 1 + registration/setup.py | 1 + registration/update_roles.py | 1 + registration/webserver.py | 1 + rglapi.py | 1 + servers/__init__.py | 1 + servers/serveme_api.py | 1 + servers/servers.py | 1 + test_cog.py | 1 + util.py | 1 + 24 files changed, 36 insertions(+), 10 deletions(-) diff --git a/bot.py b/bot.py index 57248be..623e7f7 100644 --- a/bot.py +++ b/bot.py @@ -1,4 +1,5 @@ """Main file for running and starting the bot, with general global commands.""" + import random import re from typing import Optional diff --git a/constants.py b/constants.py index 8872e8a..f03d413 100644 --- a/constants.py +++ b/constants.py @@ -1,4 +1,5 @@ """Constants for the bot.""" + import json import os diff --git a/logs/__init__.py b/logs/__init__.py index c916ba4..9e37ed5 100644 --- a/logs/__init__.py +++ b/logs/__init__.py @@ -1,4 +1,5 @@ """Stores classes for storing log data and player stats""" + from steam.steamid import SteamID from database import BotCollection diff --git a/logs/elo.py b/logs/elo.py index fb81a6a..d189fea 100644 --- a/logs/elo.py +++ b/logs/elo.py @@ -1,4 +1,5 @@ """Elo calculations, storage and utilities.""" + from difflib import SequenceMatcher import math from typing import Any diff --git a/logs/elo_cog.py b/logs/elo_cog.py index 2bc6bba..d5ca6ea 100644 --- a/logs/elo_cog.py +++ b/logs/elo_cog.py @@ -1,4 +1,5 @@ """This cog contains the elo cog with commands to configure elo and add missing logs.""" + import asyncio import time diff --git a/logs/logs.py b/logs/logs.py index 9128976..77b2a18 100644 --- a/logs/logs.py +++ b/logs/logs.py @@ -1,4 +1,5 @@ """This cog contains the logs command and its subcommands.""" + import nextcord from nextcord.ext import commands, application_checks from database import BotCollection diff --git a/logs/logstf_api.py b/logs/logstf_api.py index 30c904c..ebcf057 100644 --- a/logs/logstf_api.py +++ b/logs/logstf_api.py @@ -1,4 +1,5 @@ """File storing the LogsAPI class, which is used to interact with the Logs.tf API.""" + import asyncio import aiohttp diff --git a/logs/searcher.py b/logs/searcher.py index 32f3b3e..8b62961 100644 --- a/logs/searcher.py +++ b/logs/searcher.py @@ -1,4 +1,5 @@ """Implements the log searcher file, which takes the players from a team generation or moved back and searches for the log associated with the game that was played/being played.""" + import time import traceback diff --git a/logs/stats.py b/logs/stats.py index 173c5f9..70271c2 100644 --- a/logs/stats.py +++ b/logs/stats.py @@ -1,4 +1,5 @@ """Cog that handles stats and showing stats to players.""" + from typing import Optional import nextcord from nextcord.ext import commands diff --git a/pug/__init__.py b/pug/__init__.py index f6d4d28..03ab121 100644 --- a/pug/__init__.py +++ b/pug/__init__.py @@ -1,4 +1,5 @@ """Holds classes for pug commands/setup""" + from typing import Union, List, Dict import time diff --git a/pug/manual.py b/pug/manual.py index db33119..7c9eda1 100644 --- a/pug/manual.py +++ b/pug/manual.py @@ -1,4 +1,5 @@ """Cog storing commands to manually add up to pugs.""" + import time import nextcord @@ -310,8 +311,7 @@ async def default_add_time( async def manual_add( self, interaction: nextcord.Interaction, - add_time: int - | None = nextcord.SlashOption( + add_time: int | None = nextcord.SlashOption( name="time", description="The hours to add up for.", required=False, diff --git a/pug/med_immunity.py b/pug/med_immunity.py index 3e5c8b2..e9ad7e0 100644 --- a/pug/med_immunity.py +++ b/pug/med_immunity.py @@ -1,4 +1,5 @@ """Commands for randomly rolling medics in pugs.""" + import datetime import random from typing import Set diff --git a/pug/pug.py b/pug/pug.py index 316f2f8..6ee32d9 100644 --- a/pug/pug.py +++ b/pug/pug.py @@ -1,4 +1,5 @@ """Commands for generating teams in pugs.""" + from itertools import combinations import random from typing import Optional, Dict, List @@ -106,15 +107,19 @@ async def generate_balanced_teams( random.shuffle(players["add_up"]) # Deprioritize players that are not registered, as their skill is unknown players["next_pug"].sort( - key=lambda x: 10 - if x.division[gamemode][reg_settings.mode] == -1 - else x.division[gamemode][reg_settings.mode], + key=lambda x: ( + 10 + if x.division[gamemode][reg_settings.mode] == -1 + else x.division[gamemode][reg_settings.mode] + ), reverse=False, ) players["add_up"].sort( - key=lambda x: 10 - if x.division[gamemode][reg_settings.mode] == -1 - else x.division[gamemode][reg_settings.mode], + key=lambda x: ( + 10 + if x.division[gamemode][reg_settings.mode] == -1 + else x.division[gamemode][reg_settings.mode] + ), reverse=False, ) all_players = players["next_pug"] + players["add_up"] diff --git a/pug/setup.py b/pug/setup.py index 9c3ee76..651161e 100644 --- a/pug/setup.py +++ b/pug/setup.py @@ -1,4 +1,5 @@ """Cog to set up pug categories for the server.""" + import nextcord from nextcord.ext import commands @@ -186,8 +187,7 @@ async def role_add( value: int = nextcord.SlashOption( name="value", description="The point value to give the role.", required=True ), - emote: str - | None = nextcord.SlashOption( + emote: str | None = nextcord.SlashOption( name="emote", description="The emote to use for the role.", required=False ), ): diff --git a/registration/__init__.py b/registration/__init__.py index f3e2c66..101ab8a 100644 --- a/registration/__init__.py +++ b/registration/__init__.py @@ -1,4 +1,5 @@ """Holds views for the registration commands.""" + import nextcord from database import get_server, set_registration_settings diff --git a/registration/setup.py b/registration/setup.py index 60af957..19a8364 100644 --- a/registration/setup.py +++ b/registration/setup.py @@ -1,4 +1,5 @@ """Cog to hold commands to set up the registration part of the bot per server.""" + import nextcord from nextcord.ext import commands diff --git a/registration/update_roles.py b/registration/update_roles.py index bb510bc..6dcf866 100644 --- a/registration/update_roles.py +++ b/registration/update_roles.py @@ -1,4 +1,5 @@ """Contains the cog to update users roles over time.""" + import datetime import asyncio diff --git a/registration/webserver.py b/registration/webserver.py index dcfefa4..5efbcc7 100644 --- a/registration/webserver.py +++ b/registration/webserver.py @@ -1,4 +1,5 @@ """Contains the webserver cog, which is responsible for the webserver and registering users.""" + import asyncio import aiohttp import nextcord diff --git a/rglapi.py b/rglapi.py index 1248dce..762a748 100644 --- a/rglapi.py +++ b/rglapi.py @@ -1,4 +1,5 @@ """File containing the rglAPI class, which is used to interact with the RGL API.""" + from datetime import datetime, timedelta import aiohttp diff --git a/servers/__init__.py b/servers/__init__.py index 1f9b751..0e2628a 100644 --- a/servers/__init__.py +++ b/servers/__init__.py @@ -1,4 +1,5 @@ """Classes for use in the servers cog.""" + from datetime import datetime, tzinfo import nextcord diff --git a/servers/serveme_api.py b/servers/serveme_api.py index 234a18e..90dcc90 100644 --- a/servers/serveme_api.py +++ b/servers/serveme_api.py @@ -1,4 +1,5 @@ """Class used to interact with the serveme.tf API.""" + import json import re from datetime import datetime, timedelta diff --git a/servers/servers.py b/servers/servers.py index 935c594..4172630 100644 --- a/servers/servers.py +++ b/servers/servers.py @@ -1,4 +1,5 @@ """Files containing the server cog with commands for reserving/managing servers.""" + import asyncio import json import re diff --git a/test_cog.py b/test_cog.py index 459de71..dcb6d14 100644 --- a/test_cog.py +++ b/test_cog.py @@ -1,4 +1,5 @@ """Contains all of the commands for the test bot.""" + import gql import nextcord from gql.transport.aiohttp import AIOHTTPTransport diff --git a/util.py b/util.py index 53f325a..dac08f4 100644 --- a/util.py +++ b/util.py @@ -1,4 +1,5 @@ """Utility functions for use throughout the code.""" + import aiohttp import nextcord from steam import steamid