Skip to content

Commit 1aaff27

Browse files
authored
Merge pull request #91 from the-programmers-hangout/develop
release: merge develop with master for 2.1.1
2 parents 5397033 + 0c1cbe4 commit 1aaff27

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

src/main/kotlin/me/ddivad/judgebot/Main.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ suspend fun main(args: Array<String>) {
5757
field {
5858
name = "Build Info"
5959
value = "```" +
60-
"Version: 2.1.0\n" +
60+
"Version: 2.1.1\n" +
6161
"DiscordKt: ${versions.library}\n" +
6262
"Kotlin: $kotlinVersion" +
6363
"```"

src/main/kotlin/me/ddivad/judgebot/embeds/InfractionEmbeds.kt

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fun EmbedBuilder.createWarnEmbed(guild: Guild, configuration: GuildConfiguration
2323
field {
2424
name = "__Reason__"
2525
value = infraction.reason
26-
inline = true
26+
inline = false
2727
}
2828

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

36-
if (configuration.infractionConfiguration.warnPoints > 0) {
37-
field {
38-
name = "__Points__"
39-
value = "${infraction.points}"
40-
inline = true
41-
}
36+
field {
37+
name = "__Warn Points__"
38+
value = "${infraction.points}"
39+
inline = true
40+
}
41+
42+
field {
43+
name = "__Points Count__"
44+
value = "${guildMember.getPoints(guild)} / ${configuration.infractionConfiguration.pointCeiling}"
45+
inline = true
46+
}
4247

48+
if (infraction.punishment?.punishment != PunishmentType.NONE) {
4349
field {
44-
name = "__Points Count__"
45-
value = "${guildMember.getPoints(guild)} / ${configuration.infractionConfiguration.pointCeiling}"
50+
name = "__Punishment__"
51+
value = "${infraction.punishment?.punishment.toString()} ${if (infraction.punishment?.duration != null) "for " + timeToString(infraction.punishment?.duration!!) else "indefinitely"}"
4652
inline = true
4753
}
4854
}
@@ -88,10 +94,12 @@ fun EmbedBuilder.createStrikeEmbed(guild: Guild, configuration: GuildConfigurati
8894
inline = true
8995
}
9096

91-
field {
92-
name = "__Punishment__"
93-
value = "${infraction.punishment?.punishment.toString()} ${if (infraction.punishment?.duration != null) "for " + timeToString(infraction.punishment?.duration!!) else "indefinitely"}"
94-
inline = true
97+
if (infraction.punishment?.punishment != PunishmentType.NONE) {
98+
field {
99+
name = "__Punishment__"
100+
value = "${infraction.punishment?.punishment.toString()} ${if (infraction.punishment?.duration != null) "for " + timeToString(infraction.punishment?.duration!!) else "indefinitely"}"
101+
inline = true
102+
}
95103
}
96104

97105
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**.")

0 commit comments

Comments
 (0)