Fix a bunch of failed imports and types from previous changes

This commit is contained in:
Marc Di Luzio 2024-08-16 10:22:35 +01:00
parent 01e9c98d3f
commit a5d66aca4e
5 changed files with 9 additions and 9 deletions

View file

@ -24,8 +24,8 @@ bot = commands.Bot(command_prefix='$',
@bot.event @bot.event
async def setup_hook(): async def setup_hook():
await bot.add_cog(matchy.cogs.matchy.Cog(bot, state)) await bot.add_cog(matchy.cogs.matchy.MatchyCog(bot, state))
await bot.add_cog(matchy.cogs.owner.Cog(bot, state)) await bot.add_cog(matchy.cogs.owner.OwnerCog(bot, state))
@bot.event @bot.event

View file

@ -8,15 +8,15 @@ from discord.ext import commands, tasks
from datetime import datetime, timedelta, time from datetime import datetime, timedelta, time
import matchy.views.match as match import matchy.views.match as match
import matching import matchy.matching as matching
from matchy.files.state import State, AuthScope from matchy.files.state import State, AuthScope
import util import matchy.util as util
logger = logging.getLogger("cog") logger = logging.getLogger("cog")
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)
class Cog(commands.Cog): class MatchyCog(commands.Cog):
def __init__(self, bot: commands.Bot, state: State): def __init__(self, bot: commands.Bot, state: State):
self.bot = bot self.bot = bot
self.state = state self.state = state

View file

@ -9,7 +9,7 @@ logger = logging.getLogger("owner")
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)
class Cog(commands.Cog): class OwnerCog(commands.Cog):
def __init__(self, bot: commands.Bot, state: State): def __init__(self, bot: commands.Bot, state: State):
self._bot = bot self._bot = bot
self._state = state self._state = state

View file

@ -6,7 +6,7 @@ import discord
import re import re
import matchy.files.state as state import matchy.files.state as state
import matching import matchy.matching as matching
logger = logging.getLogger("match_button") logger = logging.getLogger("match_button")
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)

View file

@ -5,7 +5,7 @@ import pytest_asyncio
import matchy.files.state as state import matchy.files.state as state
import discord.ext.test as dpytest import discord.ext.test as dpytest
from matchy.cogs.owner import Cog from matchy.cogs.owner import OwnerCog
# Primarily borrowing from https://dpytest.readthedocs.io/en/latest/tutorials/using_pytest.html # Primarily borrowing from https://dpytest.readthedocs.io/en/latest/tutorials/using_pytest.html
# TODO: Test more somehow, though it seems like dpytest is pretty incomplete # TODO: Test more somehow, though it seems like dpytest is pretty incomplete
@ -20,7 +20,7 @@ async def bot():
b = commands.Bot(command_prefix="$", b = commands.Bot(command_prefix="$",
intents=intents) intents=intents)
await b._async_setup_hook() await b._async_setup_hook()
await b.add_cog(Cog(b, state.State(state._EMPTY_DICT))) await b.add_cog(OwnerCog(b, state.State(state._EMPTY_DICT)))
dpytest.configure(b) dpytest.configure(b)
yield b yield b
await dpytest.empty_queue() await dpytest.empty_queue()