Skip to content

Commit

Permalink
fix: don't allow user limit less than 1
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbker committed Feb 17, 2024
1 parent cc9d23b commit 6b6347d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/kotlin/com/learnspigot/bot/voicechat/VCCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class VCCommand {
event: SlashCommandInteractionEvent,
@Description("Max user limit") @Optional limit: Int?,
) {
if (limit != null && limit < 1) {
event.reply("The max user limit must be 1 or higher.").setEphemeral(true).queue()
return
}

val guild = event.guild ?: return
val newChannel = guild.createVoiceChannel(
"${event.member!!.effectiveName}'s channel",
Expand Down

0 comments on commit 6b6347d

Please sign in to comment.