diff --git a/src/main/java/wtf/beatrice/hidekobot/slashcommands/InviteCommand.java b/src/main/java/wtf/beatrice/hidekobot/slashcommands/InviteCommand.java index 16664f3..9d24fd5 100644 --- a/src/main/java/wtf/beatrice/hidekobot/slashcommands/InviteCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/slashcommands/InviteCommand.java @@ -1,6 +1,8 @@ package wtf.beatrice.hidekobot.slashcommands; +import net.dv8tion.jda.api.entities.channel.ChannelType; import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent; +import net.dv8tion.jda.api.requests.restaction.interactions.ReplyCallbackAction; import org.jetbrains.annotations.NotNull; import wtf.beatrice.hidekobot.Configuration; @@ -8,6 +10,14 @@ public class InviteCommand { public InviteCommand(@NotNull SlashCommandInteractionEvent event) { - event.reply("Here's your link ✨ " + Configuration.getInviteUrl()).setEphemeral(true).queue(); + ReplyCallbackAction reply = event.reply("Here's your link ✨ " + Configuration.getInviteUrl()); + + // only make message permanent in DMs + if(!(event.getChannelType() == ChannelType.PRIVATE)) + { + reply = reply.setEphemeral(true); + } + + reply.queue(); } }