Skip to content

Commit

Permalink
Merge pull request #93 from the-programmers-hangout/develop
Browse files Browse the repository at this point in the history
release: merge develop with master
  • Loading branch information
ddivad195 authored Jun 16, 2021
2 parents 1aaff27 + 5629c4a commit 45afe1c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/me/ddivad/judgebot/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ suspend fun main(args: Array<String>) {
field {
name = "Build Info"
value = "```" +
"Version: 2.1.1\n" +
"Version: 2.1.2\n" +
"DiscordKt: ${versions.library}\n" +
"Kotlin: $kotlinVersion" +
"```"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ class InfractionConversation(private val databaseService: DatabaseService,
else guildConfiguration.infractionConfiguration.warnPoints
val rules = databaseService.guilds.getRules(guild)
val ruleId = if (rules.isNotEmpty()) {
val rule = promptEmbed(IntegerArg) { createInfractionRuleEmbed(guild, rules) }
respond { createInfractionRuleEmbed(guild, rules) }
val rule = promptUntil(
IntegerArg,
prompt = "Enter choice:",
isValid = { number -> rules.any { it.number == number } || number == 0 },
error = "Rule not found. Please enter a valid rule ID or 0:"
)
if (rule > 0) rule else null
} else null
val infraction = Infraction(this.user.id.value, infractionReason, type, points, ruleId)
infractionService.infract(targetUser, guild, user, infraction)
respondMenu { createHistoryEmbed(targetUser, user, guild, configuration, databaseService) }
}
}
}

0 comments on commit 45afe1c

Please sign in to comment.