Skip to content

Commit

Permalink
✨ Added a version command at request by Asoji.
Browse files Browse the repository at this point in the history
  • Loading branch information
CephalonCosmic committed Mar 28, 2023
1 parent aabd6c3 commit 7c183f4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/one/devos/yiski/Yiski.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import xyz.artrinix.aviation.internal.utils.on
import xyz.artrinix.aviation.ratelimit.DefaultRateLimitStrategy

object Yiski {
private val version = this::class.java.`package`.implementationVersion ?: "DEV"
val version = this::class.java.`package`.implementationVersion ?: "DEV"
val config = Config.loadConfig()

private lateinit var jda: JDA
Expand Down
22 changes: 22 additions & 0 deletions src/main/kotlin/one/devos/yiski/commands/slash/Version.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package one.devos.yiski.commands.slash

import net.dv8tion.jda.api.JDA
import one.devos.yiski.Yiski
import xyz.artrinix.aviation.Aviation
import xyz.artrinix.aviation.command.slash.SlashContext
import xyz.artrinix.aviation.command.slash.annotations.SlashCommand
import xyz.artrinix.aviation.entities.Scaffold

class Version : Scaffold {
@SlashCommand("version", "Shows the bots version")
suspend fun version(ctx: SlashContext) {
val user = ctx.jda.getUserById(299779734932291604)
ctx.sendPrivateEmbed {
setThumbnail(ctx.jda.selfUser.effectiveAvatarUrl)
addField("Yiski 6", Yiski.version, true)
addField("JDA", JDA::class.java.`package`.implementationVersion, true)
addField("Aviation", Aviation::class.java.`package`.implementationVersion, true)
setFooter("Built with love, sweat & tears by ${user?.asTag ?: "Storm"}", user?.effectiveAvatarUrl)
}
}
}

1 comment on commit 7c183f4

@CephalonCosmic
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worked in dev but for some fucking reason assigns Yiskis package version to all dependencies when built.

Will fix later.

Please sign in to comment.