Skip to content

Commit

Permalink
Add expires at field in the embed
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPowerGamerBR committed Aug 19, 2024
1 parent df97a0a commit 51f5ab1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class LoriToolsCommand(val helper: LorittaHelper) : SlashCommandDeclarationWrapp
context.user,
result.userId,
"Usuário banido de usar a Loritta",
expiresAt,
reason,
Color(237, 66, 69)
)
Expand Down Expand Up @@ -354,6 +355,7 @@ class LoriToolsCommand(val helper: LorittaHelper) : SlashCommandDeclarationWrapp
context.user,
userId,
"Usuário desbanido de usar a Loritta",
null,
reason,
Color(88, 101, 242)
)
Expand Down Expand Up @@ -433,6 +435,7 @@ class LoriToolsCommand(val helper: LorittaHelper) : SlashCommandDeclarationWrapp
context.user,
userId,
"Motivo do Ban Alterado",
null,
reason,
Color(214, 0, 255)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package net.perfectdreams.loritta.helper.utils.slash

import dev.minn.jda.ktx.messages.MessageCreate
import net.dv8tion.jda.api.entities.User
import net.dv8tion.jda.api.utils.TimeFormat
import net.perfectdreams.loritta.helper.LorittaHelper
import net.perfectdreams.loritta.helper.utils.Constants
import net.perfectdreams.loritta.helper.utils.extensions.await
Expand All @@ -13,6 +14,7 @@ object LoriToolsUtils {
moderator: User,
punishedUserId: Long,
title: String,
expiresAt: Long?,
reason: String,
color: Color
) {
Expand All @@ -33,6 +35,10 @@ object LoriToolsUtils {
field("Motivo", reason, true)
this.color = color.rgb

if (expiresAt != null) {
field("Expira em", TimeFormat.DATE_TIME_LONG.format(expiresAt), true)
}

if (punishedUser != null)
footer(
"${punishedUser.name}#${punishedUser.discriminator} (${punishedUser.id})",
Expand Down

0 comments on commit 51f5ab1

Please sign in to comment.