chore: updated command source system
Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
parent
f94d6c6ae7
commit
1cbf631f27
16 changed files with 72 additions and 69 deletions
|
@ -31,6 +31,7 @@ import net.moonleay.botendo.extensions.music.*
|
||||||
import net.moonleay.botendo.extensions.util.InfoExtension
|
import net.moonleay.botendo.extensions.util.InfoExtension
|
||||||
import net.moonleay.botendo.util.Logger
|
import net.moonleay.botendo.util.Logger
|
||||||
import net.moonleay.botendo.util.MessageUtil
|
import net.moonleay.botendo.util.MessageUtil
|
||||||
|
import net.moonleay.botendo.util.UserUtil
|
||||||
|
|
||||||
object Bot {
|
object Bot {
|
||||||
//The kord object gets set at app launch
|
//The kord object gets set at app launch
|
||||||
|
@ -95,7 +96,7 @@ object Bot {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"Error",
|
"Error",
|
||||||
"Could not find button with id \"${inter.componentId}\".\nPlease report this.",
|
"Could not find button with id \"${inter.componentId}\".\nPlease report this.",
|
||||||
u.asUser().username + "#" + u.asUser().discriminator
|
UserUtil.getCommandSrc(u)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ import dev.schlaubi.lavakord.audio.Link
|
||||||
import net.moonleay.botendo.extensions.music.components.MusicManager
|
import net.moonleay.botendo.extensions.music.components.MusicManager
|
||||||
import net.moonleay.botendo.util.ButtonUtil
|
import net.moonleay.botendo.util.ButtonUtil
|
||||||
import net.moonleay.botendo.util.MessageUtil
|
import net.moonleay.botendo.util.MessageUtil
|
||||||
|
import net.moonleay.botendo.util.UserUtil
|
||||||
|
|
||||||
class PauseButton : net.moonleay.botendo.buttons.Button("btn.music.pause") {
|
class PauseButton : net.moonleay.botendo.buttons.Button("btn.music.pause") {
|
||||||
override suspend fun onInteraction(
|
override suspend fun onInteraction(
|
||||||
|
@ -47,7 +48,7 @@ class PauseButton : net.moonleay.botendo.buttons.Button("btn.music.pause") {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"You are not connected to a VC",
|
"You are not connected to a VC",
|
||||||
"Please connect to a VC",
|
"Please connect to a VC",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -62,7 +63,7 @@ class PauseButton : net.moonleay.botendo.buttons.Button("btn.music.pause") {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"Not connected",
|
"Not connected",
|
||||||
"I'm not in a VC and therefore, I am not playing anything.",
|
"I'm not in a VC and therefore, I am not playing anything.",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -74,7 +75,7 @@ class PauseButton : net.moonleay.botendo.buttons.Button("btn.music.pause") {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"You are not in my VC",
|
"You are not in my VC",
|
||||||
"We are not in the same VC and therefore, you cannot control the music",
|
"We are not in the same VC and therefore, you cannot control the music",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -90,7 +91,7 @@ class PauseButton : net.moonleay.botendo.buttons.Button("btn.music.pause") {
|
||||||
Color(0x52E01A),
|
Color(0x52E01A),
|
||||||
if (player.paused) "I paused" else "I'm continuing",
|
if (player.paused) "I paused" else "I'm continuing",
|
||||||
if (player.paused) "I paused the song" else "I'm continuing to play the song.",
|
if (player.paused) "I paused the song" else "I'm continuing to play the song.",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ import net.moonleay.botendo.extensions.music.components.MusicManager
|
||||||
import net.moonleay.botendo.util.ButtonUtil
|
import net.moonleay.botendo.util.ButtonUtil
|
||||||
import net.moonleay.botendo.util.MessageUtil
|
import net.moonleay.botendo.util.MessageUtil
|
||||||
import net.moonleay.botendo.util.TimeUtil
|
import net.moonleay.botendo.util.TimeUtil
|
||||||
|
import net.moonleay.botendo.util.UserUtil
|
||||||
|
|
||||||
class QueueButton : net.moonleay.botendo.buttons.Button("btn.music.queue") {
|
class QueueButton : net.moonleay.botendo.buttons.Button("btn.music.queue") {
|
||||||
override suspend fun onInteraction(
|
override suspend fun onInteraction(
|
||||||
|
@ -47,7 +48,7 @@ class QueueButton : net.moonleay.botendo.buttons.Button("btn.music.queue") {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"Not connected",
|
"Not connected",
|
||||||
"I'm not in a VC and therefore, I am not playing anything.",
|
"I'm not in a VC and therefore, I am not playing anything.",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -61,7 +62,8 @@ class QueueButton : net.moonleay.botendo.buttons.Button("btn.music.queue") {
|
||||||
MessageUtil.getEmbed(
|
MessageUtil.getEmbed(
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"Not playing",
|
"Not playing",
|
||||||
"I'm not playing anything currently", user.asUser().username + "#" + user.asUser().discriminator
|
"I'm not playing anything currently",
|
||||||
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -82,7 +84,7 @@ class QueueButton : net.moonleay.botendo.buttons.Button("btn.music.queue") {
|
||||||
Color(0x52E01A),
|
Color(0x52E01A),
|
||||||
"Queue",
|
"Queue",
|
||||||
desc,
|
desc,
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ import dev.schlaubi.lavakord.audio.Link
|
||||||
import net.moonleay.botendo.extensions.music.components.MusicManager
|
import net.moonleay.botendo.extensions.music.components.MusicManager
|
||||||
import net.moonleay.botendo.util.ButtonUtil
|
import net.moonleay.botendo.util.ButtonUtil
|
||||||
import net.moonleay.botendo.util.MessageUtil
|
import net.moonleay.botendo.util.MessageUtil
|
||||||
|
import net.moonleay.botendo.util.UserUtil
|
||||||
|
|
||||||
class RepeatButton : net.moonleay.botendo.buttons.Button("btn.music.repeat") {
|
class RepeatButton : net.moonleay.botendo.buttons.Button("btn.music.repeat") {
|
||||||
override suspend fun onInteraction(
|
override suspend fun onInteraction(
|
||||||
|
@ -47,7 +48,7 @@ class RepeatButton : net.moonleay.botendo.buttons.Button("btn.music.repeat") {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"You are not connected to a VC",
|
"You are not connected to a VC",
|
||||||
"Please connect to a VC",
|
"Please connect to a VC",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -62,7 +63,7 @@ class RepeatButton : net.moonleay.botendo.buttons.Button("btn.music.repeat") {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"Not connected",
|
"Not connected",
|
||||||
"I'm not in a VC and therefore, I am not playing anything.",
|
"I'm not in a VC and therefore, I am not playing anything.",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -74,7 +75,7 @@ class RepeatButton : net.moonleay.botendo.buttons.Button("btn.music.repeat") {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"You are not in my VC",
|
"You are not in my VC",
|
||||||
"We are not in the same VC and therefore, you cannot control the music",
|
"We are not in the same VC and therefore, you cannot control the music",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -89,7 +90,7 @@ class RepeatButton : net.moonleay.botendo.buttons.Button("btn.music.repeat") {
|
||||||
Color(0x52E01A),
|
Color(0x52E01A),
|
||||||
if (gts.repeating) "Now Repeating" else "Now Continuing",
|
if (gts.repeating) "Now Repeating" else "Now Continuing",
|
||||||
if (gts.repeating) "The current track will now loop" else "The next track will play when this song finishes",
|
if (gts.repeating) "The current track will now loop" else "The next track will play when this song finishes",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,7 @@ 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.extensions.music.components.MusicManager
|
||||||
import net.moonleay.botendo.util.ButtonUtil
|
import net.moonleay.botendo.util.*
|
||||||
import net.moonleay.botendo.util.MessageUtil
|
|
||||||
import net.moonleay.botendo.util.TimeUtil
|
|
||||||
import net.moonleay.botendo.util.UrlUtil
|
|
||||||
|
|
||||||
class SkipButton : net.moonleay.botendo.buttons.Button("btn.music.skip") {
|
class SkipButton : net.moonleay.botendo.buttons.Button("btn.music.skip") {
|
||||||
override suspend fun onInteraction(
|
override suspend fun onInteraction(
|
||||||
|
@ -50,7 +47,7 @@ class SkipButton : net.moonleay.botendo.buttons.Button("btn.music.skip") {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"You are not connected to a VC",
|
"You are not connected to a VC",
|
||||||
"Please connect to a VC",
|
"Please connect to a VC",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -65,7 +62,7 @@ class SkipButton : net.moonleay.botendo.buttons.Button("btn.music.skip") {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"Not connected",
|
"Not connected",
|
||||||
"I'm not in a VC and therefore, I am not playing anything.",
|
"I'm not in a VC and therefore, I am not playing anything.",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -77,7 +74,7 @@ class SkipButton : net.moonleay.botendo.buttons.Button("btn.music.skip") {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"You are not in my VC",
|
"You are not in my VC",
|
||||||
"We are not in the same VC and therefore, you cannot control the music",
|
"We are not in the same VC and therefore, you cannot control the music",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -90,7 +87,8 @@ class SkipButton : net.moonleay.botendo.buttons.Button("btn.music.skip") {
|
||||||
MessageUtil.getEmbed(
|
MessageUtil.getEmbed(
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"Not playing",
|
"Not playing",
|
||||||
"I'm not playing anything currently", user.asUser().username + "#" + user.asUser().discriminator
|
"I'm not playing anything currently",
|
||||||
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -111,7 +109,7 @@ class SkipButton : net.moonleay.botendo.buttons.Button("btn.music.skip") {
|
||||||
)
|
)
|
||||||
}\n" +
|
}\n" +
|
||||||
">>>${track.uri}",
|
">>>${track.uri}",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator,
|
UserUtil.getCommandSrc(user),
|
||||||
"https://img.youtube.com/vi/" + UrlUtil.getYtThumbnailUrl(track.uri!!) + "/maxresdefault.jpg"
|
"https://img.youtube.com/vi/" + UrlUtil.getYtThumbnailUrl(track.uri!!) + "/maxresdefault.jpg"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -135,7 +133,7 @@ class SkipButton : net.moonleay.botendo.buttons.Button("btn.music.skip") {
|
||||||
Color(0x52E01A),
|
Color(0x52E01A),
|
||||||
"Skipped song; now playing",
|
"Skipped song; now playing",
|
||||||
"Nothing",
|
"Nothing",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
this.actionRow {
|
this.actionRow {
|
||||||
|
|
|
@ -27,6 +27,7 @@ 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.extensions.music.components.MusicManager
|
||||||
import net.moonleay.botendo.util.MessageUtil
|
import net.moonleay.botendo.util.MessageUtil
|
||||||
|
import net.moonleay.botendo.util.UserUtil
|
||||||
|
|
||||||
class StopButton : net.moonleay.botendo.buttons.Button("btn.music.stop") {
|
class StopButton : net.moonleay.botendo.buttons.Button("btn.music.stop") {
|
||||||
override suspend fun onInteraction(
|
override suspend fun onInteraction(
|
||||||
|
@ -45,7 +46,7 @@ class StopButton : net.moonleay.botendo.buttons.Button("btn.music.stop") {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"You are not connected to a VC",
|
"You are not connected to a VC",
|
||||||
"Please connect to a VC",
|
"Please connect to a VC",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -60,7 +61,7 @@ class StopButton : net.moonleay.botendo.buttons.Button("btn.music.stop") {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"Not connected",
|
"Not connected",
|
||||||
"I'm not in a VC and therefore, I am not playing anything.",
|
"I'm not in a VC and therefore, I am not playing anything.",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -72,7 +73,7 @@ class StopButton : net.moonleay.botendo.buttons.Button("btn.music.stop") {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"You are not in my VC",
|
"You are not in my VC",
|
||||||
"We are not in the same VC and therefore, you cannot control the music",
|
"We are not in the same VC and therefore, you cannot control the music",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -88,7 +89,7 @@ class StopButton : net.moonleay.botendo.buttons.Button("btn.music.stop") {
|
||||||
Color(0x52E01A),
|
Color(0x52E01A),
|
||||||
"I stopped and left",
|
"I stopped and left",
|
||||||
"just like your girlfriend",
|
"just like your girlfriend",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,10 +27,7 @@ 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.extensions.music.components.MusicManager
|
||||||
import net.moonleay.botendo.util.ButtonUtil
|
import net.moonleay.botendo.util.*
|
||||||
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"
|
||||||
|
@ -78,7 +75,7 @@ class NowPlayingExtension : Extension() {
|
||||||
)
|
)
|
||||||
}\n" +
|
}\n" +
|
||||||
">>>${track.uri}",
|
">>>${track.uri}",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator,
|
UserUtil.getCommandSrc(user),
|
||||||
"https://img.youtube.com/vi/" + UrlUtil.getYtThumbnailUrl(track.uri.toString()) + "/maxresdefault.jpg"
|
"https://img.youtube.com/vi/" + UrlUtil.getYtThumbnailUrl(track.uri.toString()) + "/maxresdefault.jpg"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -28,6 +28,7 @@ import dev.schlaubi.lavakord.kord.getLink
|
||||||
import net.moonleay.botendo.extensions.music.components.LinkArguments
|
import net.moonleay.botendo.extensions.music.components.LinkArguments
|
||||||
import net.moonleay.botendo.extensions.music.components.MusicManager
|
import net.moonleay.botendo.extensions.music.components.MusicManager
|
||||||
import net.moonleay.botendo.util.MessageUtil
|
import net.moonleay.botendo.util.MessageUtil
|
||||||
|
import net.moonleay.botendo.util.UserUtil
|
||||||
|
|
||||||
|
|
||||||
class PlayExtension : Extension() {
|
class PlayExtension : Extension() {
|
||||||
|
@ -50,7 +51,7 @@ class PlayExtension : Extension() {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"You are not connected to a VC",
|
"You are not connected to a VC",
|
||||||
"Please connect to a VC",
|
"Please connect to a VC",
|
||||||
u.asUser().username + "#" + u.asUser().discriminator
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -68,7 +69,7 @@ class PlayExtension : Extension() {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"You are not in my VC",
|
"You are not in my VC",
|
||||||
"We are not in the same VC and therefore, you cannot play any music",
|
"We are not in the same VC and therefore, you cannot play any music",
|
||||||
u.asUser().username + "#" + u.asUser().discriminator
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -87,7 +88,7 @@ class PlayExtension : Extension() {
|
||||||
Color(0xE0A81A),
|
Color(0xE0A81A),
|
||||||
"Searching...",
|
"Searching...",
|
||||||
"We are looking for $query",
|
"We are looking for $query",
|
||||||
u.asUser().username + "#" + u.asUser().discriminator
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ import net.moonleay.botendo.extensions.music.components.MusicManager
|
||||||
import net.moonleay.botendo.util.ButtonUtil
|
import net.moonleay.botendo.util.ButtonUtil
|
||||||
import net.moonleay.botendo.util.MessageUtil
|
import net.moonleay.botendo.util.MessageUtil
|
||||||
import net.moonleay.botendo.util.TimeUtil
|
import net.moonleay.botendo.util.TimeUtil
|
||||||
|
import net.moonleay.botendo.util.UserUtil
|
||||||
|
|
||||||
class QueueExtension : Extension() {
|
class QueueExtension : Extension() {
|
||||||
override val name = "queue"
|
override val name = "queue"
|
||||||
|
@ -74,7 +75,7 @@ class QueueExtension : Extension() {
|
||||||
Color(0x52E01A),
|
Color(0x52E01A),
|
||||||
"Queue",
|
"Queue",
|
||||||
desc,
|
desc,
|
||||||
user.asUser().username + "#" + user.asUser().discriminator
|
UserUtil.getCommandSrc(user),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,7 @@ 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.extensions.music.components.MusicManager
|
||||||
import net.moonleay.botendo.extensions.music.components.SeekArguments
|
import net.moonleay.botendo.extensions.music.components.SeekArguments
|
||||||
import net.moonleay.botendo.util.ButtonUtil
|
import net.moonleay.botendo.util.*
|
||||||
import net.moonleay.botendo.util.MessageUtil
|
|
||||||
import net.moonleay.botendo.util.TimeUtil
|
|
||||||
import net.moonleay.botendo.util.UrlUtil
|
|
||||||
|
|
||||||
class SeekExtension : Extension() {
|
class SeekExtension : Extension() {
|
||||||
override val name = "seek"
|
override val name = "seek"
|
||||||
|
@ -51,7 +48,7 @@ class SeekExtension : Extension() {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"You are not connected to a VC",
|
"You are not connected to a VC",
|
||||||
"Please connect to a VC",
|
"Please connect to a VC",
|
||||||
"${u.asUser().username}#${u.asUser().discriminator}"
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -66,7 +63,7 @@ class SeekExtension : Extension() {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"Not connected",
|
"Not connected",
|
||||||
"I'm not in a VC and therefore, I am not playing anything.",
|
"I'm not in a VC and therefore, I am not playing anything.",
|
||||||
"${u.asUser().username}#${u.asUser().discriminator}"
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -78,7 +75,7 @@ class SeekExtension : Extension() {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"You are not in my VC",
|
"You are not in my VC",
|
||||||
"We are not in the same VC and therefore, you cannot control the music",
|
"We are not in the same VC and therefore, you cannot control the music",
|
||||||
"${u.asUser().username}#${u.asUser().discriminator}"
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -92,7 +89,7 @@ class SeekExtension : Extension() {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"Not playing",
|
"Not playing",
|
||||||
"I'm not playing anything currently",
|
"I'm not playing anything currently",
|
||||||
"${u.asUser().username}#${u.asUser().discriminator}"
|
UserUtil.getCommandSrc(u)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -109,7 +106,7 @@ class SeekExtension : Extension() {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"Invalid position",
|
"Invalid position",
|
||||||
"The position you specified is invalid",
|
"The position you specified is invalid",
|
||||||
"${u.asUser().username}#${u.asUser().discriminator}"
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -132,7 +129,7 @@ class SeekExtension : Extension() {
|
||||||
)
|
)
|
||||||
}\n" +
|
}\n" +
|
||||||
">>>${track.uri}",
|
">>>${track.uri}",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator,
|
UserUtil.getCommandSrc(user),
|
||||||
"https://img.youtube.com/vi/" + UrlUtil.getYtThumbnailUrl(track.uri!!) + "/maxresdefault.jpg"
|
"https://img.youtube.com/vi/" + UrlUtil.getYtThumbnailUrl(track.uri!!) + "/maxresdefault.jpg"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -26,10 +26,7 @@ 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.extensions.music.components.MusicManager
|
||||||
import net.moonleay.botendo.util.ButtonUtil
|
import net.moonleay.botendo.util.*
|
||||||
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"
|
||||||
|
@ -101,7 +98,7 @@ class SkipExtension : Extension() {
|
||||||
)
|
)
|
||||||
}\n" +
|
}\n" +
|
||||||
">>>${track.uri}",
|
">>>${track.uri}",
|
||||||
user.asUser().username + "#" + user.asUser().discriminator,
|
UserUtil.getCommandSrc(user),
|
||||||
"https://img.youtube.com/vi/" + UrlUtil.getYtThumbnailUrl(track.uri!!) + "/maxresdefault.jpg"
|
"https://img.youtube.com/vi/" + UrlUtil.getYtThumbnailUrl(track.uri!!) + "/maxresdefault.jpg"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -27,6 +27,7 @@ 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.extensions.music.components.MusicManager
|
||||||
import net.moonleay.botendo.util.MessageUtil
|
import net.moonleay.botendo.util.MessageUtil
|
||||||
|
import net.moonleay.botendo.util.UserUtil
|
||||||
|
|
||||||
class StopExtension : Extension() {
|
class StopExtension : Extension() {
|
||||||
override val name = "stop"
|
override val name = "stop"
|
||||||
|
@ -46,7 +47,8 @@ class StopExtension : Extension() {
|
||||||
MessageUtil.getEmbed(
|
MessageUtil.getEmbed(
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"You are not connected to a VC",
|
"You are not connected to a VC",
|
||||||
"Please connect to my VC", u.asUser().username + "#" + u.asUser().discriminator
|
"Please connect to my VC",
|
||||||
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -60,7 +62,7 @@ class StopExtension : Extension() {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"Not connected",
|
"Not connected",
|
||||||
"I'm not in a VC and therefore, I am not playing anything.",
|
"I'm not in a VC and therefore, I am not playing anything.",
|
||||||
u.asUser().username + "#" + u.asUser().discriminator
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -71,7 +73,8 @@ class StopExtension : Extension() {
|
||||||
MessageUtil.getEmbed(
|
MessageUtil.getEmbed(
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"You are not in my VC",
|
"You are not in my VC",
|
||||||
"We are not in the same VC", u.asUser().username + "#" + u.asUser().discriminator
|
"We are not in the same VC",
|
||||||
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -86,7 +89,7 @@ class StopExtension : Extension() {
|
||||||
Color(0x52E01A),
|
Color(0x52E01A),
|
||||||
"I stopped and left",
|
"I stopped and left",
|
||||||
"just like your girlfriend",
|
"just like your girlfriend",
|
||||||
u.asUser().username + "#" + u.asUser().discriminator
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ import dev.schlaubi.lavakord.kord.getLink
|
||||||
import net.moonleay.botendo.extensions.music.components.LinkArguments
|
import net.moonleay.botendo.extensions.music.components.LinkArguments
|
||||||
import net.moonleay.botendo.extensions.music.components.MusicManager
|
import net.moonleay.botendo.extensions.music.components.MusicManager
|
||||||
import net.moonleay.botendo.util.MessageUtil
|
import net.moonleay.botendo.util.MessageUtil
|
||||||
|
import net.moonleay.botendo.util.UserUtil
|
||||||
|
|
||||||
|
|
||||||
class UpsertExtension : Extension() {
|
class UpsertExtension : Extension() {
|
||||||
|
@ -50,7 +51,7 @@ class UpsertExtension : Extension() {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"You are not connected to a VC",
|
"You are not connected to a VC",
|
||||||
"Please connect to a VC",
|
"Please connect to a VC",
|
||||||
u.asUser().username + "#" + u.asUser().discriminator
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -68,7 +69,7 @@ class UpsertExtension : Extension() {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"You are not in my VC",
|
"You are not in my VC",
|
||||||
"We are not in the same VC and therefore, you cannot play any music",
|
"We are not in the same VC and therefore, you cannot play any music",
|
||||||
u.asUser().username + "#" + u.asUser().discriminator
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -87,7 +88,7 @@ class UpsertExtension : Extension() {
|
||||||
Color(0xE0A81A),
|
Color(0xE0A81A),
|
||||||
"Searching...",
|
"Searching...",
|
||||||
"We are looking for $query",
|
"We are looking for $query",
|
||||||
u.asUser().username + "#" + u.asUser().discriminator
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,10 +30,7 @@ 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.*
|
||||||
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()
|
||||||
|
@ -89,7 +86,8 @@ object MusicManager {
|
||||||
item.track.info.length
|
item.track.info.length
|
||||||
)
|
)
|
||||||
}\n" +
|
}\n" +
|
||||||
">>>${item.track.info.uri}", u.username + "#" + u.discriminator,
|
">>>${item.track.info.uri}",
|
||||||
|
UserUtil.getCommandSrc(u),
|
||||||
"https://img.youtube.com/vi/" + UrlUtil.getYtThumbnailUrl(item.track.info.uri) + "/maxresdefault.jpg"
|
"https://img.youtube.com/vi/" + UrlUtil.getYtThumbnailUrl(item.track.info.uri) + "/maxresdefault.jpg"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -121,7 +119,8 @@ object MusicManager {
|
||||||
item.tracks.first().info.length
|
item.tracks.first().info.length
|
||||||
)
|
)
|
||||||
}\n" +
|
}\n" +
|
||||||
">>>${item.tracks.first().info.uri}", u.username + "#" + u.discriminator
|
">>>${item.tracks.first().info.uri}",
|
||||||
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -149,7 +148,8 @@ object MusicManager {
|
||||||
item.tracks.first().info.length
|
item.tracks.first().info.length
|
||||||
)
|
)
|
||||||
}\n" +
|
}\n" +
|
||||||
">>>${item.tracks.first().info.uri}", u.username + "#" + u.discriminator,
|
">>>${item.tracks.first().info.uri}",
|
||||||
|
UserUtil.getCommandSrc(u),
|
||||||
"https://img.youtube.com/vi/" + UrlUtil.getYtThumbnailUrl(item.tracks.first().info.uri) + "/maxresdefault.jpg"
|
"https://img.youtube.com/vi/" + UrlUtil.getYtThumbnailUrl(item.tracks.first().info.uri) + "/maxresdefault.jpg"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -173,7 +173,7 @@ object MusicManager {
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"Not found",
|
"Not found",
|
||||||
"There were no matches.",
|
"There were no matches.",
|
||||||
u.username + "#" + u.discriminator
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,8 @@ object MusicManager {
|
||||||
MessageUtil.getEmbed(
|
MessageUtil.getEmbed(
|
||||||
Color(0xE0311A),
|
Color(0xE0311A),
|
||||||
"Load failed",
|
"Load failed",
|
||||||
"There was an error while loading.", u.username + "#" + u.discriminator
|
"There was an error while loading.",
|
||||||
|
UserUtil.getCommandSrc(u),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,8 @@ class InfoExtension : Extension() {
|
||||||
description = "Show infos about the bot"
|
description = "Show infos about the bot"
|
||||||
this.action {
|
this.action {
|
||||||
MessageUtil.sendEmbedForPublicSlashCommand(
|
MessageUtil.sendEmbedForPublicSlashCommand(
|
||||||
this, Color(0x52E01A), "Botendo",
|
this,
|
||||||
|
Color(0x52E01A), "Botendo",
|
||||||
"Botendo ***v." + net.moonleay.botendo.build.BuildConstants.version + "***\n" +
|
"Botendo ***v." + net.moonleay.botendo.build.BuildConstants.version + "***\n" +
|
||||||
"Kord-Extensions ***v." + net.moonleay.botendo.build.BuildConstants.kordVersion + "***\n" +
|
"Kord-Extensions ***v." + net.moonleay.botendo.build.BuildConstants.kordVersion + "***\n" +
|
||||||
"lavalink.kt ***v." + net.moonleay.botendo.build.BuildConstants.lavaVersion + "***\n" +
|
"lavalink.kt ***v." + net.moonleay.botendo.build.BuildConstants.lavaVersion + "***\n" +
|
||||||
|
|
|
@ -44,7 +44,7 @@ object MessageUtil {
|
||||||
color,
|
color,
|
||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
ctx.user.asUser().username + "#" + ctx.user.asUser().discriminator
|
UserUtil.getCommandSrc(ctx.user)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ object MessageUtil {
|
||||||
color,
|
color,
|
||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
ctx.user.asUser().username + "#" + ctx.user.asUser().discriminator,
|
UserUtil.getCommandSrc(ctx.user),
|
||||||
thumbnailUrl
|
thumbnailUrl
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue