Fixed string indent on stock command, and added more aliases

This commit is contained in:
Kate 2021-03-17 01:51:26 +00:00
parent 46838c888c
commit 67121365cb

View file

@ -5,6 +5,7 @@ from discord.ext import commands
import config as cfg
from decimal import Decimal
import typing
import inspect
if cfg.use_mongodb:
import mongo as database
@ -25,13 +26,14 @@ async def ping(ctx):
await ctx.send("pong!")
@bot.command()
@bot.command(aliases=["stock", "t", "s"])
async def ticker(ctx, stock):
user = str(ctx.message.author)
stock = stock.upper()
data = yfi.stock_info(stock)
return await ctx.send(
inspect.cleandoc(
"""**{ticker}**
Bid: {bid}
@ -40,6 +42,7 @@ async def ticker(ctx, stock):
ticker=stock, bid=data["bid"], ask=data["ask"]
)
)
)
@bot.command(aliases=["pft"])