wow-token-app-bot

An interactions.py Discord bot for getting and alerting on the WoW Token Price
git clone https://git.emily.sh/wowtoken-app/wow-token-app-bot.git
Log | Files | Refs | README | LICENSE

core.py (964B)


      1 import logging
      2 
      3 import aiohttp
      4 from interactions import Extension, is_owner, check
      5 from interactions import slash_command, listen
      6 from interactions.api.events import Startup
      7 
      8 from token_bot.token_database import database as pdb
      9 from token_bot.token_database import database as tdb
     10 
     11 VERSION = "0.9.12"
     12 
     13 
     14 class Core(Extension):
     15     def __init__(self, bot):
     16         self._tdb: tdb.Database | None = None
     17         self._pdb: pdb.Database | None = None
     18 
     19     @listen(Startup)
     20     async def on_start(self):
     21         self.bot.logger.log(logging.INFO, "TokenBot Core ready")
     22         self.bot.logger.log(logging.INFO, f"This is bot version {VERSION}")
     23         self._tdb = tdb.Database(aiohttp.ClientSession())
     24 
     25     @slash_command()
     26     async def help(self, ctx):
     27         await ctx.send(
     28             f"For help on using GoblinBot, please visit the help page found "
     29             f"[here](https://blog.emily.sh/token-bot/#getting-started)",
     30             ephemeral=True,
     31         )