Convert State to global
This was just getting too painful to manage, especially passing around these state objects
This commit is contained in:
parent
f926a36069
commit
69005ef498
7 changed files with 69 additions and 71 deletions
|
@ -5,13 +5,9 @@ import logging
|
|||
import discord
|
||||
from discord.ext import commands
|
||||
import os
|
||||
from matchy.state import load_from_file
|
||||
import matchy.cogs.matcher
|
||||
import matchy.cogs.owner
|
||||
|
||||
_STATE_FILE = ".matchy/state.json"
|
||||
state = load_from_file(_STATE_FILE)
|
||||
|
||||
logger = logging.getLogger("matchy")
|
||||
logger.setLevel(logging.INFO)
|
||||
|
||||
|
@ -24,8 +20,8 @@ bot = commands.Bot(command_prefix='$',
|
|||
|
||||
@bot.event
|
||||
async def setup_hook():
|
||||
await bot.add_cog(matchy.cogs.matcher.MatcherCog(bot, state))
|
||||
await bot.add_cog(matchy.cogs.owner.OwnerCog(bot, state))
|
||||
await bot.add_cog(matchy.cogs.matcher.MatcherCog(bot))
|
||||
await bot.add_cog(matchy.cogs.owner.OwnerCog(bot))
|
||||
|
||||
|
||||
@bot.event
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue