mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[V3] Update black version and reformat (#1745)
* Update black version and reformat * Pin black in extras_require
This commit is contained in:
parent
d8c4113d24
commit
14cc701b25
2
Pipfile
2
Pipfile
@ -14,7 +14,7 @@ pytest-asyncio = "*"
|
|||||||
sphinx = ">1.7"
|
sphinx = ">1.7"
|
||||||
sphinxcontrib-asyncio = "*"
|
sphinxcontrib-asyncio = "*"
|
||||||
sphinx-rtd-theme = "*"
|
sphinx-rtd-theme = "*"
|
||||||
black = {version = "*", python_version = ">= '3.6'"}
|
black = "*"
|
||||||
|
|
||||||
[pipenv]
|
[pipenv]
|
||||||
allow_prereleases = true
|
allow_prereleases = true
|
||||||
|
|||||||
21
Pipfile.lock
generated
21
Pipfile.lock
generated
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"_meta": {
|
"_meta": {
|
||||||
"hash": {
|
"hash": {
|
||||||
"sha256": "d340e4a19777736703970e45766d05d67b973db38b87382b6ef8696cb53abb60"
|
"sha256": "b6f739015def0fc7efb2b9aab7b0cc7e21d88e56b9b73f8611669d8c0814bc64"
|
||||||
},
|
},
|
||||||
"pipfile-spec": 6,
|
"pipfile-spec": 6,
|
||||||
"requires": {},
|
"requires": {},
|
||||||
@ -248,19 +248,18 @@
|
|||||||
},
|
},
|
||||||
"babel": {
|
"babel": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:8ce4cb6fdd4393edd323227cba3a077bceb2a6ce5201c902c65e730046f41f14",
|
"sha256:6778d85147d5d85345c14a26aada5e478ab04e39b078b0745ee6870c2b5cf669",
|
||||||
"sha256:ad209a68d7162c4cff4b29cdebe3dec4cef75492df501b0049a9433c96ce6f80"
|
"sha256:8cba50f48c529ca3fa18cf81fa9403be176d374ac4d60738b839122dfaaa3d23"
|
||||||
],
|
],
|
||||||
"version": "==2.5.3"
|
"version": "==2.6.0"
|
||||||
},
|
},
|
||||||
"black": {
|
"black": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:4fec2566f9fbbd4a58de50a168cbe3ab952713530410d227e82e4c65d1fad946",
|
"sha256:c956857a831e508e75f0dc754b86982bad98d95c96aae39c20749209b3958ad7",
|
||||||
"sha256:5fec0f25486046b9edb97961c946412ced96021247dd1a60ecd9f0567b68b030"
|
"sha256:fa8d4b58aeb454443d4ef02c9daa615cd9a241f0cbe5f2b38b5965209d26dd1c"
|
||||||
],
|
],
|
||||||
"index": "pypi",
|
"index": "pypi",
|
||||||
"markers": "python_version >= '3.6'",
|
"version": "==18.5b1"
|
||||||
"version": "==18.5b0"
|
|
||||||
},
|
},
|
||||||
"certifi": {
|
"certifi": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
@ -413,11 +412,11 @@
|
|||||||
},
|
},
|
||||||
"sphinx": {
|
"sphinx": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:2e7ad92e96eff1b2006cf9f0cdb2743dacbae63755458594e9e8238b0c3dc60b",
|
"sha256:85f7e32c8ef07f4ba5aeca728e0f7717bef0789fba8458b8d9c5c294cad134f3",
|
||||||
"sha256:e9b1a75a3eae05dded19c80eb17325be675e0698975baae976df603b6ed1eb10"
|
"sha256:d45480a229edf70d84ca9fae3784162b1bc75ee47e480ffe04a4b7f21a95d76d"
|
||||||
],
|
],
|
||||||
"index": "pypi",
|
"index": "pypi",
|
||||||
"version": "==1.7.4"
|
"version": "==1.7.5"
|
||||||
},
|
},
|
||||||
"sphinx-rtd-theme": {
|
"sphinx-rtd-theme": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
|
|||||||
@ -40,7 +40,6 @@ RUNNING_ANNOUNCEMENT = (
|
|||||||
|
|
||||||
|
|
||||||
class Admin:
|
class Admin:
|
||||||
|
|
||||||
def __init__(self, config=Config):
|
def __init__(self, config=Config):
|
||||||
self.conf = config.get_conf(self, 8237492837454039, force_registration=True)
|
self.conf = config.get_conf(self, 8237492837454039, force_registration=True)
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,6 @@ from discord.ext import commands
|
|||||||
|
|
||||||
|
|
||||||
class Announcer:
|
class Announcer:
|
||||||
|
|
||||||
def __init__(self, ctx: commands.Context, message: str, config=None):
|
def __init__(self, ctx: commands.Context, message: str, config=None):
|
||||||
"""
|
"""
|
||||||
:param ctx:
|
:param ctx:
|
||||||
|
|||||||
@ -3,7 +3,6 @@ from discord.ext import commands
|
|||||||
|
|
||||||
|
|
||||||
class MemberDefaultAuthor(commands.Converter):
|
class MemberDefaultAuthor(commands.Converter):
|
||||||
|
|
||||||
async def convert(self, ctx: commands.Context, arg: str) -> discord.Member:
|
async def convert(self, ctx: commands.Context, arg: str) -> discord.Member:
|
||||||
member_converter = commands.MemberConverter()
|
member_converter = commands.MemberConverter()
|
||||||
try:
|
try:
|
||||||
@ -17,7 +16,6 @@ class MemberDefaultAuthor(commands.Converter):
|
|||||||
|
|
||||||
|
|
||||||
class SelfRole(commands.Converter):
|
class SelfRole(commands.Converter):
|
||||||
|
|
||||||
async def convert(self, ctx: commands.Context, arg: str) -> discord.Role:
|
async def convert(self, ctx: commands.Context, arg: str) -> discord.Role:
|
||||||
admin = ctx.command.instance
|
admin = ctx.command.instance
|
||||||
if admin is None:
|
if admin is None:
|
||||||
|
|||||||
@ -5,7 +5,6 @@ from redbot.core import commands
|
|||||||
|
|
||||||
|
|
||||||
class AliasEntry:
|
class AliasEntry:
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, name: str, command: Tuple[str], creator: discord.Member, global_: bool = False
|
self, name: str, command: Tuple[str], creator: discord.Member, global_: bool = False
|
||||||
):
|
):
|
||||||
|
|||||||
@ -20,7 +20,6 @@ __author__ = ["aikaterna", "billy/bollo/ati"]
|
|||||||
|
|
||||||
@cog_i18n(_)
|
@cog_i18n(_)
|
||||||
class Audio:
|
class Audio:
|
||||||
|
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.config = Config.get_conf(self, 2711759130, force_registration=True)
|
self.config = Config.get_conf(self, 2711759130, force_registration=True)
|
||||||
|
|||||||
@ -25,7 +25,6 @@ class AlreadyExists(CCError):
|
|||||||
|
|
||||||
|
|
||||||
class CommandObj:
|
class CommandObj:
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
config = kwargs.get("config")
|
config = kwargs.get("config")
|
||||||
self.bot = kwargs.get("bot")
|
self.bot = kwargs.get("bot")
|
||||||
|
|||||||
@ -17,7 +17,6 @@ REPO_INSTALL_MSG = (
|
|||||||
|
|
||||||
|
|
||||||
def install_agreement():
|
def install_agreement():
|
||||||
|
|
||||||
async def pred(ctx: commands.Context):
|
async def pred(ctx: commands.Context):
|
||||||
downloader = ctx.command.instance
|
downloader = ctx.command.instance
|
||||||
if downloader is None:
|
if downloader is None:
|
||||||
|
|||||||
@ -5,7 +5,6 @@ from .installable import Installable
|
|||||||
|
|
||||||
|
|
||||||
class InstalledCog(commands.Converter):
|
class InstalledCog(commands.Converter):
|
||||||
|
|
||||||
async def convert(self, ctx: commands.Context, arg: str) -> Installable:
|
async def convert(self, ctx: commands.Context, arg: str) -> Installable:
|
||||||
downloader = ctx.bot.get_cog("Downloader")
|
downloader = ctx.bot.get_cog("Downloader")
|
||||||
if downloader is None:
|
if downloader is None:
|
||||||
|
|||||||
@ -27,7 +27,6 @@ _ = Translator("Downloader", __file__)
|
|||||||
|
|
||||||
@cog_i18n(_)
|
@cog_i18n(_)
|
||||||
class Downloader:
|
class Downloader:
|
||||||
|
|
||||||
def __init__(self, bot: Red):
|
def __init__(self, bot: Red):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,7 @@ class DownloaderException(Exception):
|
|||||||
"""
|
"""
|
||||||
Base class for Downloader exceptions.
|
Base class for Downloader exceptions.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@ -31,6 +32,7 @@ class InvalidRepoName(DownloaderException):
|
|||||||
Throw when a repo name is invalid. Check
|
Throw when a repo name is invalid. Check
|
||||||
the message for a more detailed reason.
|
the message for a more detailed reason.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@ -39,6 +41,7 @@ class ExistingGitRepo(DownloaderException):
|
|||||||
Thrown when trying to clone into a folder where a
|
Thrown when trying to clone into a folder where a
|
||||||
git repo already exists.
|
git repo already exists.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@ -47,6 +50,7 @@ class MissingGitRepo(DownloaderException):
|
|||||||
Thrown when a git repo is expected to exist but
|
Thrown when a git repo is expected to exist but
|
||||||
does not.
|
does not.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@ -54,6 +58,7 @@ class CloningError(GitException):
|
|||||||
"""
|
"""
|
||||||
Thrown when git clone returns a non zero exit code.
|
Thrown when git clone returns a non zero exit code.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@ -62,6 +67,7 @@ class CurrentHashError(GitException):
|
|||||||
Thrown when git returns a non zero exit code attempting
|
Thrown when git returns a non zero exit code attempting
|
||||||
to determine the current commit hash.
|
to determine the current commit hash.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@ -70,6 +76,7 @@ class HardResetError(GitException):
|
|||||||
Thrown when there is an issue trying to execute a hard reset
|
Thrown when there is an issue trying to execute a hard reset
|
||||||
(usually prior to a repo update).
|
(usually prior to a repo update).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@ -77,6 +84,7 @@ class UpdateError(GitException):
|
|||||||
"""
|
"""
|
||||||
Thrown when git pull returns a non zero error code.
|
Thrown when git pull returns a non zero error code.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@ -84,6 +92,7 @@ class GitDiffError(GitException):
|
|||||||
"""
|
"""
|
||||||
Thrown when a git diff fails.
|
Thrown when a git diff fails.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@ -91,4 +100,5 @@ class PipError(DownloaderException):
|
|||||||
"""
|
"""
|
||||||
Thrown when pip returns a non-zero return code.
|
Thrown when pip returns a non-zero return code.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@ -495,7 +495,6 @@ class Repo(RepoJSONMixin):
|
|||||||
|
|
||||||
|
|
||||||
class RepoManager:
|
class RepoManager:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
||||||
self._repos = {}
|
self._repos = {}
|
||||||
|
|||||||
@ -74,7 +74,6 @@ SLOT_PAYOUTS_MSG = _(
|
|||||||
|
|
||||||
|
|
||||||
def guild_only_check():
|
def guild_only_check():
|
||||||
|
|
||||||
async def pred(ctx: commands.Context):
|
async def pred(ctx: commands.Context):
|
||||||
if await bank.is_global():
|
if await bank.is_global():
|
||||||
return True
|
return True
|
||||||
@ -87,7 +86,6 @@ def guild_only_check():
|
|||||||
|
|
||||||
|
|
||||||
class SetParser:
|
class SetParser:
|
||||||
|
|
||||||
def __init__(self, argument):
|
def __init__(self, argument):
|
||||||
allowed = ("+", "-")
|
allowed = ("+", "-")
|
||||||
self.sum = int(argument)
|
self.sum = int(argument)
|
||||||
|
|||||||
@ -21,7 +21,6 @@ class RPS(Enum):
|
|||||||
|
|
||||||
|
|
||||||
class RPSParser:
|
class RPSParser:
|
||||||
|
|
||||||
def __init__(self, argument):
|
def __init__(self, argument):
|
||||||
argument = argument.lower()
|
argument = argument.lower()
|
||||||
if argument == "rock":
|
if argument == "rock":
|
||||||
|
|||||||
@ -13,6 +13,7 @@ GIPHY_API_KEY = "dc6zaTOxFJmzC"
|
|||||||
@cog_i18n(_)
|
@cog_i18n(_)
|
||||||
class Image:
|
class Image:
|
||||||
"""Image related commands."""
|
"""Image related commands."""
|
||||||
|
|
||||||
default_global = {"imgur_client_id": None}
|
default_global = {"imgur_client_id": None}
|
||||||
|
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
|
|||||||
@ -3,7 +3,6 @@ import discord
|
|||||||
|
|
||||||
|
|
||||||
def mod_or_voice_permissions(**perms):
|
def mod_or_voice_permissions(**perms):
|
||||||
|
|
||||||
async def pred(ctx: commands.Context):
|
async def pred(ctx: commands.Context):
|
||||||
author = ctx.author
|
author = ctx.author
|
||||||
guild = ctx.guild
|
guild = ctx.guild
|
||||||
@ -31,7 +30,6 @@ def mod_or_voice_permissions(**perms):
|
|||||||
|
|
||||||
|
|
||||||
def admin_or_voice_permissions(**perms):
|
def admin_or_voice_permissions(**perms):
|
||||||
|
|
||||||
async def pred(ctx: commands.Context):
|
async def pred(ctx: commands.Context):
|
||||||
author = ctx.author
|
author = ctx.author
|
||||||
guild = ctx.guild
|
guild = ctx.guild
|
||||||
@ -54,7 +52,6 @@ def admin_or_voice_permissions(**perms):
|
|||||||
|
|
||||||
|
|
||||||
def bot_has_voice_permissions(**perms):
|
def bot_has_voice_permissions(**perms):
|
||||||
|
|
||||||
async def pred(ctx: commands.Context):
|
async def pred(ctx: commands.Context):
|
||||||
guild = ctx.guild
|
guild = ctx.guild
|
||||||
for vc in guild.voice_channels:
|
for vc in guild.voice_channels:
|
||||||
|
|||||||
@ -3,7 +3,6 @@ from typing import Tuple
|
|||||||
|
|
||||||
|
|
||||||
class CogOrCommand(commands.Converter):
|
class CogOrCommand(commands.Converter):
|
||||||
|
|
||||||
async def convert(self, ctx: commands.Context, arg: str) -> Tuple[str]:
|
async def convert(self, ctx: commands.Context, arg: str) -> Tuple[str]:
|
||||||
ret = ctx.bot.get_cog(arg)
|
ret = ctx.bot.get_cog(arg)
|
||||||
if ret:
|
if ret:
|
||||||
@ -16,7 +15,6 @@ class CogOrCommand(commands.Converter):
|
|||||||
|
|
||||||
|
|
||||||
class RuleType(commands.Converter):
|
class RuleType(commands.Converter):
|
||||||
|
|
||||||
async def convert(self, ctx: commands.Context, arg: str) -> str:
|
async def convert(self, ctx: commands.Context, arg: str) -> str:
|
||||||
if arg.lower() in ("allow", "whitelist", "allowed"):
|
if arg.lower() in ("allow", "whitelist", "allowed"):
|
||||||
return "allow"
|
return "allow"
|
||||||
|
|||||||
@ -30,7 +30,6 @@ def rnd(url):
|
|||||||
|
|
||||||
|
|
||||||
class TwitchCommunity:
|
class TwitchCommunity:
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
self.name = kwargs.pop("name")
|
self.name = kwargs.pop("name")
|
||||||
self.id = kwargs.pop("id", None)
|
self.id = kwargs.pop("id", None)
|
||||||
@ -119,7 +118,6 @@ class TwitchCommunity:
|
|||||||
|
|
||||||
|
|
||||||
class Stream:
|
class Stream:
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
self.name = kwargs.pop("name", None)
|
self.name = kwargs.pop("name", None)
|
||||||
self.channels = kwargs.pop("channels", [])
|
self.channels = kwargs.pop("channels", [])
|
||||||
@ -148,7 +146,6 @@ class Stream:
|
|||||||
|
|
||||||
|
|
||||||
class YoutubeStream(Stream):
|
class YoutubeStream(Stream):
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
self.id = kwargs.pop("id", None)
|
self.id = kwargs.pop("id", None)
|
||||||
self._token = kwargs.pop("token", None)
|
self._token = kwargs.pop("token", None)
|
||||||
@ -213,7 +210,6 @@ class YoutubeStream(Stream):
|
|||||||
|
|
||||||
|
|
||||||
class TwitchStream(Stream):
|
class TwitchStream(Stream):
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
self.id = kwargs.pop("id", None)
|
self.id = kwargs.pop("id", None)
|
||||||
self._token = kwargs.pop("token", None)
|
self._token = kwargs.pop("token", None)
|
||||||
@ -288,7 +284,6 @@ class TwitchStream(Stream):
|
|||||||
|
|
||||||
|
|
||||||
class HitboxStream(Stream):
|
class HitboxStream(Stream):
|
||||||
|
|
||||||
async def is_online(self):
|
async def is_online(self):
|
||||||
url = "https://api.hitbox.tv/media/live/" + self.name
|
url = "https://api.hitbox.tv/media/live/" + self.name
|
||||||
|
|
||||||
@ -326,7 +321,6 @@ class HitboxStream(Stream):
|
|||||||
|
|
||||||
|
|
||||||
class MixerStream(Stream):
|
class MixerStream(Stream):
|
||||||
|
|
||||||
async def is_online(self):
|
async def is_online(self):
|
||||||
url = "https://mixer.com/api/v1/channels/" + self.name
|
url = "https://mixer.com/api/v1/channels/" + self.name
|
||||||
|
|
||||||
@ -368,7 +362,6 @@ class MixerStream(Stream):
|
|||||||
|
|
||||||
|
|
||||||
class PicartoStream(Stream):
|
class PicartoStream(Stream):
|
||||||
|
|
||||||
async def is_online(self):
|
async def is_online(self):
|
||||||
url = "https://api.picarto.tv/v1/channel/name/" + self.name
|
url = "https://api.picarto.tv/v1/channel/name/" + self.name
|
||||||
|
|
||||||
|
|||||||
@ -18,6 +18,7 @@ UNIQUE_ID = 0xb3c0e453
|
|||||||
|
|
||||||
class InvalidListError(Exception):
|
class InvalidListError(Exception):
|
||||||
"""A Trivia list file is in invalid format."""
|
"""A Trivia list file is in invalid format."""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,6 @@ __all__ = ["Config", "__version__"]
|
|||||||
|
|
||||||
|
|
||||||
class VersionInfo:
|
class VersionInfo:
|
||||||
|
|
||||||
def __init__(self, major, minor, micro, releaselevel, serial):
|
def __init__(self, major, minor, micro, releaselevel, serial):
|
||||||
self._levels = ["alpha", "beta", "final"]
|
self._levels = ["alpha", "beta", "final"]
|
||||||
self.major = major
|
self.major = major
|
||||||
|
|||||||
@ -16,7 +16,6 @@ async def check_overrides(ctx, *, level):
|
|||||||
|
|
||||||
|
|
||||||
def is_owner(**kwargs):
|
def is_owner(**kwargs):
|
||||||
|
|
||||||
async def check(ctx):
|
async def check(ctx):
|
||||||
override = await check_overrides(ctx, level="owner")
|
override = await check_overrides(ctx, level="owner")
|
||||||
return override if override is not None else await ctx.bot.is_owner(ctx.author, **kwargs)
|
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):
|
def mod_or_permissions(**perms):
|
||||||
|
|
||||||
async def predicate(ctx):
|
async def predicate(ctx):
|
||||||
override = await check_overrides(ctx, level="mod")
|
override = await check_overrides(ctx, level="mod")
|
||||||
return (
|
return (
|
||||||
@ -86,7 +84,6 @@ def mod_or_permissions(**perms):
|
|||||||
|
|
||||||
|
|
||||||
def admin_or_permissions(**perms):
|
def admin_or_permissions(**perms):
|
||||||
|
|
||||||
async def predicate(ctx):
|
async def predicate(ctx):
|
||||||
override = await check_overrides(ctx, level="admin")
|
override = await check_overrides(ctx, level="admin")
|
||||||
return (
|
return (
|
||||||
@ -99,7 +96,6 @@ def admin_or_permissions(**perms):
|
|||||||
|
|
||||||
|
|
||||||
def bot_in_a_guild(**kwargs):
|
def bot_in_a_guild(**kwargs):
|
||||||
|
|
||||||
async def predicate(ctx):
|
async def predicate(ctx):
|
||||||
return len(ctx.bot.guilds) > 0
|
return len(ctx.bot.guilds) > 0
|
||||||
|
|
||||||
@ -107,7 +103,6 @@ def bot_in_a_guild(**kwargs):
|
|||||||
|
|
||||||
|
|
||||||
def guildowner_or_permissions(**perms):
|
def guildowner_or_permissions(**perms):
|
||||||
|
|
||||||
async def predicate(ctx):
|
async def predicate(ctx):
|
||||||
has_perms_or_is_owner = await check_permissions(ctx, perms)
|
has_perms_or_is_owner = await check_permissions(ctx, perms)
|
||||||
if ctx.guild is None:
|
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
|
This class inherits from `discord.ext.commands.Group`, with `Command` mixed
|
||||||
in.
|
in.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -441,6 +441,7 @@ class Config:
|
|||||||
attempting to access data.
|
attempting to access data.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
GLOBAL = "GLOBAL"
|
GLOBAL = "GLOBAL"
|
||||||
GUILD = "GUILD"
|
GUILD = "GUILD"
|
||||||
CHANNEL = "TEXTCHANNEL"
|
CHANNEL = "TEXTCHANNEL"
|
||||||
|
|||||||
@ -2,7 +2,6 @@ __all__ = ["BaseDriver"]
|
|||||||
|
|
||||||
|
|
||||||
class BaseDriver:
|
class BaseDriver:
|
||||||
|
|
||||||
def __init__(self, cog_name, identifier):
|
def __init__(self, cog_name, identifier):
|
||||||
self.cog_name = cog_name
|
self.cog_name = cog_name
|
||||||
self.unique_cog_identifier = identifier
|
self.unique_cog_identifier = identifier
|
||||||
|
|||||||
@ -49,7 +49,6 @@ def should_log_sentry(exception) -> bool:
|
|||||||
|
|
||||||
|
|
||||||
def init_events(bot, cli_flags):
|
def init_events(bot, cli_flags):
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_connect():
|
async def on_connect():
|
||||||
if bot.uptime is None:
|
if bot.uptime is None:
|
||||||
|
|||||||
@ -3,7 +3,6 @@ from . import commands
|
|||||||
|
|
||||||
|
|
||||||
def init_global_checks(bot):
|
def init_global_checks(bot):
|
||||||
|
|
||||||
@bot.check
|
@bot.check
|
||||||
async def global_perms(ctx):
|
async def global_perms(ctx):
|
||||||
"""Check the user is/isn't globally whitelisted/blacklisted."""
|
"""Check the user is/isn't globally whitelisted/blacklisted."""
|
||||||
|
|||||||
@ -89,7 +89,6 @@ methods = Methods()
|
|||||||
|
|
||||||
|
|
||||||
class BaseRPCMethodMixin:
|
class BaseRPCMethodMixin:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
methods.add(self.all_methods, name="all_methods")
|
methods.add(self.all_methods, name="all_methods")
|
||||||
|
|
||||||
|
|||||||
@ -18,6 +18,7 @@ class AntiSpam:
|
|||||||
Where quantity represents the maximum amount of times
|
Where quantity represents the maximum amount of times
|
||||||
something should be allowed in an interval.
|
something should be allowed in an interval.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# TODO : Decorator interface for command check using `spammy`
|
# TODO : Decorator interface for command check using `spammy`
|
||||||
# with insertion of the antispam element into context
|
# with insertion of the antispam element into context
|
||||||
# for manual stamping on succesful command completion
|
# for manual stamping on succesful command completion
|
||||||
|
|||||||
2
setup.py
2
setup.py
@ -113,6 +113,6 @@ setup(
|
|||||||
"mongo": ["motor"],
|
"mongo": ["motor"],
|
||||||
"docs": ["sphinx>=1.7", "sphinxcontrib-asyncio", "sphinx_rtd_theme"],
|
"docs": ["sphinx>=1.7", "sphinxcontrib-asyncio", "sphinx_rtd_theme"],
|
||||||
"voice": ["red-lavalink>=0.0.4"],
|
"voice": ["red-lavalink>=0.0.4"],
|
||||||
"style": ["black"],
|
"style": ["black==18.5b1"],
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
@ -25,7 +25,6 @@ async def fake_run_noprint(*args, **kwargs):
|
|||||||
|
|
||||||
@pytest.fixture(scope="module", autouse=True)
|
@pytest.fixture(scope="module", autouse=True)
|
||||||
def patch_relative_to(monkeysession):
|
def patch_relative_to(monkeysession):
|
||||||
|
|
||||||
def fake_relative_to(self, some_path: Path):
|
def fake_relative_to(self, some_path: Path):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,6 @@ def override_data_path(tmpdir):
|
|||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
def coroutine():
|
def coroutine():
|
||||||
|
|
||||||
async def some_coro(*args, **kwargs):
|
async def some_coro(*args, **kwargs):
|
||||||
return args, kwargs
|
return args, kwargs
|
||||||
|
|
||||||
@ -74,7 +73,6 @@ def guild_factory():
|
|||||||
mock_guild = namedtuple("Guild", "id members")
|
mock_guild = namedtuple("Guild", "id members")
|
||||||
|
|
||||||
class GuildFactory:
|
class GuildFactory:
|
||||||
|
|
||||||
def get(self):
|
def get(self):
|
||||||
return mock_guild(random.randint(1, 999999999), [])
|
return mock_guild(random.randint(1, 999999999), [])
|
||||||
|
|
||||||
@ -103,7 +101,6 @@ def member_factory(guild_factory):
|
|||||||
mock_member = namedtuple("Member", "id guild display_name")
|
mock_member = namedtuple("Member", "id guild display_name")
|
||||||
|
|
||||||
class MemberFactory:
|
class MemberFactory:
|
||||||
|
|
||||||
def get(self):
|
def get(self):
|
||||||
return mock_member(random.randint(1, 999999999), guild_factory.get(), "Testing_Name")
|
return mock_member(random.randint(1, 999999999), guild_factory.get(), "Testing_Name")
|
||||||
|
|
||||||
@ -120,7 +117,6 @@ def user_factory():
|
|||||||
mock_user = namedtuple("User", "id")
|
mock_user = namedtuple("User", "id")
|
||||||
|
|
||||||
class UserFactory:
|
class UserFactory:
|
||||||
|
|
||||||
def get(self):
|
def get(self):
|
||||||
return mock_user(random.randint(1, 999999999))
|
return mock_user(random.randint(1, 999999999))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user