chore: finally moved from de.limited_dev to net.moonleay, fixed Discriminator in info command

Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
limited_dev 2023-05-18 03:44:38 +02:00
parent 1c00f856ab
commit 612d7b58cc
27 changed files with 111 additions and 125 deletions

View file

@ -30,7 +30,7 @@ plugins {
//Botendo version 6 //Botendo version 6
val ownerID = 372703841151614976L val ownerID = 372703841151614976L
group = "de.limited_dev.botendo" group = "net.moonleay.botendo"
version = System.getenv("CI_COMMIT_TAG")?.let { "$it-${System.getenv("CI_COMMIT_SHORT_SHA")}-prod" } version = System.getenv("CI_COMMIT_TAG")?.let { "$it-${System.getenv("CI_COMMIT_SHORT_SHA")}-prod" }
?: System.getenv("CI_COMMIT_SHORT_SHA")?.let { "$it-dev" } ?: System.getenv("CI_COMMIT_SHORT_SHA")?.let { "$it-dev" }
?: "6.4.0" ?: "6.4.0"
@ -115,7 +115,7 @@ tasks {
withType<Jar> { withType<Jar> {
manifest { manifest {
attributes["Main-Class"] = "de.limited_dev.botendo.MainKt" attributes["Main-Class"] = "net.moonleay.botendo.MainKt"
} }
// To add all of the dependencies // To add all of the dependencies
from(sourceSets.main.get().output) from(sourceSets.main.get().output)

View file

@ -17,21 +17,20 @@
* *
*/ */
package de.limited_dev.botendo package net.moonleay.botendo
import com.kotlindiscord.kord.extensions.ExtensibleBot import com.kotlindiscord.kord.extensions.ExtensibleBot
import de.limited_dev.botendo.buttons.ButtonManager
import de.limited_dev.botendo.data.CredentialManager
import de.limited_dev.botendo.extensions.music.*
import de.limited_dev.botendo.extensions.util.InfoExtension
import de.limited_dev.botendo.util.Logger
import de.limited_dev.botendo.util.MessageUtil
import dev.kord.common.Color import dev.kord.common.Color
import dev.kord.core.behavior.interaction.response.respond import dev.kord.core.behavior.interaction.response.respond
import dev.kord.core.event.interaction.ButtonInteractionCreateEvent import dev.kord.core.event.interaction.ButtonInteractionCreateEvent
import dev.kord.core.on import dev.kord.core.on
import dev.schlaubi.lavakord.LavaKord import dev.schlaubi.lavakord.LavaKord
import dev.schlaubi.lavakord.kord.lavakord import dev.schlaubi.lavakord.kord.lavakord
import net.moonleay.botendo.data.CredentialManager
import net.moonleay.botendo.extensions.music.*
import net.moonleay.botendo.extensions.util.InfoExtension
import net.moonleay.botendo.util.Logger
import net.moonleay.botendo.util.MessageUtil
object Bot { object Bot {
//The kord object gets set at app launch //The kord object gets set at app launch
@ -83,7 +82,7 @@ object Bot {
val response = inter.deferPublicResponse() val response = inter.deferPublicResponse()
val u = inter.user val u = inter.user
val g = this.interaction.getOriginalInteractionResponse().getGuild() val g = this.interaction.getOriginalInteractionResponse().getGuild()
for (b in ButtonManager.buttons) { for (b in net.moonleay.botendo.buttons.ButtonManager.buttons) {
if (b.id != inter.componentId) if (b.id != inter.componentId)
continue continue
b.onInteraction(response, g, u) b.onInteraction(response, g, u)

View file

@ -17,9 +17,7 @@
* *
*/ */
package de.limited_dev.botendo package net.moonleay.botendo
import de.limited_dev.botendo.build.BuildConstants
///Show the splash and launch the Bot ///Show the splash and launch the Bot
@ -34,6 +32,6 @@ suspend fun main() {
"M#########M \n" + "M#########M \n" +
" " " "
) )
println("Bot v.${BuildConstants.version}, Kord Extensions v.${BuildConstants.kordVersion}, LavaKord v.${BuildConstants.lavaVersion}, Coroutines v.${BuildConstants.coroutinesVersion}") println("Bot v.${net.moonleay.botendo.build.BuildConstants.version}, Kord Extensions v.${net.moonleay.botendo.build.BuildConstants.kordVersion}, LavaKord v.${net.moonleay.botendo.build.BuildConstants.lavaVersion}, Coroutines v.${net.moonleay.botendo.build.BuildConstants.coroutinesVersion}")
Bot.start() Bot.start()
} }

View file

@ -17,7 +17,7 @@
* *
*/ */
package de.limited_dev.botendo.buttons package net.moonleay.botendo.buttons
import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior
import dev.kord.core.entity.Guild import dev.kord.core.entity.Guild

View file

@ -17,10 +17,16 @@
* *
*/ */
package de.limited_dev.botendo.buttons package net.moonleay.botendo.buttons
import de.limited_dev.botendo.buttons.music.* import net.moonleay.botendo.buttons.music.*
object ButtonManager { object ButtonManager {
val buttons = listOf(RepeatButton(), PauseButton(), SkipButton(), QueueButton(), StopButton()) val buttons = listOf(
RepeatButton(),
PauseButton(),
SkipButton(),
QueueButton(),
StopButton()
)
} }

View file

@ -17,13 +17,8 @@
* *
*/ */
package de.limited_dev.botendo.buttons.music package net.moonleay.botendo.buttons.music
import de.limited_dev.botendo.Bot
import de.limited_dev.botendo.buttons.Button
import de.limited_dev.botendo.extensions.music.components.MusicManager
import de.limited_dev.botendo.util.ButtonUtil
import de.limited_dev.botendo.util.MessageUtil
import dev.kord.common.Color import dev.kord.common.Color
import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.respond import dev.kord.core.behavior.interaction.response.respond
@ -31,15 +26,18 @@ import dev.kord.core.entity.Guild
import dev.kord.core.entity.User import dev.kord.core.entity.User
import dev.kord.rest.builder.message.modify.actionRow import dev.kord.rest.builder.message.modify.actionRow
import dev.schlaubi.lavakord.audio.Link import dev.schlaubi.lavakord.audio.Link
import net.moonleay.botendo.extensions.music.components.MusicManager
import net.moonleay.botendo.util.ButtonUtil
import net.moonleay.botendo.util.MessageUtil
class PauseButton : Button("btn.music.pause") { class PauseButton : net.moonleay.botendo.buttons.Button("btn.music.pause") {
override suspend fun onInteraction( override suspend fun onInteraction(
response: DeferredPublicMessageInteractionResponseBehavior, response: DeferredPublicMessageInteractionResponseBehavior,
guild: Guild, guild: Guild,
user: User user: User
) { ) {
val guildId = guild.id val guildId = guild.id
val link = Bot.lava.getLink(guildId.toString()) val link = net.moonleay.botendo.Bot.lava.getLink(guildId.toString())
val player = link.player val player = link.player
val voiceState = user.asMember(guildId).getVoiceStateOrNull() val voiceState = user.asMember(guildId).getVoiceStateOrNull()
if (voiceState == null) { if (voiceState == null) {

View file

@ -17,14 +17,8 @@
* *
*/ */
package de.limited_dev.botendo.buttons.music package net.moonleay.botendo.buttons.music
import de.limited_dev.botendo.Bot
import de.limited_dev.botendo.buttons.Button
import de.limited_dev.botendo.extensions.music.components.MusicManager
import de.limited_dev.botendo.util.ButtonUtil
import de.limited_dev.botendo.util.MessageUtil
import de.limited_dev.botendo.util.TimeUtil
import dev.kord.common.Color import dev.kord.common.Color
import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.respond import dev.kord.core.behavior.interaction.response.respond
@ -32,15 +26,19 @@ import dev.kord.core.entity.Guild
import dev.kord.core.entity.User import dev.kord.core.entity.User
import dev.kord.rest.builder.message.modify.actionRow import dev.kord.rest.builder.message.modify.actionRow
import dev.schlaubi.lavakord.audio.Link import dev.schlaubi.lavakord.audio.Link
import net.moonleay.botendo.extensions.music.components.MusicManager
import net.moonleay.botendo.util.ButtonUtil
import net.moonleay.botendo.util.MessageUtil
import net.moonleay.botendo.util.TimeUtil
class QueueButton : Button("btn.music.queue") { class QueueButton : net.moonleay.botendo.buttons.Button("btn.music.queue") {
override suspend fun onInteraction( override suspend fun onInteraction(
response: DeferredPublicMessageInteractionResponseBehavior, response: DeferredPublicMessageInteractionResponseBehavior,
guild: Guild, guild: Guild,
user: User user: User
) { ) {
val guildId = guild.id val guildId = guild.id
val link = Bot.lava.getLink(guildId.toString()) val link = net.moonleay.botendo.Bot.lava.getLink(guildId.toString())
val player = link.player val player = link.player
if (link.state == Link.State.NOT_CONNECTED) { if (link.state == Link.State.NOT_CONNECTED) {
response.respond { response.respond {

View file

@ -17,13 +17,8 @@
* *
*/ */
package de.limited_dev.botendo.buttons.music package net.moonleay.botendo.buttons.music
import de.limited_dev.botendo.Bot
import de.limited_dev.botendo.buttons.Button
import de.limited_dev.botendo.extensions.music.components.MusicManager
import de.limited_dev.botendo.util.ButtonUtil
import de.limited_dev.botendo.util.MessageUtil
import dev.kord.common.Color import dev.kord.common.Color
import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.respond import dev.kord.core.behavior.interaction.response.respond
@ -31,15 +26,18 @@ import dev.kord.core.entity.Guild
import dev.kord.core.entity.User import dev.kord.core.entity.User
import dev.kord.rest.builder.message.modify.actionRow import dev.kord.rest.builder.message.modify.actionRow
import dev.schlaubi.lavakord.audio.Link import dev.schlaubi.lavakord.audio.Link
import net.moonleay.botendo.extensions.music.components.MusicManager
import net.moonleay.botendo.util.ButtonUtil
import net.moonleay.botendo.util.MessageUtil
class RepeatButton : Button("btn.music.repeat") { class RepeatButton : net.moonleay.botendo.buttons.Button("btn.music.repeat") {
override suspend fun onInteraction( override suspend fun onInteraction(
response: DeferredPublicMessageInteractionResponseBehavior, response: DeferredPublicMessageInteractionResponseBehavior,
guild: Guild, guild: Guild,
user: User user: User
) { ) {
val guildId = guild.id val guildId = guild.id
val link = Bot.lava.getLink(guildId.toString()) val link = net.moonleay.botendo.Bot.lava.getLink(guildId.toString())
val player = link.player val player = link.player
val voiceState = user.asMember(guildId).getVoiceStateOrNull() val voiceState = user.asMember(guildId).getVoiceStateOrNull()
if (voiceState == null) { if (voiceState == null) {

View file

@ -17,15 +17,9 @@
* *
*/ */
package de.limited_dev.botendo.buttons.music package net.moonleay.botendo.buttons.music
import de.limited_dev.botendo.Bot
import de.limited_dev.botendo.buttons.Button
import de.limited_dev.botendo.extensions.music.components.MusicManager
import de.limited_dev.botendo.util.ButtonUtil
import de.limited_dev.botendo.util.MessageUtil
import de.limited_dev.botendo.util.TimeUtil
import de.limited_dev.botendo.util.UrlUtil
import dev.kord.common.Color import dev.kord.common.Color
import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.respond import dev.kord.core.behavior.interaction.response.respond
@ -33,15 +27,20 @@ import dev.kord.core.entity.Guild
import dev.kord.core.entity.User import dev.kord.core.entity.User
import dev.kord.rest.builder.message.modify.actionRow import dev.kord.rest.builder.message.modify.actionRow
import dev.schlaubi.lavakord.audio.Link import dev.schlaubi.lavakord.audio.Link
import net.moonleay.botendo.extensions.music.components.MusicManager
import net.moonleay.botendo.util.ButtonUtil
import net.moonleay.botendo.util.MessageUtil
import net.moonleay.botendo.util.TimeUtil
import net.moonleay.botendo.util.UrlUtil
class SkipButton : Button("btn.music.skip") { class SkipButton : net.moonleay.botendo.buttons.Button("btn.music.skip") {
override suspend fun onInteraction( override suspend fun onInteraction(
response: DeferredPublicMessageInteractionResponseBehavior, response: DeferredPublicMessageInteractionResponseBehavior,
guild: Guild, guild: Guild,
user: User user: User
) { ) {
val guildId = guild.id val guildId = guild.id
val link = Bot.lava.getLink(guildId.toString()) val link = net.moonleay.botendo.Bot.lava.getLink(guildId.toString())
val player = link.player val player = link.player
val voiceState = user.asMember(guildId).getVoiceStateOrNull() val voiceState = user.asMember(guildId).getVoiceStateOrNull()
if (voiceState == null) { if (voiceState == null) {

View file

@ -17,27 +17,25 @@
* *
*/ */
package de.limited_dev.botendo.buttons.music package net.moonleay.botendo.buttons.music
import de.limited_dev.botendo.Bot
import de.limited_dev.botendo.buttons.Button
import de.limited_dev.botendo.extensions.music.components.MusicManager
import de.limited_dev.botendo.util.MessageUtil
import dev.kord.common.Color import dev.kord.common.Color
import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.respond import dev.kord.core.behavior.interaction.response.respond
import dev.kord.core.entity.Guild import dev.kord.core.entity.Guild
import dev.kord.core.entity.User import dev.kord.core.entity.User
import dev.schlaubi.lavakord.audio.Link import dev.schlaubi.lavakord.audio.Link
import net.moonleay.botendo.extensions.music.components.MusicManager
import net.moonleay.botendo.util.MessageUtil
class StopButton : Button("btn.music.stop") { class StopButton : net.moonleay.botendo.buttons.Button("btn.music.stop") {
override suspend fun onInteraction( override suspend fun onInteraction(
response: DeferredPublicMessageInteractionResponseBehavior, response: DeferredPublicMessageInteractionResponseBehavior,
guild: Guild, guild: Guild,
user: User user: User
) { ) {
val guildId = guild.id val guildId = guild.id
val link = Bot.lava.getLink(guildId.toString()) val link = net.moonleay.botendo.Bot.lava.getLink(guildId.toString())
val player = link.player val player = link.player
val voiceState = user.asMember(guildId).getVoiceStateOrNull() val voiceState = user.asMember(guildId).getVoiceStateOrNull()
if (voiceState == null) { if (voiceState == null) {

View file

@ -17,7 +17,7 @@
* *
*/ */
package de.limited_dev.botendo.data package net.moonleay.botendo.data
import java.io.* import java.io.*
import java.util.* import java.util.*

View file

@ -17,21 +17,20 @@
* *
*/ */
package de.limited_dev.botendo.extensions.music package net.moonleay.botendo.extensions.music
import com.kotlindiscord.kord.extensions.extensions.Extension import com.kotlindiscord.kord.extensions.extensions.Extension
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
import com.kotlindiscord.kord.extensions.types.respond import com.kotlindiscord.kord.extensions.types.respond
import de.limited_dev.botendo.Bot
import de.limited_dev.botendo.extensions.music.components.MusicManager
import de.limited_dev.botendo.util.ButtonUtil
import de.limited_dev.botendo.util.MessageUtil
import de.limited_dev.botendo.util.TimeUtil
import de.limited_dev.botendo.util.UrlUtil
import dev.kord.common.Color import dev.kord.common.Color
import dev.kord.rest.builder.message.create.actionRow import dev.kord.rest.builder.message.create.actionRow
import dev.schlaubi.lavakord.audio.Link import dev.schlaubi.lavakord.audio.Link
import dev.schlaubi.lavakord.kord.getLink import dev.schlaubi.lavakord.kord.getLink
import net.moonleay.botendo.extensions.music.components.MusicManager
import net.moonleay.botendo.util.ButtonUtil
import net.moonleay.botendo.util.MessageUtil
import net.moonleay.botendo.util.TimeUtil
import net.moonleay.botendo.util.UrlUtil
class NowPlayingExtension : Extension() { class NowPlayingExtension : Extension() {
override val name = "nowplaying" override val name = "nowplaying"
@ -41,7 +40,7 @@ class NowPlayingExtension : Extension() {
description = "Show what's currently playing" description = "Show what's currently playing"
this.action { this.action {
val guildId = this.guild!!.id val guildId = this.guild!!.id
val link = Bot.lava.getLink(guildId) val link = net.moonleay.botendo.Bot.lava.getLink(guildId)
val player = link.player val player = link.player
if (link.state == Link.State.NOT_CONNECTED) { if (link.state == Link.State.NOT_CONNECTED) {
MessageUtil.sendEmbedForPublicSlashCommand( MessageUtil.sendEmbedForPublicSlashCommand(

View file

@ -17,18 +17,17 @@
* *
*/ */
package de.limited_dev.botendo.extensions.music package net.moonleay.botendo.extensions.music
import com.kotlindiscord.kord.extensions.extensions.Extension import com.kotlindiscord.kord.extensions.extensions.Extension
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
import com.kotlindiscord.kord.extensions.types.respond import com.kotlindiscord.kord.extensions.types.respond
import de.limited_dev.botendo.Bot
import de.limited_dev.botendo.extensions.music.components.LinkArguments
import de.limited_dev.botendo.extensions.music.components.MusicManager
import de.limited_dev.botendo.util.MessageUtil
import dev.kord.common.Color import dev.kord.common.Color
import dev.schlaubi.lavakord.audio.Link import dev.schlaubi.lavakord.audio.Link
import dev.schlaubi.lavakord.kord.getLink import dev.schlaubi.lavakord.kord.getLink
import net.moonleay.botendo.extensions.music.components.LinkArguments
import net.moonleay.botendo.extensions.music.components.MusicManager
import net.moonleay.botendo.util.MessageUtil
class PlayExtension : Extension() { class PlayExtension : Extension() {
@ -41,7 +40,7 @@ class PlayExtension : Extension() {
description = "Play music" description = "Play music"
this.action { this.action {
val guildId = this.guild!!.id val guildId = this.guild!!.id
val link = Bot.lava.getLink(guildId) val link = net.moonleay.botendo.Bot.lava.getLink(guildId)
val u = this.user val u = this.user
val vcsUser = u.asMember(guildId).getVoiceStateOrNull() val vcsUser = u.asMember(guildId).getVoiceStateOrNull()
if (vcsUser == null) { if (vcsUser == null) {

View file

@ -17,19 +17,18 @@
* *
*/ */
package de.limited_dev.botendo.extensions.music package net.moonleay.botendo.extensions.music
import com.kotlindiscord.kord.extensions.extensions.Extension import com.kotlindiscord.kord.extensions.extensions.Extension
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
import com.kotlindiscord.kord.extensions.types.respond import com.kotlindiscord.kord.extensions.types.respond
import de.limited_dev.botendo.Bot
import de.limited_dev.botendo.extensions.music.components.MusicManager
import de.limited_dev.botendo.util.ButtonUtil
import de.limited_dev.botendo.util.MessageUtil
import de.limited_dev.botendo.util.TimeUtil
import dev.kord.common.Color import dev.kord.common.Color
import dev.kord.rest.builder.message.create.actionRow import dev.kord.rest.builder.message.create.actionRow
import dev.schlaubi.lavakord.audio.Link import dev.schlaubi.lavakord.audio.Link
import net.moonleay.botendo.extensions.music.components.MusicManager
import net.moonleay.botendo.util.ButtonUtil
import net.moonleay.botendo.util.MessageUtil
import net.moonleay.botendo.util.TimeUtil
class QueueExtension : Extension() { class QueueExtension : Extension() {
override val name = "queue" override val name = "queue"
@ -39,7 +38,7 @@ class QueueExtension : Extension() {
description = "Show whats up next" description = "Show whats up next"
this.action { this.action {
val guildId = this.guild!!.id val guildId = this.guild!!.id
val link = Bot.lava.getLink(guildId.toString()) val link = net.moonleay.botendo.Bot.lava.getLink(guildId.toString())
val player = link.player val player = link.player
if (link.state == Link.State.NOT_CONNECTED) { if (link.state == Link.State.NOT_CONNECTED) {
MessageUtil.sendEmbedForPublicSlashCommand( MessageUtil.sendEmbedForPublicSlashCommand(

View file

@ -17,20 +17,19 @@
* *
*/ */
package de.limited_dev.botendo.extensions.music package net.moonleay.botendo.extensions.music
import com.kotlindiscord.kord.extensions.extensions.Extension import com.kotlindiscord.kord.extensions.extensions.Extension
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
import com.kotlindiscord.kord.extensions.types.respond import com.kotlindiscord.kord.extensions.types.respond
import de.limited_dev.botendo.Bot
import de.limited_dev.botendo.extensions.music.components.MusicManager
import de.limited_dev.botendo.util.ButtonUtil
import de.limited_dev.botendo.util.MessageUtil
import de.limited_dev.botendo.util.TimeUtil
import de.limited_dev.botendo.util.UrlUtil
import dev.kord.common.Color import dev.kord.common.Color
import dev.kord.rest.builder.message.create.actionRow import dev.kord.rest.builder.message.create.actionRow
import dev.schlaubi.lavakord.audio.Link import dev.schlaubi.lavakord.audio.Link
import net.moonleay.botendo.extensions.music.components.MusicManager
import net.moonleay.botendo.util.ButtonUtil
import net.moonleay.botendo.util.MessageUtil
import net.moonleay.botendo.util.TimeUtil
import net.moonleay.botendo.util.UrlUtil
class SkipExtension : Extension() { class SkipExtension : Extension() {
override val name = "skip" override val name = "skip"
@ -40,7 +39,7 @@ class SkipExtension : Extension() {
description = "Skip to the next song in queue" description = "Skip to the next song in queue"
this.action { this.action {
val guildId = this.guild!!.id val guildId = this.guild!!.id
val link = Bot.lava.getLink(guildId.toString()) val link = net.moonleay.botendo.Bot.lava.getLink(guildId.toString())
val player = link.player val player = link.player
val u = this.user val u = this.user
val voiceState = u.asMember(guildId).getVoiceStateOrNull() val voiceState = u.asMember(guildId).getVoiceStateOrNull()

View file

@ -17,17 +17,16 @@
* *
*/ */
package de.limited_dev.botendo.extensions.music package net.moonleay.botendo.extensions.music
import com.kotlindiscord.kord.extensions.extensions.Extension import com.kotlindiscord.kord.extensions.extensions.Extension
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
import com.kotlindiscord.kord.extensions.types.respond import com.kotlindiscord.kord.extensions.types.respond
import de.limited_dev.botendo.Bot
import de.limited_dev.botendo.extensions.music.components.MusicManager
import de.limited_dev.botendo.util.MessageUtil
import dev.kord.common.Color import dev.kord.common.Color
import dev.schlaubi.lavakord.audio.Link import dev.schlaubi.lavakord.audio.Link
import dev.schlaubi.lavakord.kord.getLink import dev.schlaubi.lavakord.kord.getLink
import net.moonleay.botendo.extensions.music.components.MusicManager
import net.moonleay.botendo.util.MessageUtil
class StopExtension : Extension() { class StopExtension : Extension() {
override val name = "stop" override val name = "stop"
@ -37,7 +36,7 @@ class StopExtension : Extension() {
description = "Stop playing and start leavin'" description = "Stop playing and start leavin'"
this.action { this.action {
val guildId = this.guild!!.id val guildId = this.guild!!.id
val link = Bot.lava.getLink(guildId) val link = net.moonleay.botendo.Bot.lava.getLink(guildId)
val player = link.player val player = link.player
val u = this.user val u = this.user
val vcsUser = u.asMember(guildId).getVoiceStateOrNull() val vcsUser = u.asMember(guildId).getVoiceStateOrNull()

View file

@ -17,18 +17,17 @@
* *
*/ */
package de.limited_dev.botendo.extensions.music package net.moonleay.botendo.extensions.music
import com.kotlindiscord.kord.extensions.extensions.Extension import com.kotlindiscord.kord.extensions.extensions.Extension
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
import com.kotlindiscord.kord.extensions.types.respond import com.kotlindiscord.kord.extensions.types.respond
import de.limited_dev.botendo.Bot
import de.limited_dev.botendo.extensions.music.components.LinkArguments
import de.limited_dev.botendo.extensions.music.components.MusicManager
import de.limited_dev.botendo.util.MessageUtil
import dev.kord.common.Color import dev.kord.common.Color
import dev.schlaubi.lavakord.audio.Link import dev.schlaubi.lavakord.audio.Link
import dev.schlaubi.lavakord.kord.getLink import dev.schlaubi.lavakord.kord.getLink
import net.moonleay.botendo.extensions.music.components.LinkArguments
import net.moonleay.botendo.extensions.music.components.MusicManager
import net.moonleay.botendo.util.MessageUtil
class UpsertExtension : Extension() { class UpsertExtension : Extension() {
@ -41,7 +40,7 @@ class UpsertExtension : Extension() {
description = "Upsert music" description = "Upsert music"
this.action { this.action {
val guildId = this.guild!!.id val guildId = this.guild!!.id
val link = Bot.lava.getLink(guildId) val link = net.moonleay.botendo.Bot.lava.getLink(guildId)
val u = this.user val u = this.user
val vcsUser = u.asMember(guildId).getVoiceStateOrNull() val vcsUser = u.asMember(guildId).getVoiceStateOrNull()
if (vcsUser == null) { if (vcsUser == null) {

View file

@ -17,13 +17,12 @@
* *
*/ */
package de.limited_dev.botendo.extensions.music.components package net.moonleay.botendo.extensions.music.components
import de.limited_dev.botendo.Bot
import de.limited_dev.botendo.util.Logger
import dev.schlaubi.lavakord.audio.* import dev.schlaubi.lavakord.audio.*
import dev.schlaubi.lavakord.audio.player.Player import dev.schlaubi.lavakord.audio.player.Player
import dev.schlaubi.lavakord.rest.models.PartialTrack import dev.schlaubi.lavakord.rest.models.PartialTrack
import net.moonleay.botendo.util.Logger
import java.util.concurrent.BlockingQueue import java.util.concurrent.BlockingQueue
import java.util.concurrent.LinkedBlockingQueue import java.util.concurrent.LinkedBlockingQueue
@ -97,7 +96,7 @@ class GuildTrackScheduler(val pl: Player) {
return return
} }
Logger.out("Track has ended; Playing next...") Logger.out("Track has ended; Playing next...")
playNext(Bot.lava.getLink(e.guildId)) playNext(net.moonleay.botendo.Bot.lava.getLink(e.guildId))
} }
} }

View file

@ -17,7 +17,7 @@
* *
*/ */
package de.limited_dev.botendo.extensions.music.components package net.moonleay.botendo.extensions.music.components
import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.Arguments
import com.kotlindiscord.kord.extensions.commands.converters.impl.string import com.kotlindiscord.kord.extensions.commands.converters.impl.string

View file

@ -17,15 +17,11 @@
* *
*/ */
package de.limited_dev.botendo.extensions.music.components package net.moonleay.botendo.extensions.music.components
import com.kotlindiscord.kord.extensions.commands.application.slash.PublicSlashCommandContext import com.kotlindiscord.kord.extensions.commands.application.slash.PublicSlashCommandContext
import com.kotlindiscord.kord.extensions.components.forms.ModalForm import com.kotlindiscord.kord.extensions.components.forms.ModalForm
import com.kotlindiscord.kord.extensions.types.respond import com.kotlindiscord.kord.extensions.types.respond
import de.limited_dev.botendo.util.ButtonUtil
import de.limited_dev.botendo.util.MessageUtil
import de.limited_dev.botendo.util.TimeUtil
import de.limited_dev.botendo.util.UrlUtil
import dev.kord.common.Color import dev.kord.common.Color
import dev.kord.common.entity.Snowflake import dev.kord.common.entity.Snowflake
import dev.kord.core.entity.Guild import dev.kord.core.entity.Guild
@ -34,6 +30,10 @@ import dev.schlaubi.lavakord.audio.Link
import dev.schlaubi.lavakord.audio.player.Player import dev.schlaubi.lavakord.audio.player.Player
import dev.schlaubi.lavakord.rest.loadItem import dev.schlaubi.lavakord.rest.loadItem
import dev.schlaubi.lavakord.rest.models.TrackResponse import dev.schlaubi.lavakord.rest.models.TrackResponse
import net.moonleay.botendo.util.ButtonUtil
import net.moonleay.botendo.util.MessageUtil
import net.moonleay.botendo.util.TimeUtil
import net.moonleay.botendo.util.UrlUtil
object MusicManager { object MusicManager {
private var musicManagerMap: MutableMap<Snowflake, GuildTrackScheduler> = mutableMapOf() private var musicManagerMap: MutableMap<Snowflake, GuildTrackScheduler> = mutableMapOf()

View file

@ -17,13 +17,12 @@
* *
*/ */
package de.limited_dev.botendo.extensions.util package net.moonleay.botendo.extensions.util
import com.kotlindiscord.kord.extensions.extensions.Extension import com.kotlindiscord.kord.extensions.extensions.Extension
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
import de.limited_dev.botendo.build.BuildConstants
import de.limited_dev.botendo.util.MessageUtil
import dev.kord.common.Color import dev.kord.common.Color
import net.moonleay.botendo.util.MessageUtil
class InfoExtension : Extension() { class InfoExtension : Extension() {
override val name = "info" override val name = "info"
@ -34,11 +33,11 @@ class InfoExtension : Extension() {
this.action { this.action {
MessageUtil.sendEmbedForPublicSlashCommand( MessageUtil.sendEmbedForPublicSlashCommand(
this, Color(0x52E01A), "Botendo", this, Color(0x52E01A), "Botendo",
"Botendo ***v." + BuildConstants.version + "***\n" + "Botendo ***v." + net.moonleay.botendo.build.BuildConstants.version + "***\n" +
"Kord-Extensions ***v." + BuildConstants.kordVersion + "***\n" + "Kord-Extensions ***v." + net.moonleay.botendo.build.BuildConstants.kordVersion + "***\n" +
"lavalink.kt ***v." + BuildConstants.lavaVersion + "***\n" + "lavalink.kt ***v." + net.moonleay.botendo.build.BuildConstants.lavaVersion + "***\n" +
"Coroutines ***v." + BuildConstants.coroutinesVersion + "***\n\n\n" + "Coroutines ***v." + net.moonleay.botendo.build.BuildConstants.coroutinesVersion + "***\n\n\n" +
"***Bot made by moonleay#7441***\n" + "***Bot made by moonleay#0069***\n" +
"(c) 2023, licensed under GPL-3.0" "(c) 2023, licensed under GPL-3.0"
) )
} }

View file

@ -17,7 +17,7 @@
* *
*/ */
package de.limited_dev.botendo.util package net.moonleay.botendo.util
import dev.kord.common.entity.ButtonStyle import dev.kord.common.entity.ButtonStyle
import dev.kord.rest.builder.component.ActionRowBuilder import dev.kord.rest.builder.component.ActionRowBuilder

View file

@ -17,7 +17,7 @@
* *
*/ */
package de.limited_dev.botendo.util package net.moonleay.botendo.util
import java.time.LocalDateTime import java.time.LocalDateTime
import java.time.format.DateTimeFormatter import java.time.format.DateTimeFormatter

View file

@ -17,7 +17,7 @@
* *
*/ */
package de.limited_dev.botendo.util package net.moonleay.botendo.util
import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.Arguments
import com.kotlindiscord.kord.extensions.commands.application.slash.PublicSlashCommandContext import com.kotlindiscord.kord.extensions.commands.application.slash.PublicSlashCommandContext

View file

@ -17,7 +17,7 @@
* *
*/ */
package de.limited_dev.botendo.util package net.moonleay.botendo.util
object Status { object Status {
//TODO: impl. //TODO: impl.

View file

@ -17,7 +17,7 @@
* *
*/ */
package de.limited_dev.botendo.util package net.moonleay.botendo.util
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit

View file

@ -17,7 +17,7 @@
* *
*/ */
package de.limited_dev.botendo.util package net.moonleay.botendo.util
object UrlUtil { object UrlUtil {
///Strip the video ID from a YouTube link ///Strip the video ID from a YouTube link