From e3b73a6237c603b672ab1ad98fb78ad967d7c607 Mon Sep 17 00:00:00 2001 From: Myned Date: Tue, 17 Sep 2019 02:56:22 -0400 Subject: [PATCH] Convert to discord.py main release --- Pipfile | 3 +-- src/cogs/booru.py | 2 +- src/cogs/info.py | 2 +- src/cogs/management.py | 2 +- src/cogs/owner.py | 4 ++-- src/cogs/periodic.py | 2 +- src/cogs/tools.py | 2 +- src/run.py | 13 ++++++------- 8 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Pipfile b/Pipfile index 93f0340..c08f897 100644 --- a/Pipfile +++ b/Pipfile @@ -17,10 +17,9 @@ verify_ssl = true [packages] beautifulsoup4 = "*" -"discord.py" = {extras = ["voice"],git = "https://github.com/Rapptz/discord.py",ref = "rewrite"} +"discord.py" = {extras = ["voice"],git = "https://github.com/Rapptz/discord.py"} "hurry.filesize" = "*" requests = "*" [dev-packages] lxml = "*" - diff --git a/src/cogs/booru.py b/src/cogs/booru.py index f23b954..139258a 100644 --- a/src/cogs/booru.py +++ b/src/cogs/booru.py @@ -21,7 +21,7 @@ from utils import utils as u from utils import formatter, scraper -class MsG: +class MsG(cmds.Cog): def __init__(self, bot): self.bot = bot diff --git a/src/cogs/info.py b/src/cogs/info.py index c7047b3..ef741eb 100644 --- a/src/cogs/info.py +++ b/src/cogs/info.py @@ -8,7 +8,7 @@ from misc import exceptions as exc from utils import utils as u -class Info: +class Info(cmds.Cog): def __init__(self, bot): self.bot = bot diff --git a/src/cogs/management.py b/src/cogs/management.py index 8ece868..8c70268 100644 --- a/src/cogs/management.py +++ b/src/cogs/management.py @@ -13,7 +13,7 @@ from misc import checks from utils import utils as u -class Administration: +class Admin(cmds.Cog): def __init__(self, bot): self.bot = bot diff --git a/src/cogs/owner.py b/src/cogs/owner.py index 90691f2..59b2547 100644 --- a/src/cogs/owner.py +++ b/src/cogs/owner.py @@ -16,7 +16,7 @@ from utils import utils as u from utils import formatter -class Bot: +class Bot(cmds.Cog): def __init__(self, bot): self.bot = bot @@ -182,7 +182,7 @@ class Bot: await u.add_reaction(ctx.message, '\N{CROSS MARK}') -class Tools: +class Tools(cmds.Cog): def __init__(self, bot): self.bot = bot diff --git a/src/cogs/periodic.py b/src/cogs/periodic.py index 40b328f..000c1bb 100644 --- a/src/cogs/periodic.py +++ b/src/cogs/periodic.py @@ -12,7 +12,7 @@ from misc import checks from utils import utils as u -class Post: +class Post(cmds.Cog): def __init__(self, bot): self.bot = bot diff --git a/src/cogs/tools.py b/src/cogs/tools.py index 5f664b1..c3afb10 100644 --- a/src/cogs/tools.py +++ b/src/cogs/tools.py @@ -21,7 +21,7 @@ youtube = None tempfile.tempdir = os.getcwd() -class Utils: +class Utils(cmds.Cog): def __init__(self, bot): self.bot = bot diff --git a/src/run.py b/src/run.py index b430bcc..e802ce8 100644 --- a/src/run.py +++ b/src/run.py @@ -26,8 +26,7 @@ bot = cmds.Bot( command_prefix=get_prefix, self_bot=u.config['selfbot'], description='Modufur - A booru bot with a side of management and automated tasking' - '\nMade by @Myned#3985', - help_attrs={'aliases': ['h']}, pm_help=None) + '\nMade by @Myned#3985') @bot.event @@ -39,7 +38,7 @@ async def on_ready(): tools.Utils(bot), owner.Bot(bot), owner.Tools(bot), - management.Administration(bot), + management.Admin(bot), info.Info(bot), booru.MsG(bot)): bot.add_cog(cog) @@ -60,7 +59,7 @@ async def on_ready(): ctx = bot.get_channel(u.temp['startup'][1]) else: ctx = bot.get_user(u.temp['startup'][1]) - message = await ctx.get_message(u.temp['startup'][2]) + message = await ctx.fetch_message(u.temp['startup'][2]) await message.add_reaction('\N{WHITE HEAVY CHECK MARK}') @@ -80,10 +79,10 @@ async def on_ready(): if u.tasks['auto_del']: for channel in u.tasks['auto_del']: temp = bot.get_channel(channel) - bot.loop.create_task(u.cogs['Administration'].queue_for_deletion(temp)) + bot.loop.create_task(u.cogs['Admin'].queue_for_deletion(temp)) print(f'RESTARTED : auto-deleting in #{temp.name}') - u.cogs['Administration'].deleting = True - bot.loop.create_task(u.cogs['Administration'].delete()) + u.cogs['Admin'].deleting = True + bot.loop.create_task(u.cogs['Admin'].delete()) if u.config['playing'] is not '': await bot.change_presence(activity=d.Game(u.config['playing']))