Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 15, 2024
1 parent 0764f6b commit 6289364
Show file tree
Hide file tree
Showing 24 changed files with 36 additions and 10 deletions.
1 change: 1 addition & 0 deletions bot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Main file for running and starting the bot, with general global commands."""

import random
import re
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants for the bot."""

import json
import os

Expand Down
1 change: 1 addition & 0 deletions logs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Stores classes for storing log data and player stats"""

from steam.steamid import SteamID

from database import BotCollection
Expand Down
1 change: 1 addition & 0 deletions logs/elo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Elo calculations, storage and utilities."""

from difflib import SequenceMatcher
import math
from typing import Any
Expand Down
1 change: 1 addition & 0 deletions logs/elo_cog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This cog contains the elo cog with commands to configure elo and add missing logs."""

import asyncio
import time

Expand Down
1 change: 1 addition & 0 deletions logs/logs.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions logs/logstf_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""File storing the LogsAPI class, which is used to interact with the Logs.tf API."""

import asyncio

import aiohttp
Expand Down
1 change: 1 addition & 0 deletions logs/searcher.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions logs/stats.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Cog that handles stats and showing stats to players."""

from typing import Optional
import nextcord
from nextcord.ext import commands
Expand Down
1 change: 1 addition & 0 deletions pug/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Holds classes for pug commands/setup"""

from typing import Union, List, Dict
import time

Expand Down
4 changes: 2 additions & 2 deletions pug/manual.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Cog storing commands to manually add up to pugs."""

import time

import nextcord
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions pug/med_immunity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Commands for randomly rolling medics in pugs."""

import datetime
import random
from typing import Set
Expand Down
17 changes: 11 additions & 6 deletions pug/pug.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Commands for generating teams in pugs."""

from itertools import combinations
import random
from typing import Optional, Dict, List
Expand Down Expand Up @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions pug/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Cog to set up pug categories for the server."""

import nextcord
from nextcord.ext import commands

Expand Down Expand Up @@ -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
),
):
Expand Down
1 change: 1 addition & 0 deletions registration/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Holds views for the registration commands."""

import nextcord

from database import get_server, set_registration_settings
Expand Down
1 change: 1 addition & 0 deletions registration/setup.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions registration/update_roles.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains the cog to update users roles over time."""

import datetime

import asyncio
Expand Down
1 change: 1 addition & 0 deletions registration/webserver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains the webserver cog, which is responsible for the webserver and registering users."""

import asyncio
import aiohttp
import nextcord
Expand Down
1 change: 1 addition & 0 deletions rglapi.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions servers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Classes for use in the servers cog."""

from datetime import datetime, tzinfo

import nextcord
Expand Down
1 change: 1 addition & 0 deletions servers/serveme_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Class used to interact with the serveme.tf API."""

import json
import re
from datetime import datetime, timedelta
Expand Down
1 change: 1 addition & 0 deletions servers/servers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Files containing the server cog with commands for reserving/managing servers."""

import asyncio
import json
import re
Expand Down
1 change: 1 addition & 0 deletions test_cog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains all of the commands for the test bot."""

import gql
import nextcord
from gql.transport.aiohttp import AIOHTTPTransport
Expand Down
1 change: 1 addition & 0 deletions util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utility functions for use throughout the code."""

import aiohttp
import nextcord
from steam import steamid
Expand Down

0 comments on commit 6289364

Please sign in to comment.