From 67121365cb1e18c67d7eb14b25f46935824d7e6c Mon Sep 17 00:00:00 2001 From: Kate Date: Wed, 17 Mar 2021 01:51:26 +0000 Subject: [PATCH] Fixed string indent on stock command, and added more aliases --- main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 799782d..ea68931 100644 --- a/main.py +++ b/main.py @@ -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,19 +26,21 @@ 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( - """**{ticker}** + inspect.cleandoc( + """**{ticker}** Bid: {bid} Ask: {ask} """.format( - ticker=stock, bid=data["bid"], ask=data["ask"] + ticker=stock, bid=data["bid"], ask=data["ask"] + ) ) )