fix: changed to DeferredEphemeralMessageInteractionResponseBehavior

Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
limited_dev 2023-04-07 15:18:30 +02:00
parent 4a7a6b0bc0
commit 6a1d580fe6
10 changed files with 21 additions and 21 deletions

View file

@ -60,7 +60,7 @@ object Bot {
//Register Command Listener
kord.on<GuildChatInputCommandInteractionCreateEvent> {
val deferred = interaction.deferPublicResponse()
val deferred = interaction.deferEphemeralResponse()
//val deferred = async { interaction.deferPublicResponse() }
val command = interaction.command
Logger.out("Command /${command.rootName} with ${command.options.size} Option${if (command.options.size == 1) "" else "s"}")

View file

@ -20,14 +20,14 @@
package de.limited_dev.botendo.commands.slash.component
import de.limited_dev.botendo.commands.slash.component.options.CommandOption
import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.DeferredEphemeralMessageInteractionResponseBehavior
import dev.kord.core.entity.interaction.GuildChatInputCommandInteraction
abstract class SlashCommand(val name: String, val description: String, val options: List<CommandOption>? = null) {
open suspend fun onSlashCommand(
interaction: GuildChatInputCommandInteraction,
deferred: DeferredPublicMessageInteractionResponseBehavior,
deferred: DeferredEphemeralMessageInteractionResponseBehavior,
args: Map<CommandOption, String>
) {
}

View file

@ -25,14 +25,14 @@ import de.limited_dev.botendo.commands.slash.component.options.CommandOption
import de.limited_dev.botendo.util.MessageUtil
import de.limited_dev.botendo.util.TimeUtil
import de.limited_dev.botendo.util.UrlUtil
import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.DeferredEphemeralMessageInteractionResponseBehavior
import dev.kord.core.entity.interaction.GuildChatInputCommandInteraction
import dev.schlaubi.lavakord.audio.Link
class NowPlayingCommand : SlashCommand("nowplaying", "Show what's currently playing", null) {
override suspend fun onSlashCommand(
interaction: GuildChatInputCommandInteraction,
deferred: DeferredPublicMessageInteractionResponseBehavior,
deferred: DeferredEphemeralMessageInteractionResponseBehavior,
args: Map<CommandOption, String>
) {
val guildId = interaction.guildId

View file

@ -25,7 +25,7 @@ import de.limited_dev.botendo.commands.slash.component.options.CommandOption
import de.limited_dev.botendo.commands.slash.component.options.OptionType
import de.limited_dev.botendo.commands.slash.music.component.MusicManager
import de.limited_dev.botendo.util.MessageUtil
import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.DeferredEphemeralMessageInteractionResponseBehavior
import dev.kord.core.entity.interaction.GuildChatInputCommandInteraction
import dev.schlaubi.lavakord.audio.Link
@ -36,7 +36,7 @@ class PlayCommand : SlashCommand(
) {
override suspend fun onSlashCommand(
interaction: GuildChatInputCommandInteraction,
deferred: DeferredPublicMessageInteractionResponseBehavior,
deferred: DeferredEphemeralMessageInteractionResponseBehavior,
args: Map<CommandOption, String>
) {
val guildId = interaction.guildId

View file

@ -25,14 +25,14 @@ import de.limited_dev.botendo.commands.slash.component.options.CommandOption
import de.limited_dev.botendo.commands.slash.music.component.MusicManager
import de.limited_dev.botendo.util.MessageUtil
import de.limited_dev.botendo.util.TimeUtil
import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.DeferredEphemeralMessageInteractionResponseBehavior
import dev.kord.core.entity.interaction.GuildChatInputCommandInteraction
import dev.schlaubi.lavakord.audio.Link
class QueueCommand : SlashCommand("queue", "Show whats up next", null) {
override suspend fun onSlashCommand(
interaction: GuildChatInputCommandInteraction,
deferred: DeferredPublicMessageInteractionResponseBehavior,
deferred: DeferredEphemeralMessageInteractionResponseBehavior,
args: Map<CommandOption, String>
) {
val guildId = interaction.guildId

View file

@ -26,14 +26,14 @@ import de.limited_dev.botendo.commands.slash.music.component.MusicManager
import de.limited_dev.botendo.util.MessageUtil
import de.limited_dev.botendo.util.TimeUtil
import de.limited_dev.botendo.util.UrlUtil
import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.DeferredEphemeralMessageInteractionResponseBehavior
import dev.kord.core.entity.interaction.GuildChatInputCommandInteraction
import dev.schlaubi.lavakord.audio.Link
class SkipCommand : SlashCommand("skip", "Skip to the next song in queue", null) {
override suspend fun onSlashCommand(
interaction: GuildChatInputCommandInteraction,
deferred: DeferredPublicMessageInteractionResponseBehavior,
deferred: DeferredEphemeralMessageInteractionResponseBehavior,
args: Map<CommandOption, String>
) {
val guildId = interaction.guildId

View file

@ -24,14 +24,14 @@ import de.limited_dev.botendo.commands.slash.component.SlashCommand
import de.limited_dev.botendo.commands.slash.component.options.CommandOption
import de.limited_dev.botendo.commands.slash.music.component.MusicManager
import de.limited_dev.botendo.util.MessageUtil
import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.DeferredEphemeralMessageInteractionResponseBehavior
import dev.kord.core.entity.interaction.GuildChatInputCommandInteraction
import dev.schlaubi.lavakord.audio.Link
class StopCommand : SlashCommand("stop", "Stop playing and start leavin'", null) {
override suspend fun onSlashCommand(
interaction: GuildChatInputCommandInteraction,
deferred: DeferredPublicMessageInteractionResponseBehavior,
deferred: DeferredEphemeralMessageInteractionResponseBehavior,
args: Map<CommandOption, String>
) {
val guildId = interaction.guildId

View file

@ -23,7 +23,7 @@ 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.entity.Snowflake
import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.DeferredEphemeralMessageInteractionResponseBehavior
import dev.kord.core.entity.Guild
import dev.kord.core.entity.interaction.GuildChatInputCommandInteraction
import dev.schlaubi.lavakord.audio.Link
@ -43,7 +43,7 @@ object MusicManager {
suspend fun addToQueue(
interaction: GuildChatInputCommandInteraction,
deferred: DeferredPublicMessageInteractionResponseBehavior,
deferred: DeferredEphemeralMessageInteractionResponseBehavior,
link: Link,
search: String
) {
@ -52,7 +52,7 @@ object MusicManager {
suspend fun addToQueue(
interaction: GuildChatInputCommandInteraction,
deferred: DeferredPublicMessageInteractionResponseBehavior,
deferred: DeferredEphemeralMessageInteractionResponseBehavior,
link: Link,
search: String,
silent: Boolean

View file

@ -23,13 +23,13 @@ import de.limited_dev.botendo.build.BuildConstants
import de.limited_dev.botendo.commands.slash.component.SlashCommand
import de.limited_dev.botendo.commands.slash.component.options.CommandOption
import de.limited_dev.botendo.util.MessageUtil
import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.DeferredEphemeralMessageInteractionResponseBehavior
import dev.kord.core.entity.interaction.GuildChatInputCommandInteraction
class InfoCommand : SlashCommand("info", "Shows infos about the bot", null) {
override suspend fun onSlashCommand(
interaction: GuildChatInputCommandInteraction,
deferred: DeferredPublicMessageInteractionResponseBehavior,
deferred: DeferredEphemeralMessageInteractionResponseBehavior,
args: Map<CommandOption, String>
) {
MessageUtil.sendEmbedForInteraction(interaction, deferred, "Botendo v5", "ver." + BuildConstants.version)

View file

@ -19,7 +19,7 @@
package de.limited_dev.botendo.util
import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.DeferredEphemeralMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.respond
import dev.kord.core.entity.interaction.GuildChatInputCommandInteraction
import dev.kord.rest.builder.message.EmbedBuilder
@ -31,7 +31,7 @@ object MessageUtil {
suspend fun sendEmbedForInteraction(
interaction: GuildChatInputCommandInteraction,
deferred: DeferredPublicMessageInteractionResponseBehavior,
deferred: DeferredEphemeralMessageInteractionResponseBehavior,
title: String,
description: String
) {
@ -48,7 +48,7 @@ object MessageUtil {
suspend fun sendEmbedForInteractionWithImage(
interaction: GuildChatInputCommandInteraction,
deferred: DeferredPublicMessageInteractionResponseBehavior,
deferred: DeferredEphemeralMessageInteractionResponseBehavior,
title: String,
description: String,
thumbnailUrl: String