File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
src/main/kotlin/me/ddivad/judgebot Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ suspend fun main(args: Array<String>) {
67
67
field {
68
68
name = " Build Info"
69
69
value = " ```" +
70
- " Version: 2.4.0 \n " +
70
+ " Version: 2.4.1 \n " +
71
71
" DiscordKt: ${versions.library} \n " +
72
72
" Kotlin: $kotlinVersion " +
73
73
" ```"
Original file line number Diff line number Diff line change @@ -99,14 +99,17 @@ data class GuildMember(
99
99
infraction.id = nextId
100
100
this .infractions.add(infraction)
101
101
this .points + = infraction.points
102
- this .pointDecayTimer = DateTime ().millis.plus(infraction.punishment?.duration ? : 0 )
103
102
this .lastInfraction = DateTime ().millis
104
103
}
105
104
106
105
fun incrementHistoryCount (guildId : String ) {
107
106
this .getGuildInfo(guildId).historyCount + = 1
108
107
}
109
108
109
+ fun updatePointDecayDate (guild : Guild , punishmentDuration : Long ) = with (this .getGuildInfo(guild.id.asString)) {
110
+ this .pointDecayTimer = DateTime ().millis.plus(punishmentDuration)
111
+ }
112
+
110
113
fun addMessageDeleted (guild : Guild , deleteReaction : Boolean ) = with (this .getGuildInfo(guild.id.asString)) {
111
114
this .deletedMessageCount.total++
112
115
if (deleteReaction) this .deletedMessageCount.deleteReaction++
Original file line number Diff line number Diff line change @@ -86,8 +86,9 @@ class UserOperations(
86
86
}
87
87
88
88
suspend fun addInfraction (guild : Guild , user : GuildMember , infraction : Infraction ): Infraction {
89
- infraction.punishment = getPunishmentForPoints(guild, user)
90
89
user.addInfraction(infraction, guild)
90
+ infraction.punishment = getPunishmentForPoints(guild, user)
91
+ user.updatePointDecayDate(guild, infraction.punishment?.duration ? : 0 )
91
92
this .updateUser(user)
92
93
return infraction
93
94
}
You can’t perform that action at this time.
0 commit comments