Compare commits

..

No commits in common. "b015fddf3c469edaee95a86450a1e26ba8ee5cc7" and "b35b962ac6a880ca5c692a3950cab2dee83e5191" have entirely different histories.

3 changed files with 7 additions and 36 deletions

View File

@ -145,8 +145,7 @@ public class ClearChatCommand
}
Button dismissButton = Button.primary("clear_dismiss", "Dismiss")
.withEmoji(Emoji.fromUnicode(""));
Button dismissButton = Button.danger("clear_dismiss", "Dismiss").withEmoji(Emoji.fromUnicode(""));
WebhookMessageEditAction<Message> webhookMessageEditAction;

View File

@ -1,50 +1,22 @@
package wtf.beatrice.hidekobot.commands.slash;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.channel.ChannelType;
import net.dv8tion.jda.api.entities.emoji.Emoji;
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
import net.dv8tion.jda.api.interactions.components.buttons.Button;
import net.dv8tion.jda.api.requests.restaction.WebhookMessageEditAction;
import net.dv8tion.jda.api.requests.restaction.interactions.ReplyCallbackAction;
import org.jetbrains.annotations.NotNull;
import wtf.beatrice.hidekobot.Configuration;
import wtf.beatrice.hidekobot.HidekoBot;
public class InviteCommand
{
public void runSlashCommand(@NotNull SlashCommandInteractionEvent event)
{
// defer reply because this might take a moment
ReplyCallbackAction replyCallbackAction = event.deferReply();
ReplyCallbackAction reply = event.reply("Here's your link ✨ " + Configuration.getInviteUrl());
// only make message permanent in DMs
if(event.getChannelType() != ChannelType.PRIVATE)
if(!(event.getChannelType() == ChannelType.PRIVATE))
{
replyCallbackAction = replyCallbackAction.setEphemeral(true);
reply = reply.setEphemeral(true);
}
replyCallbackAction.queue();
EmbedBuilder embedBuilder = new EmbedBuilder();
//embed processing
{
embedBuilder.setColor(Configuration.getBotColor());
String avatarUrl = HidekoBot.getAPI().getSelfUser().getAvatarUrl();
if(avatarUrl != null) embedBuilder.setThumbnail(avatarUrl);
embedBuilder.setTitle("Invite");
embedBuilder.appendDescription("Click on the button below to invite " +
Configuration.getBotName() +
" to your server!");
}
String inviteUrl = Configuration.getInviteUrl();
Button inviteButton = Button.link(inviteUrl, "Invite " + Configuration.getBotName());
WebhookMessageEditAction<Message> reply =
event.getHook()
.editOriginalEmbeds(embedBuilder.build())
.setActionRow(inviteButton);
reply.queue();
}

View File

@ -22,14 +22,14 @@ public class SayCommand
if(textOption == null || messageContent.isEmpty())
{
event.reply("\uD83D\uDE20 Hey, you have to tell me what to say!")
event.reply("Hey, you have to tell me what to say!")
.setEphemeral(true)
.queue();
return;
}
channel.sendMessage(messageContent).queue();
event.reply("Message sent!")
event.reply("Message sent!")
.setEphemeral(true)
.queue();
}