mirror of
https://gitlab.com/simple-stock-bots/simple-discord-stock-bot.git
synced 2025-08-01 19:11:34 +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()
|
@bot.command()
|
||||||
async def intra(ctx, sym: str):
|
async def intra(ctx, sym: str):
|
||||||
"""Get a chart for the stocks movement since market open."""
|
"""Get a chart for the stocks movement since market open."""
|
||||||
|
with ctx.channel.typing():
|
||||||
|
|
||||||
symbol = s.find_symbols(sym)[0]
|
symbol = s.find_symbols(sym)[0]
|
||||||
|
|
||||||
@@ -171,6 +172,7 @@ async def intra(ctx, sym: str):
|
|||||||
@bot.command()
|
@bot.command()
|
||||||
async def chart(ctx, sym: str):
|
async def chart(ctx, sym: str):
|
||||||
"""Get a chart for the stocks movement for the past month."""
|
"""Get a chart for the stocks movement for the past month."""
|
||||||
|
with ctx.channel.typing():
|
||||||
|
|
||||||
symbol = s.find_symbols(sym)[0]
|
symbol = s.find_symbols(sym)[0]
|
||||||
|
|
||||||
@@ -178,7 +180,6 @@ async def chart(ctx, sym: str):
|
|||||||
if df.empty:
|
if df.empty:
|
||||||
await ctx.send("Invalid symbol please see `/help` for usage details.")
|
await ctx.send("Invalid symbol please see `/help` for usage details.")
|
||||||
return
|
return
|
||||||
|
|
||||||
buf = io.BytesIO()
|
buf = io.BytesIO()
|
||||||
mpf.plot(
|
mpf.plot(
|
||||||
df,
|
df,
|
||||||
|
Reference in New Issue
Block a user