File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed
foxy/src/main/kotlin/net/cakeyfox/foxy Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -54,9 +54,11 @@ class MessageCommandContext(
5454 }
5555
5656 if (hasTextContent && canSendMessage) {
57+ val original = channel.retrieveMessageById(event.messageId).await()
58+ if (original.isWebhookMessage) return
59+
5760 channel.sendTyping().queue()
5861
59- val original = channel.retrieveMessageById(event.messageId).await()
6062 val shouldDelete = getGuildData()?.guildSettings?.deleteMessageIfCommandIsExecuted
6163
6264 if (shouldDelete == true ) {
Original file line number Diff line number Diff line change @@ -57,6 +57,11 @@ class CakeInactivityTaxTask(
5757 users.chunked(10 ).forEach { chunk ->
5858 chunk.map { user ->
5959 semaphore.withPermit {
60+ if (canBypassInactivityTax(user)) {
61+ logger.info { " Skipping inactive user ${user._id } " }
62+ return @withPermit
63+ }
64+
6065 try {
6166 val lastDaily = user.userCakes.lastDaily?.takeUnless {
6267 it == Instant .fromEpochMilliseconds(0 )
@@ -76,16 +81,16 @@ class CakeInactivityTaxTask(
7681 if (user.userCakes.balance <= MINIMUM_AMOUNT ) return @withPermit
7782
7883 if (daysSinceLastDaily in WARNING_DAYS until TAX_START_DAYS ) {
79- if (canBypassInactivityTax(user)) {
80- logger.info { " Skipping inactive user ${user._id } " }
81- return @withPermit
82- }
83-
8484 if (user.userCakes.warnedAboutInactivityTax != true ) {
8585 val userFromDiscord = foxy.shardManager.retrieveUserById(user._id ).await()
8686 foxy.utils.sendDirectMessage(userFromDiscord) {
8787 embed {
88- title = pretty(FoxyEmotes .FoxyCry , locale[" tax.cakes.warning.title" ])
88+ title = pretty(
89+ FoxyEmotes .FoxyCry ,
90+ locale[
91+ " tax.cakes.warning.title"
92+ ]
93+ )
8994 description = locale[
9095 " tax.cakes.warning.description" ,
9196 user._id ,
Original file line number Diff line number Diff line change 11package net.cakeyfox.foxy.tasks
22
3+ import kotlinx.coroutines.delay
34import net.cakeyfox.foxy.FoxyInstance
45import net.cakeyfox.foxy.utils.AdminUtils
56import net.cakeyfox.foxy.utils.ClusterUtils.getClusterByShardId
@@ -19,6 +20,7 @@ class CheckExpiredBansTask(
1920 val guildShardId = getShardIdFromGuildId(guildId.toLong(), foxy.config.discord.totalShards)
2021 val guildCluster = getClusterByShardId(foxy, guildShardId)
2122
23+ delay(500 ) // Time to breath
2224 if (guildCluster.id == foxy.currentCluster.id) {
2325 AdminUtils .removeExpiredBans(foxy, guildId, expiredBans)
2426 } else {
You can’t perform that action at this time.
0 commit comments