Skip to content

Commit 50f7bc9

Browse files
committed
Reset static message enabled value on update
1 parent ff3e875 commit 50f7bc9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

core/src/main/kotlin/org/dreamexposure/discal/core/business/StaticMessageService.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ class StaticMessageService(
180180

181181
val updated = old.copy(
182182
lastUpdate = Instant.now(),
183-
scheduledUpdate = if (old.scheduledUpdate.isBefore(Instant.now())) old.scheduledUpdate.plus(1, ChronoUnit.DAYS) else old.scheduledUpdate
183+
scheduledUpdate = if (old.scheduledUpdate.isBefore(Instant.now())) old.scheduledUpdate.plus(1, ChronoUnit.DAYS) else old.scheduledUpdate,
184+
enabled = true,
184185
)
185186
staticMessageRepository.updateByGuildIdAndMessageId(
186187
guildId = updated.guildId.asLong(),
@@ -259,7 +260,8 @@ class StaticMessageService(
259260

260261
val updated = old.copy(
261262
lastUpdate = Instant.now(),
262-
scheduledUpdate = if (old.scheduledUpdate.isBefore(Instant.now())) old.scheduledUpdate.plus(1, ChronoUnit.DAYS) else old.scheduledUpdate
263+
scheduledUpdate = if (old.scheduledUpdate.isBefore(Instant.now())) old.scheduledUpdate.plus(1, ChronoUnit.DAYS) else old.scheduledUpdate,
264+
enabled = true,
263265
)
264266
staticMessageRepository.updateByGuildIdAndMessageId(
265267
guildId = updated.guildId.asLong(),

0 commit comments

Comments
 (0)