HidekoBot/src/main/java/wtf/beatrice/hidekobot/commands/base/Invite.java
Beatrice DellacĂ  b2a62d754e
All checks were successful
continuous-integration/drone/push Build is passing
Make invite support both slash and message commands
2022-11-22 21:42:35 +01:00

38 lines
1.2 KiB
Java

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"));
}
}