generated from HoloTech/holotech-plugin-template
Rough Campaign module skeleton.
This commit is contained in:
@@ -6,6 +6,6 @@ if TYPE_CHECKING:
|
||||
|
||||
|
||||
async def setup(bot: "Bot"):
|
||||
from .component import AwesomeComponent
|
||||
from .component import CampaignComponent
|
||||
|
||||
await bot.add_component(AwesomeComponent(bot))
|
||||
await bot.add_component(CampaignComponent(bot))
|
||||
|
||||
@@ -10,22 +10,22 @@ from utils.lib import utc_now
|
||||
|
||||
from . import logger
|
||||
|
||||
from ..data import AwesomeData
|
||||
from ..awesome import AwesomeRegistry
|
||||
from ..data import CampaignData
|
||||
from ..campaign import CampaignRegistry
|
||||
|
||||
|
||||
class AwesomeComponent(cmds.Component):
|
||||
class CampaignComponent(cmds.Component):
|
||||
def __init__(self, bot: Bot):
|
||||
self.bot = bot
|
||||
|
||||
self.data = bot.dbconn.load_registry(AwesomeData())
|
||||
self.awesome = AwesomeRegistry(self.data)
|
||||
self.data = bot.dbconn.load_registry(CampaignData())
|
||||
self.campaigns = CampaignRegistry(self.data)
|
||||
|
||||
# ----- API -----
|
||||
async def component_load(self):
|
||||
await self.data.init()
|
||||
await self.bot.version_check(*self.data.VERSION)
|
||||
await self.profiles.init()
|
||||
await self.campaigns.init()
|
||||
|
||||
async def component_teardown(self):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user