mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -05:00
[V3] Update black version and reformat (#1745)
* Update black version and reformat * Pin black in extras_require
This commit is contained in:
@@ -40,7 +40,6 @@ RUNNING_ANNOUNCEMENT = (
|
||||
|
||||
|
||||
class Admin:
|
||||
|
||||
def __init__(self, config=Config):
|
||||
self.conf = config.get_conf(self, 8237492837454039, force_registration=True)
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ from discord.ext import commands
|
||||
|
||||
|
||||
class Announcer:
|
||||
|
||||
def __init__(self, ctx: commands.Context, message: str, config=None):
|
||||
"""
|
||||
:param ctx:
|
||||
|
||||
@@ -3,7 +3,6 @@ from discord.ext import commands
|
||||
|
||||
|
||||
class MemberDefaultAuthor(commands.Converter):
|
||||
|
||||
async def convert(self, ctx: commands.Context, arg: str) -> discord.Member:
|
||||
member_converter = commands.MemberConverter()
|
||||
try:
|
||||
@@ -17,7 +16,6 @@ class MemberDefaultAuthor(commands.Converter):
|
||||
|
||||
|
||||
class SelfRole(commands.Converter):
|
||||
|
||||
async def convert(self, ctx: commands.Context, arg: str) -> discord.Role:
|
||||
admin = ctx.command.instance
|
||||
if admin is None:
|
||||
|
||||
@@ -5,7 +5,6 @@ from redbot.core import commands
|
||||
|
||||
|
||||
class AliasEntry:
|
||||
|
||||
def __init__(
|
||||
self, name: str, command: Tuple[str], creator: discord.Member, global_: bool = False
|
||||
):
|
||||
|
||||
@@ -20,7 +20,6 @@ __author__ = ["aikaterna", "billy/bollo/ati"]
|
||||
|
||||
@cog_i18n(_)
|
||||
class Audio:
|
||||
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
self.config = Config.get_conf(self, 2711759130, force_registration=True)
|
||||
|
||||
@@ -25,7 +25,6 @@ class AlreadyExists(CCError):
|
||||
|
||||
|
||||
class CommandObj:
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
config = kwargs.get("config")
|
||||
self.bot = kwargs.get("bot")
|
||||
|
||||
@@ -17,7 +17,6 @@ REPO_INSTALL_MSG = (
|
||||
|
||||
|
||||
def install_agreement():
|
||||
|
||||
async def pred(ctx: commands.Context):
|
||||
downloader = ctx.command.instance
|
||||
if downloader is None:
|
||||
|
||||
@@ -5,7 +5,6 @@ from .installable import Installable
|
||||
|
||||
|
||||
class InstalledCog(commands.Converter):
|
||||
|
||||
async def convert(self, ctx: commands.Context, arg: str) -> Installable:
|
||||
downloader = ctx.bot.get_cog("Downloader")
|
||||
if downloader is None:
|
||||
|
||||
@@ -27,7 +27,6 @@ _ = Translator("Downloader", __file__)
|
||||
|
||||
@cog_i18n(_)
|
||||
class Downloader:
|
||||
|
||||
def __init__(self, bot: Red):
|
||||
self.bot = bot
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ class DownloaderException(Exception):
|
||||
"""
|
||||
Base class for Downloader exceptions.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@@ -31,6 +32,7 @@ class InvalidRepoName(DownloaderException):
|
||||
Throw when a repo name is invalid. Check
|
||||
the message for a more detailed reason.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@@ -39,6 +41,7 @@ class ExistingGitRepo(DownloaderException):
|
||||
Thrown when trying to clone into a folder where a
|
||||
git repo already exists.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@@ -47,6 +50,7 @@ class MissingGitRepo(DownloaderException):
|
||||
Thrown when a git repo is expected to exist but
|
||||
does not.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@@ -54,6 +58,7 @@ class CloningError(GitException):
|
||||
"""
|
||||
Thrown when git clone returns a non zero exit code.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@@ -62,6 +67,7 @@ class CurrentHashError(GitException):
|
||||
Thrown when git returns a non zero exit code attempting
|
||||
to determine the current commit hash.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@@ -70,6 +76,7 @@ class HardResetError(GitException):
|
||||
Thrown when there is an issue trying to execute a hard reset
|
||||
(usually prior to a repo update).
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@@ -77,6 +84,7 @@ class UpdateError(GitException):
|
||||
"""
|
||||
Thrown when git pull returns a non zero error code.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@@ -84,6 +92,7 @@ class GitDiffError(GitException):
|
||||
"""
|
||||
Thrown when a git diff fails.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@@ -91,4 +100,5 @@ class PipError(DownloaderException):
|
||||
"""
|
||||
Thrown when pip returns a non-zero return code.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
@@ -495,7 +495,6 @@ class Repo(RepoJSONMixin):
|
||||
|
||||
|
||||
class RepoManager:
|
||||
|
||||
def __init__(self):
|
||||
|
||||
self._repos = {}
|
||||
|
||||
@@ -74,7 +74,6 @@ SLOT_PAYOUTS_MSG = _(
|
||||
|
||||
|
||||
def guild_only_check():
|
||||
|
||||
async def pred(ctx: commands.Context):
|
||||
if await bank.is_global():
|
||||
return True
|
||||
@@ -87,7 +86,6 @@ def guild_only_check():
|
||||
|
||||
|
||||
class SetParser:
|
||||
|
||||
def __init__(self, argument):
|
||||
allowed = ("+", "-")
|
||||
self.sum = int(argument)
|
||||
|
||||
@@ -21,7 +21,6 @@ class RPS(Enum):
|
||||
|
||||
|
||||
class RPSParser:
|
||||
|
||||
def __init__(self, argument):
|
||||
argument = argument.lower()
|
||||
if argument == "rock":
|
||||
|
||||
@@ -13,6 +13,7 @@ GIPHY_API_KEY = "dc6zaTOxFJmzC"
|
||||
@cog_i18n(_)
|
||||
class Image:
|
||||
"""Image related commands."""
|
||||
|
||||
default_global = {"imgur_client_id": None}
|
||||
|
||||
def __init__(self, bot):
|
||||
|
||||
@@ -3,7 +3,6 @@ import discord
|
||||
|
||||
|
||||
def mod_or_voice_permissions(**perms):
|
||||
|
||||
async def pred(ctx: commands.Context):
|
||||
author = ctx.author
|
||||
guild = ctx.guild
|
||||
@@ -31,7 +30,6 @@ def mod_or_voice_permissions(**perms):
|
||||
|
||||
|
||||
def admin_or_voice_permissions(**perms):
|
||||
|
||||
async def pred(ctx: commands.Context):
|
||||
author = ctx.author
|
||||
guild = ctx.guild
|
||||
@@ -54,7 +52,6 @@ def admin_or_voice_permissions(**perms):
|
||||
|
||||
|
||||
def bot_has_voice_permissions(**perms):
|
||||
|
||||
async def pred(ctx: commands.Context):
|
||||
guild = ctx.guild
|
||||
for vc in guild.voice_channels:
|
||||
|
||||
@@ -3,7 +3,6 @@ from typing import Tuple
|
||||
|
||||
|
||||
class CogOrCommand(commands.Converter):
|
||||
|
||||
async def convert(self, ctx: commands.Context, arg: str) -> Tuple[str]:
|
||||
ret = ctx.bot.get_cog(arg)
|
||||
if ret:
|
||||
@@ -16,7 +15,6 @@ class CogOrCommand(commands.Converter):
|
||||
|
||||
|
||||
class RuleType(commands.Converter):
|
||||
|
||||
async def convert(self, ctx: commands.Context, arg: str) -> str:
|
||||
if arg.lower() in ("allow", "whitelist", "allowed"):
|
||||
return "allow"
|
||||
|
||||
@@ -30,7 +30,6 @@ def rnd(url):
|
||||
|
||||
|
||||
class TwitchCommunity:
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
self.name = kwargs.pop("name")
|
||||
self.id = kwargs.pop("id", None)
|
||||
@@ -119,7 +118,6 @@ class TwitchCommunity:
|
||||
|
||||
|
||||
class Stream:
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
self.name = kwargs.pop("name", None)
|
||||
self.channels = kwargs.pop("channels", [])
|
||||
@@ -148,7 +146,6 @@ class Stream:
|
||||
|
||||
|
||||
class YoutubeStream(Stream):
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
self.id = kwargs.pop("id", None)
|
||||
self._token = kwargs.pop("token", None)
|
||||
@@ -213,7 +210,6 @@ class YoutubeStream(Stream):
|
||||
|
||||
|
||||
class TwitchStream(Stream):
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
self.id = kwargs.pop("id", None)
|
||||
self._token = kwargs.pop("token", None)
|
||||
@@ -288,7 +284,6 @@ class TwitchStream(Stream):
|
||||
|
||||
|
||||
class HitboxStream(Stream):
|
||||
|
||||
async def is_online(self):
|
||||
url = "https://api.hitbox.tv/media/live/" + self.name
|
||||
|
||||
@@ -326,7 +321,6 @@ class HitboxStream(Stream):
|
||||
|
||||
|
||||
class MixerStream(Stream):
|
||||
|
||||
async def is_online(self):
|
||||
url = "https://mixer.com/api/v1/channels/" + self.name
|
||||
|
||||
@@ -368,7 +362,6 @@ class MixerStream(Stream):
|
||||
|
||||
|
||||
class PicartoStream(Stream):
|
||||
|
||||
async def is_online(self):
|
||||
url = "https://api.picarto.tv/v1/channel/name/" + self.name
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ UNIQUE_ID = 0xb3c0e453
|
||||
|
||||
class InvalidListError(Exception):
|
||||
"""A Trivia list file is in invalid format."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user