Skip to content

Commit

Permalink
Moved code portion to get wanted result
Browse files Browse the repository at this point in the history
Had to mess around where to put this code portion, under or above the ctx.send, also should the lines -=1 be above or below the if break if statement. Got the wanted result.
  • Loading branch information
0n1udra committed Apr 10, 2022
1 parent 0c69a85 commit bd07d3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/slime_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,11 @@ async def chatlog(self, ctx, lines=10):
return False

for line in log_data:
line = line.split(']: <', 1)[-1].split('>', 1)
await ctx.send(f"**{line[0]}:** {line[-1][1:]}")
if lines <= 0: break
lines -= 1
if lines == 0: break

line = line.split(']: <', 1)[-1].split('>', 1)
await ctx.send(f"**{line[0]}:** {line[-1][1:]}")

await ctx.send("-----END-----")
lprint(ctx, f"Fetched chat log")
Expand Down

0 comments on commit bd07d3d

Please sign in to comment.