Skip to content

Commit d4d00a7

Browse files
committed
Refactor Dbl/UpvoteCommand
1 parent 8b58ec6 commit d4d00a7

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

common/src/main/kotlin/net/cakeyfox/common/Constants.kt

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ object Constants {
1616
@OptIn(ExperimentalSerializationApi::class)
1717
val HOCON = Hocon { useArrayPolymorphism = true }
1818
const val SUPPORT_SERVER_ID = "768267522670723094"
19+
const val UPVOTE_URL = "https://top.gg/bot/1006520438865801296/vote"
1920

2021

2122
fun getDefaultActivity(activity: String, environment: String, clusterName: String?): String {

foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/utils/DblExecutor.kt

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package net.cakeyfox.foxy.command.vanilla.utils
22

3+
import net.cakeyfox.common.Colors
4+
import net.cakeyfox.common.Constants
5+
import net.cakeyfox.common.FoxyEmotes
36
import net.cakeyfox.foxy.command.FoxyInteractionContext
47
import net.cakeyfox.foxy.command.structure.FoxyCommandExecutor
58

@@ -8,7 +11,16 @@ class DblExecutor : FoxyCommandExecutor() {
811
context.reply {
912
embed {
1013
description = context.locale["dbl.embed.description"]
14+
color = Colors.BLURPLE
1115
}
16+
17+
actionRow(
18+
context.foxy.interactionManager.createLinkButton(
19+
FoxyEmotes.FoxyYay,
20+
context.locale["dbl.clickHereToVote"],
21+
Constants.UPVOTE_URL
22+
)
23+
)
1224
}
1325
}
1426
}

foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/utils/declarations/DblCommand.kt

+9-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ class DblCommand : FoxyCommandDeclarationWrapper {
2020
IntegrationType.USER_INSTALL
2121
)
2222
) {
23-
executor = DblExecutor()
23+
subCommand(
24+
"vote",
25+
"dbl.vote.description",
26+
baseName = this@command.name,
27+
28+
block = {
29+
executor = DblExecutor()
30+
}
31+
)
2432
}
2533
}

0 commit comments

Comments
 (0)