1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-12-24 14:27:27 +00:00

Merge branch 'dev'

This commit is contained in:
Myned 2017-10-13 23:59:27 -04:00
commit 7267d075ee
3 changed files with 19 additions and 18 deletions

View file

@ -2,7 +2,6 @@ import asyncio
import datetime as dt
import json
import logging
import os
import subprocess
import sys
import traceback as tb
@ -12,21 +11,20 @@ import discord as d
from discord import utils
from discord.ext import commands
from cogs import booru, info, management, owner, tools
from misc import exceptions as exc
from misc import checks
from utils import utils as u
logging.basicConfig(level=logging.INFO)
print('PID {}'.format(os.getpid()))
bot = commands.Bot(command_prefix=u.config['prefix'], description='Experimental booru bot')
# Send and print ready message to #testing and console after logon
@bot.event
async def on_ready():
from cogs import booru, info, management, owner, tools
bot.add_cog(tools.Utils(bot))
bot.add_cog(owner.Bot(bot))
bot.add_cog(owner.Tools(bot))

View file

@ -1,9 +1,23 @@
import asyncio
import json
import os
import pickle as pkl
import aiohttp as aio
print('PID {}'.format(os.getpid()))
try:
with open('config.json') as infile:
config = json.load(infile)
print('\"config.json\" loaded.')
except FileNotFoundError:
with open('config.json', 'w') as outfile:
json.dump({'client_id': 0, 'listed_ids': [0], 'owner_id': 0, 'permissions': 126016, 'prefix': ',',
'shutdown_channel': 0, 'startup_channel': 0, 'token': 'str'}, outfile, indent=4, sort_keys=True)
raise FileNotFoundError(
'Config file not found: \"config.json\" created with abstract values. Restart \"run.py\" with correct values.')
def setdefault(filename, default=None):
try:
@ -30,17 +44,6 @@ def dump(obj, filename):
tasks = setdefault('./cogs/tasks.pkl', {})
try:
with open('config.json') as infile:
config = json.load(infile)
print('\"config.json\" loaded.')
except FileNotFoundError:
with open('config.json', 'w') as outfile:
json.dump({'client_id': 0, 'listed_ids': [0], 'owner_id': 0, 'permissions': 126016, 'prefix': ',',
'shutdown_channel': 0, 'startup_channel': 0, 'token': 'str'}, outfile, indent=4, sort_keys=True)
raise FileNotFoundError(
'Config file not found: \"config.json\" created with abstract values. Restart \"run.py\" with correct values.')
async def clear(obj, interval=10 * 60, replace=None):
if replace is None: