Skip to content

Commit

Permalink
fix: add shardeval guard
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzah committed Apr 9, 2024
1 parent 28aada1 commit 7b1a249
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/bot/src/textCommands/shardEval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export default class ShardEvalCommand extends TextCommand {
if (!ctx.args[0]) return 'You need to specify a shard.';

const shard = parseInt(ctx.args[0]);
if (shard >= parseInt(process.env.SHARD_COUNT!) || shard < 0) return `That shard is out of range. (${process.env.SHARD_COUNT})`;

let script = ctx.event
.get('commands/strippedContent')
.slice(ctx.event.get('commands/commandName').length + 1 + ctx.args[0].length)
Expand Down

0 comments on commit 7b1a249

Please sign in to comment.