mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
[V3] Update black version and reformat (#1745)
* Update black version and reformat * Pin black in extras_require
This commit is contained in:
@@ -4,7 +4,6 @@ __all__ = ["Config", "__version__"]
|
||||
|
||||
|
||||
class VersionInfo:
|
||||
|
||||
def __init__(self, major, minor, micro, releaselevel, serial):
|
||||
self._levels = ["alpha", "beta", "final"]
|
||||
self.major = major
|
||||
|
||||
@@ -16,7 +16,6 @@ async def check_overrides(ctx, *, level):
|
||||
|
||||
|
||||
def is_owner(**kwargs):
|
||||
|
||||
async def check(ctx):
|
||||
override = await check_overrides(ctx, level="owner")
|
||||
return override if override is not None else await ctx.bot.is_owner(ctx.author, **kwargs)
|
||||
@@ -73,7 +72,6 @@ async def is_admin_or_superior(ctx):
|
||||
|
||||
|
||||
def mod_or_permissions(**perms):
|
||||
|
||||
async def predicate(ctx):
|
||||
override = await check_overrides(ctx, level="mod")
|
||||
return (
|
||||
@@ -86,7 +84,6 @@ def mod_or_permissions(**perms):
|
||||
|
||||
|
||||
def admin_or_permissions(**perms):
|
||||
|
||||
async def predicate(ctx):
|
||||
override = await check_overrides(ctx, level="admin")
|
||||
return (
|
||||
@@ -99,7 +96,6 @@ def admin_or_permissions(**perms):
|
||||
|
||||
|
||||
def bot_in_a_guild(**kwargs):
|
||||
|
||||
async def predicate(ctx):
|
||||
return len(ctx.bot.guilds) > 0
|
||||
|
||||
@@ -107,7 +103,6 @@ def bot_in_a_guild(**kwargs):
|
||||
|
||||
|
||||
def guildowner_or_permissions(**perms):
|
||||
|
||||
async def predicate(ctx):
|
||||
has_perms_or_is_owner = await check_permissions(ctx, perms)
|
||||
if ctx.guild is None:
|
||||
|
||||
@@ -55,6 +55,7 @@ class Group(Command, commands.Group):
|
||||
This class inherits from `discord.ext.commands.Group`, with `Command` mixed
|
||||
in.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -441,6 +441,7 @@ class Config:
|
||||
attempting to access data.
|
||||
|
||||
"""
|
||||
|
||||
GLOBAL = "GLOBAL"
|
||||
GUILD = "GUILD"
|
||||
CHANNEL = "TEXTCHANNEL"
|
||||
|
||||
@@ -2,7 +2,6 @@ __all__ = ["BaseDriver"]
|
||||
|
||||
|
||||
class BaseDriver:
|
||||
|
||||
def __init__(self, cog_name, identifier):
|
||||
self.cog_name = cog_name
|
||||
self.unique_cog_identifier = identifier
|
||||
|
||||
@@ -49,7 +49,6 @@ def should_log_sentry(exception) -> bool:
|
||||
|
||||
|
||||
def init_events(bot, cli_flags):
|
||||
|
||||
@bot.event
|
||||
async def on_connect():
|
||||
if bot.uptime is None:
|
||||
|
||||
@@ -3,7 +3,6 @@ from . import commands
|
||||
|
||||
|
||||
def init_global_checks(bot):
|
||||
|
||||
@bot.check
|
||||
async def global_perms(ctx):
|
||||
"""Check the user is/isn't globally whitelisted/blacklisted."""
|
||||
|
||||
@@ -89,7 +89,6 @@ methods = Methods()
|
||||
|
||||
|
||||
class BaseRPCMethodMixin:
|
||||
|
||||
def __init__(self):
|
||||
methods.add(self.all_methods, name="all_methods")
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ class AntiSpam:
|
||||
Where quantity represents the maximum amount of times
|
||||
something should be allowed in an interval.
|
||||
"""
|
||||
|
||||
# TODO : Decorator interface for command check using `spammy`
|
||||
# with insertion of the antispam element into context
|
||||
# for manual stamping on succesful command completion
|
||||
|
||||
Reference in New Issue
Block a user