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:
3
bot.py
3
bot.py
@@ -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,
|
||||
|
Reference in New Issue
Block a user