Skip to content

Commit

Permalink
added typing indicator to actions with potentially long wait times
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Jan 17, 2024
1 parent f311463 commit eb88865
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions bruhbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,18 @@ async def on_message(msg):
or bot.user in msg.mentions
or (msg.reference is not None and msg.reference.resolved.author == bot.user)
):
responses = []
with open(f"{here}\\bruhbot\\responses.txt", "r", encoding="utf-8") as f:
for line in f:
current = line[:-1]
responses.append(current)
response = random.choice(responses).replace(r"\n", "\n")
if response.endswith("- image"):
await send_image(ctx, response)
async with ctx.typing():
responses = []
with open(f"{here}\\bruhbot\\responses.txt", "r", encoding="utf-8") as f:
for line in f:
current = line[:-1]
responses.append(current)
response = random.choice(responses).replace(r"\n", "\n")
if response.endswith("- image"):
await send_image(ctx, response)
return
await ctx.send(response)
return
await ctx.send(response)
return
if "69" in nospace:
await ctx.send("nice") # nice
return
Expand Down Expand Up @@ -181,7 +182,8 @@ async def addr(ctx, *, arg: str = None):
dupe = True
break
if dupe is False:
await attachment.save(f"{here}\\images\\{pre}")
async with ctx.typing():
await attachment.save(f"{here}\\images\\{pre}")
else:
continue
with open(
Expand Down

0 comments on commit eb88865

Please sign in to comment.