Update current functions to give data relevant to only the registered region
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import logging
|
||||
|
||||
import aiohttp
|
||||
from interactions import Extension
|
||||
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.1.0"
|
||||
VERSION = "0.9.0"
|
||||
|
||||
|
||||
class Core(Extension):
|
||||
@@ -23,25 +23,10 @@ class Core(Extension):
|
||||
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"This is bot help command", ephemeral=True)
|
||||
|
||||
@slash_command(
|
||||
description="The current retail token cost"
|
||||
)
|
||||
async def current(self, ctx):
|
||||
current = await self._tdb.current(tdb.Flavor.RETAIL)
|
||||
await ctx.send(f"us: {current['us']}\neu: {current['eu']}\ntw: {current['tw']}\nkr: {current['kr']}",
|
||||
ephemeral=True)
|
||||
|
||||
@slash_command(
|
||||
description="The current classic token cost"
|
||||
)
|
||||
async def current_classic(self, ctx):
|
||||
current = await self._tdb.current(tdb.Flavor.CLASSIC)
|
||||
await ctx.send(f"us: {current['us']}\neu: {current['eu']}\ntw: {current['tw']}\nkr: {current['kr']}",
|
||||
ephemeral=True)
|
||||
|
||||
Reference in New Issue
Block a user