diff --git a/.idea/tuxbot_bot.iml b/.idea/tuxbot_bot.iml index e7c88fd..b9c571d 100644 --- a/.idea/tuxbot_bot.iml +++ b/.idea/tuxbot_bot.iml @@ -6,6 +6,7 @@ + diff --git a/tuxbot/cogs/Logs/functions/utils.py b/tuxbot/cogs/Logs/functions/utils.py index 84453fa..8627e82 100644 --- a/tuxbot/cogs/Logs/functions/utils.py +++ b/tuxbot/cogs/Logs/functions/utils.py @@ -3,7 +3,7 @@ from typing import Dict def sort_by(_events: Counter) -> dict[str, dict]: - majors = [ + majors = ( "guild", "channel", "message", @@ -12,7 +12,7 @@ def sort_by(_events: Counter) -> dict[str, dict]: "presence", "voice", "other", - ] + ) sorted_events: Dict[str, Dict] = {m: {} for m in majors} for event, count in _events: diff --git a/tuxbot/cogs/Network/functions/utils.py b/tuxbot/cogs/Network/functions/utils.py index 4e9de08..d3509b0 100644 --- a/tuxbot/cogs/Network/functions/utils.py +++ b/tuxbot/cogs/Network/functions/utils.py @@ -146,14 +146,14 @@ async def get_pydig_result( def check_ip_version_or_raise(version: str) -> Union[bool, NoReturn]: - if version in ["4", "6", "None"]: + if version in ("4", "6", "None"): return True raise InvalidIp(_("Invalid ip version")) def check_query_type_or_raise(query_type: str) -> Union[bool, NoReturn]: - query_types = [ + query_types = ( "a", "aaaa", "cname", @@ -164,7 +164,7 @@ def check_query_type_or_raise(query_type: str) -> Union[bool, NoReturn]: "txt", "ptr", "mx", - ] + ) if query_type in query_types: return True diff --git a/tuxbot/cogs/Network/network.py b/tuxbot/cogs/Network/network.py index 1b40805..f0e9c47 100644 --- a/tuxbot/cogs/Network/network.py +++ b/tuxbot/cogs/Network/network.py @@ -151,7 +151,7 @@ class Network(commands.Cog): "Unable to collect information through CloudFlare", ctx, self.bot.config, - ).format() + ) ) @command_extra(name="getheaders", aliases=["headers"], deletable=True) diff --git a/tuxbot/cogs/Polls/functions/emotes.py b/tuxbot/cogs/Polls/functions/emotes.py index 77c2cc5..40fd954 100644 --- a/tuxbot/cogs/Polls/functions/emotes.py +++ b/tuxbot/cogs/Polls/functions/emotes.py @@ -1,5 +1,5 @@ emotes = [chr(0x1F1E6 + i) for i in range(26)] -check = [chr(0x2714), chr(0x2716)] +check = (chr(0x2714), chr(0x2716)) def get(count): diff --git a/tuxbot/core/__init__.py b/tuxbot/core/__init__.py index b50cd88..0abc4fc 100644 --- a/tuxbot/core/__init__.py +++ b/tuxbot/core/__init__.py @@ -1,11 +1,11 @@ from .. import __version__, version_info, VersionInfo, ExitCodes from .config import Config, ConfigFile -__all__ = [ +__all__ = ( "Config", "ConfigFile", "__version__", "version_info", "VersionInfo", "ExitCodes", -] +) diff --git a/tuxbot/core/bot.py b/tuxbot/core/bot.py index 2bc450a..d4dca73 100644 --- a/tuxbot/core/bot.py +++ b/tuxbot/core/bot.py @@ -3,7 +3,7 @@ import datetime import importlib import logging from collections import Counter -from typing import List, Union +from typing import List, Union, Tuple import aiohttp import discord @@ -33,7 +33,7 @@ from . import exceptions log = logging.getLogger("tuxbot") -packages: List[str] = [ +packages: Tuple = ( "jishaku", "tuxbot.cogs.Admin", "tuxbot.cogs.Logs", @@ -42,7 +42,7 @@ packages: List[str] = [ "tuxbot.cogs.Polls", "tuxbot.cogs.Custom", "tuxbot.cogs.Network", -] +) class Tux(commands.AutoShardedBot): @@ -81,7 +81,7 @@ class Tux(commands.AutoShardedBot): else: kwargs["owner_ids"] = self.config.Core.owners_id - message_cache_size = 100_000 + message_cache_size = 10_000 kwargs["max_messages"] = message_cache_size self.max_messages = message_cache_size @@ -258,7 +258,7 @@ class Tux(commands.AutoShardedBot): if ctx is not None and ctx.valid: if message.guild and ctx.command in search_for( - self.config.Servers, message.guild.id, "disabled_command", [] + self.config.Servers, message.guild.id, "disabled_command", () ): raise exceptions.DisabledCommandByServerOwner diff --git a/tuxbot/core/config.py b/tuxbot/core/config.py index 72a87d2..cbafca4 100644 --- a/tuxbot/core/config.py +++ b/tuxbot/core/config.py @@ -8,14 +8,14 @@ from structured_config import ( ConfigFile, ) -__all__ = [ +__all__ = ( "Config", "ConfigFile", "search_for", "set_for_key", "set_for", "set_if_none", -] +) log = logging.getLogger("tuxbot.core.config") diff --git a/tuxbot/core/i18n.py b/tuxbot/core/i18n.py index 1d376d6..6d0cc16 100644 --- a/tuxbot/core/i18n.py +++ b/tuxbot/core/i18n.py @@ -1,7 +1,7 @@ import logging import os from pathlib import Path -from typing import Union, Dict, List, NoReturn, Any +from typing import Union, Dict, NoReturn, Any, Tuple from babel.messages.pofile import read_po @@ -13,9 +13,9 @@ log = logging.getLogger("tuxbot.core.i18n") _translators = [] -available_locales: Dict[str, List[str]] = { - "en-US": ["english", "anglais", "en", "us", "en-us"], - "fr-FR": ["français", "francais", "french", "fr", "be", "fr-fr"], +available_locales: Dict[str, Tuple] = { + "en-US": ("english", "anglais", "en", "us", "en-us"), + "fr-FR": ("français", "francais", "french", "fr", "be", "fr-fr"), } diff --git a/tuxbot/core/utils/checks.py b/tuxbot/core/utils/checks.py index 516ca54..ec02c08 100644 --- a/tuxbot/core/utils/checks.py +++ b/tuxbot/core/utils/checks.py @@ -10,7 +10,7 @@ from discord.ext.commands import ( from tuxbot.core.utils.functions.extra import ContextPlus -__all__ = [ +__all__ = ( "bot_has_permissions", "has_permissions", "is_owner", @@ -18,7 +18,7 @@ __all__ = [ "is_admin", "check_permissions", "guild_owner_or_permissions", -] +) def is_mod():