From f3c3ec1bafbfb6ff9dd6cd8eae7ef35d2bdb7261 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 16:29:53 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v6.0.0) - https://github.com/psf/black → https://github.com/psf/black-pre-commit-mirror - [github.com/psf/black-pre-commit-mirror: 23.11.0 → 25.12.0](https://github.com/psf/black-pre-commit-mirror/compare/23.11.0...25.12.0) - [github.com/pre-commit/mirrors-mypy: v1.7.1 → v1.19.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.7.1...v1.19.1) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f707ef5..5bf3720 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,17 +3,17 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v6.0.0 hooks: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace -- repo: https://github.com/psf/black - rev: 23.11.0 +- repo: https://github.com/psf/black-pre-commit-mirror + rev: 25.12.0 hooks: - id: black - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.7.1 # Use the sha / tag you want to point at + rev: v1.19.1 # Use the sha / tag you want to point at hooks: - id: mypy additional_dependencies: [types-requests==2.31.0.1, types_pytz>=2023.3.1.0] From 01231c98f5885a362684cdd302c5ab3ad4eccc0b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 16:30:47 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- database.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 + menus/callbacks.py | 1 + menus/templates.py | 7 ++++--- pug/__init__.py | 1 + pug/manual.py | 3 +-- pug/med_immunity.py | 1 + pug/pug.py | 16 ++++++++++------ pug/setup.py | 4 ++-- registration/__init__.py | 1 + registration/registration.py | 5 +++-- registration/setup.py | 1 + registration/webserver.py | 1 + rglapi.py | 1 + servers/__init__.py | 1 + test_cog.py | 1 + util.py | 1 + 23 files changed, 38 insertions(+), 15 deletions(-) diff --git a/database.py b/database.py index 54c0216..c15251c 100644 --- a/database.py +++ b/database.py @@ -1,4 +1,5 @@ """Functions for interacting with the database throughout the bot.""" + import motor.motor_asyncio import constants 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 92cfe06..ac6ed63 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 61db62c..e39e261 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 nextcord.enums import ChannelType 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 77a2237..e535cc6 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/menus/callbacks.py b/menus/callbacks.py index 58c427f..22e3c49 100644 --- a/menus/callbacks.py +++ b/menus/callbacks.py @@ -1,4 +1,5 @@ """This module contains some useful callbacks for menus.""" + from typing import Callable, Any from nextcord import Interaction diff --git a/menus/templates.py b/menus/templates.py index 49765f3..ca880f0 100644 --- a/menus/templates.py +++ b/menus/templates.py @@ -1,4 +1,5 @@ """Functions to build predefined for use around the bot.""" + from nextcord import ButtonStyle, Interaction, Embed from nextcord.abc import GuildChannel from nextcord.enums import ChannelType @@ -81,9 +82,9 @@ async def send_channel_prompt( ValueError If required is True and no channel is selected for a entry. """ - channel_selects: list[ - ChannelSelect - ] = [] # We'll go through this later to get the values + channel_selects: list[ChannelSelect] = ( + [] + ) # We'll go through this later to get the values menu.clear_items() if interaction.response.is_done(): await menu.edit(interaction) diff --git a/pug/__init__.py b/pug/__init__.py index 33f08b5..676c5b3 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, TypedDict import time diff --git a/pug/manual.py b/pug/manual.py index d0c89ae..86752d9 100644 --- a/pug/manual.py +++ b/pug/manual.py @@ -367,8 +367,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 f8c7bd3..d1cbbc7 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 1398a2d..0e1995d 100644 --- a/pug/pug.py +++ b/pug/pug.py @@ -111,15 +111,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.get_division(gamemode, reg_settings.mode) == -1 - else x.get_division(gamemode, reg_settings.mode), + key=lambda x: ( + 10 + if x.get_division(gamemode, reg_settings.mode) == -1 + else x.get_division(gamemode, reg_settings.mode) + ), reverse=False, ) players["add_up"].sort( - key=lambda x: 10 - if x.get_division(gamemode, reg_settings.mode) == -1 - else x.get_division(gamemode, reg_settings.mode), + key=lambda x: ( + 10 + if x.get_division(gamemode, reg_settings.mode) == -1 + else x.get_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 f15f764..95a549c 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 from nextcord.abc import GuildChannel @@ -171,8 +172,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 0e83598..026e7bf 100644 --- a/registration/__init__.py +++ b/registration/__init__.py @@ -1,4 +1,5 @@ """Contains classes for registration of new users.""" + import asyncio from dataclasses import dataclass, field import json diff --git a/registration/registration.py b/registration/registration.py index 1ea7dab..2d09a42 100644 --- a/registration/registration.py +++ b/registration/registration.py @@ -87,8 +87,9 @@ async def delete_user( self, interaction: nextcord.Interaction, steam: str | None = nextcord.SlashOption(name="steam", required=None), - discord: nextcord.User - | None = nextcord.SlashOption(name="discord", required=False), + discord: nextcord.User | None = nextcord.SlashOption( + name="discord", required=False + ), ): """Deletes a user from the database. diff --git a/registration/setup.py b/registration/setup.py index b276f0c..1105b3b 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 from nextcord.ui import RoleSelect diff --git a/registration/webserver.py b/registration/webserver.py index d8ab98d..1d2b97a 100644 --- a/registration/webserver.py +++ b/registration/webserver.py @@ -1,4 +1,5 @@ """File holding the actual FastAPI webserver for use with the registration cog.""" + import logging from fastapi import FastAPI, APIRouter, Request, Response, status diff --git a/rglapi.py b/rglapi.py index 1005918..ac316bb 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 6728f79..19d7ee5 100644 --- a/servers/__init__.py +++ b/servers/__init__.py @@ -1,4 +1,5 @@ """Classes for use in the servers cog.""" + from datetime import datetime from typing import Optional 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 86dfe1d..43a01e4 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