Skip to content

Commit

Permalink
Fixed the indexourofrange in case there are not enough lines of logs
Browse files Browse the repository at this point in the history
  • Loading branch information
CPULL committed Apr 27, 2022
1 parent e3974b0 commit 280f463
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions UPBot Code/Commands/Logs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public async Task LogsCommand(CommandContext ctx, [Description("How many lines t
}

int start = lines.Count - num;
if (start < 0) start = 0;
string res = $"Last {num} lines of logs:\n```";
while (start < lines.Count) {
res += lines[start] + "\n";
Expand Down

0 comments on commit 280f463

Please sign in to comment.