mirror of
https://github.com/myned/modufur.git
synced 2024-11-01 21:02:38 +00:00
Convert to discord.py main release
This commit is contained in:
parent
1a014d4e65
commit
e3b73a6237
8 changed files with 14 additions and 16 deletions
3
Pipfile
3
Pipfile
|
@ -17,10 +17,9 @@ verify_ssl = true
|
||||||
|
|
||||||
[packages]
|
[packages]
|
||||||
beautifulsoup4 = "*"
|
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" = "*"
|
"hurry.filesize" = "*"
|
||||||
requests = "*"
|
requests = "*"
|
||||||
|
|
||||||
[dev-packages]
|
[dev-packages]
|
||||||
lxml = "*"
|
lxml = "*"
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ from utils import utils as u
|
||||||
from utils import formatter, scraper
|
from utils import formatter, scraper
|
||||||
|
|
||||||
|
|
||||||
class MsG:
|
class MsG(cmds.Cog):
|
||||||
|
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
|
@ -8,7 +8,7 @@ from misc import exceptions as exc
|
||||||
from utils import utils as u
|
from utils import utils as u
|
||||||
|
|
||||||
|
|
||||||
class Info:
|
class Info(cmds.Cog):
|
||||||
|
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
|
@ -13,7 +13,7 @@ from misc import checks
|
||||||
from utils import utils as u
|
from utils import utils as u
|
||||||
|
|
||||||
|
|
||||||
class Administration:
|
class Admin(cmds.Cog):
|
||||||
|
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
|
@ -16,7 +16,7 @@ from utils import utils as u
|
||||||
from utils import formatter
|
from utils import formatter
|
||||||
|
|
||||||
|
|
||||||
class Bot:
|
class Bot(cmds.Cog):
|
||||||
|
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
@ -182,7 +182,7 @@ class Bot:
|
||||||
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
await u.add_reaction(ctx.message, '\N{CROSS MARK}')
|
||||||
|
|
||||||
|
|
||||||
class Tools:
|
class Tools(cmds.Cog):
|
||||||
|
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
|
@ -12,7 +12,7 @@ from misc import checks
|
||||||
from utils import utils as u
|
from utils import utils as u
|
||||||
|
|
||||||
|
|
||||||
class Post:
|
class Post(cmds.Cog):
|
||||||
|
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
|
@ -21,7 +21,7 @@ youtube = None
|
||||||
tempfile.tempdir = os.getcwd()
|
tempfile.tempdir = os.getcwd()
|
||||||
|
|
||||||
|
|
||||||
class Utils:
|
class Utils(cmds.Cog):
|
||||||
|
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
13
src/run.py
13
src/run.py
|
@ -26,8 +26,7 @@ bot = cmds.Bot(
|
||||||
command_prefix=get_prefix,
|
command_prefix=get_prefix,
|
||||||
self_bot=u.config['selfbot'],
|
self_bot=u.config['selfbot'],
|
||||||
description='Modufur - A booru bot with a side of management and automated tasking'
|
description='Modufur - A booru bot with a side of management and automated tasking'
|
||||||
'\nMade by @Myned#3985',
|
'\nMade by @Myned#3985')
|
||||||
help_attrs={'aliases': ['h']}, pm_help=None)
|
|
||||||
|
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
|
@ -39,7 +38,7 @@ async def on_ready():
|
||||||
tools.Utils(bot),
|
tools.Utils(bot),
|
||||||
owner.Bot(bot),
|
owner.Bot(bot),
|
||||||
owner.Tools(bot),
|
owner.Tools(bot),
|
||||||
management.Administration(bot),
|
management.Admin(bot),
|
||||||
info.Info(bot),
|
info.Info(bot),
|
||||||
booru.MsG(bot)):
|
booru.MsG(bot)):
|
||||||
bot.add_cog(cog)
|
bot.add_cog(cog)
|
||||||
|
@ -60,7 +59,7 @@ async def on_ready():
|
||||||
ctx = bot.get_channel(u.temp['startup'][1])
|
ctx = bot.get_channel(u.temp['startup'][1])
|
||||||
else:
|
else:
|
||||||
ctx = bot.get_user(u.temp['startup'][1])
|
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}')
|
await message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
|
@ -80,10 +79,10 @@ async def on_ready():
|
||||||
if u.tasks['auto_del']:
|
if u.tasks['auto_del']:
|
||||||
for channel in u.tasks['auto_del']:
|
for channel in u.tasks['auto_del']:
|
||||||
temp = bot.get_channel(channel)
|
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}')
|
print(f'RESTARTED : auto-deleting in #{temp.name}')
|
||||||
u.cogs['Administration'].deleting = True
|
u.cogs['Admin'].deleting = True
|
||||||
bot.loop.create_task(u.cogs['Administration'].delete())
|
bot.loop.create_task(u.cogs['Admin'].delete())
|
||||||
|
|
||||||
if u.config['playing'] is not '':
|
if u.config['playing'] is not '':
|
||||||
await bot.change_presence(activity=d.Game(u.config['playing']))
|
await bot.change_presence(activity=d.Game(u.config['playing']))
|
||||||
|
|
Loading…
Reference in a new issue