1
0
mirror of https://gitlab.com/simple-stock-bots/simple-discord-stock-bot.git synced 2025-08-01 02:51:23 +00:00

added typing to commands that take longer

This commit is contained in:
2021-02-12 20:55:50 -07:00
parent fb13517a7d
commit f54f0cc04e

3
bot.py
View File

@@ -132,6 +132,7 @@ async def crypto(ctx, symbol: str):
@bot.command()
async def intra(ctx, sym: str):
"""Get a chart for the stocks movement since market open."""
with ctx.channel.typing():
symbol = s.find_symbols(sym)[0]
@@ -171,6 +172,7 @@ async def intra(ctx, sym: str):
@bot.command()
async def chart(ctx, sym: str):
"""Get a chart for the stocks movement for the past month."""
with ctx.channel.typing():
symbol = s.find_symbols(sym)[0]
@@ -178,7 +180,6 @@ async def chart(ctx, sym: str):
if df.empty:
await ctx.send("Invalid symbol please see `/help` for usage details.")
return
buf = io.BytesIO()
mpf.plot(
df,