wow-token-app-bot/token_bot/core.py
2024-12-16 14:45:49 -08:00

37 lines
1.1 KiB
Python

import logging
import aiohttp
from interactions import Extension, is_owner, check
from interactions import slash_command, listen
from interactions.api.events import Startup
from token_bot.token_database import database as pdb
from token_bot.token_database import database as tdb
VERSION = "0.9.3"
class Core(Extension):
def __init__(self, bot):
self._tdb: tdb.Database | None = None
self._pdb: pdb.Database | None = None
@listen(Startup)
async def on_start(self):
self.bot.logger.log(logging.INFO, "TokenBot Core ready")
self.bot.logger.log(logging.INFO, f"This is bot version {VERSION}")
self._tdb = tdb.Database(aiohttp.ClientSession())
@slash_command()
@check(is_owner())
async def version(self, ctx):
await ctx.send(f"This is bot version {VERSION}", ephemeral=True)
@slash_command()
async def help(self, ctx):
await ctx.send(
f"For help on using GoblinBot, please visit the help page found "
f"[here](https://blog.emily.sh/token-bot/#getting-started)",
ephemeral=True,
)