from discord.ext import commands
from lib.parse_data import get_covid_data, get_top_data
@commands.command()
async def ping(ctx):
await ctx.send('pong')
async def report(ctx, arg):
if(arg):
print('Got command.')
try:
await ctx.send(get_covid_data(arg.upper()))
except Exception as e:
await ctx.send(f'{e}')
async def top(ctx, arg='5'):
num = int(arg)
await ctx.send(f'{arg} isn\'t a number.')
return
await ctx.send(get_top_data(num))
def add_commands(bot):
bot.add_command(ping)
bot.add_command(report)
bot.add_command(top)