Skip to content

Commit

Permalink
Merge pull request #91 from the-programmers-hangout/develop
Browse files Browse the repository at this point in the history
release: merge develop with master for 2.1.1
  • Loading branch information
ddivad195 authored Jun 9, 2021
2 parents 5397033 + 0c1cbe4 commit 1aaff27
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 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.0\n" +
"Version: 2.1.1\n" +
"DiscordKt: ${versions.library}\n" +
"Kotlin: $kotlinVersion" +
"```"
Expand Down
34 changes: 21 additions & 13 deletions src/main/kotlin/me/ddivad/judgebot/embeds/InfractionEmbeds.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fun EmbedBuilder.createWarnEmbed(guild: Guild, configuration: GuildConfiguration
field {
name = "__Reason__"
value = infraction.reason
inline = true
inline = false
}

if (infraction.ruleNumber != null) {
Expand All @@ -33,16 +33,22 @@ fun EmbedBuilder.createWarnEmbed(guild: Guild, configuration: GuildConfiguration
}
}

if (configuration.infractionConfiguration.warnPoints > 0) {
field {
name = "__Points__"
value = "${infraction.points}"
inline = true
}
field {
name = "__Warn Points__"
value = "${infraction.points}"
inline = true
}

field {
name = "__Points Count__"
value = "${guildMember.getPoints(guild)} / ${configuration.infractionConfiguration.pointCeiling}"
inline = true
}

if (infraction.punishment?.punishment != PunishmentType.NONE) {
field {
name = "__Points Count__"
value = "${guildMember.getPoints(guild)} / ${configuration.infractionConfiguration.pointCeiling}"
name = "__Punishment__"
value = "${infraction.punishment?.punishment.toString()} ${if (infraction.punishment?.duration != null) "for " + timeToString(infraction.punishment?.duration!!) else "indefinitely"}"
inline = true
}
}
Expand Down Expand Up @@ -88,10 +94,12 @@ fun EmbedBuilder.createStrikeEmbed(guild: Guild, configuration: GuildConfigurati
inline = true
}

field {
name = "__Punishment__"
value = "${infraction.punishment?.punishment.toString()} ${if (infraction.punishment?.duration != null) "for " + timeToString(infraction.punishment?.duration!!) else "indefinitely"}"
inline = true
if (infraction.punishment?.punishment != PunishmentType.NONE) {
field {
name = "__Punishment__"
value = "${infraction.punishment?.punishment.toString()} ${if (infraction.punishment?.duration != null) "for " + timeToString(infraction.punishment?.duration!!) else "indefinitely"}"
inline = true
}
}

addField("", " A strike is a formal warning for breaking the rules.\nIf you think this to be unjustified, please **do not** post about it in a public channel but take it up with **Modmail**.")
Expand Down

0 comments on commit 1aaff27

Please sign in to comment.