Make invite support both slash and message commands
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package wtf.beatrice.hidekobot.commands.base;
|
||||
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.api.entities.emoji.Emoji;
|
||||
import net.dv8tion.jda.api.interactions.components.buttons.Button;
|
||||
import wtf.beatrice.hidekobot.Cache;
|
||||
import wtf.beatrice.hidekobot.HidekoBot;
|
||||
|
||||
public class Invite
|
||||
{
|
||||
|
||||
public static MessageEmbed generateEmbed()
|
||||
{
|
||||
EmbedBuilder embedBuilder = new EmbedBuilder();
|
||||
|
||||
//embed processing
|
||||
{
|
||||
embedBuilder.setColor(Cache.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 " +
|
||||
Cache.getBotName() +
|
||||
" to your server!");
|
||||
}
|
||||
|
||||
return embedBuilder.build();
|
||||
}
|
||||
|
||||
public static Button getInviteButton()
|
||||
{
|
||||
String inviteUrl = Cache.getInviteUrl();
|
||||
return Button.link(inviteUrl, "Invite " + Cache.getBotName())
|
||||
.withEmoji(Emoji.fromUnicode("\uD83C\uDF1F"));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user