@@ -14,8 +14,14 @@ import miniManual
1414import net.dv8tion.jda.api.JDA
1515import net.dv8tion.jda.api.entities.Message
1616import net.dv8tion.jda.api.entities.User
17+ import net.dv8tion.jda.api.entities.emoji.Emoji
18+ import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent
19+ import net.dv8tion.jda.api.events.interaction.component.SelectMenuInteractionEvent
20+ import net.dv8tion.jda.api.hooks.ListenerAdapter
1721import net.dv8tion.jda.api.interactions.components.buttons.Button
1822import net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle
23+ import net.dv8tion.jda.api.interactions.components.selections.SelectMenu
24+ import net.dv8tion.jda.api.interactions.components.selections.SelectOption
1925import net.dv8tion.jda.api.requests.restaction.WebhookMessageEditAction
2026import net.dv8tion.jda.api.utils.FileUpload
2127import org.atteo.evo.inflector.English
@@ -28,6 +34,27 @@ import java.awt.image.BufferedImage
2834import java.net.URL
2935import javax.imageio.ImageIO
3036
37+ object DropdownBot : ListenerAdapter() {
38+ override fun onSlashCommandInteraction (event : SlashCommandInteractionEvent ) {
39+ if (event.name == " food" ) {
40+ val selectMenu = SelectMenu .create(" choose-food" )
41+ .addOption(" Pizza" , " pizza" , " Classic" ) // SelectOption with only the label, value, and description
42+ .addOptions(
43+ SelectOption .of(" Hamburger" , " hamburger" ) // another way to create a SelectOption
44+ .withDescription(" Tasty" ) // this time with a description
45+ .withEmoji(Emoji .fromUnicode(" \uD83C\uDF54 " )) // and an emoji
46+ .withDefault(true )) // while also being the default option
47+ .build()
48+ }
49+ }
50+
51+ override fun onSelectMenuInteraction (event : SelectMenuInteractionEvent ) {
52+ if (event.componentId == " choose-food" ) {
53+ event.reply(" You chose " + event.values[0 ]).queue()
54+ }
55+ }
56+ }
57+
3158fun setBackgroundCommand (jda : JDA ) {
3259 jda.onCommand(" set_background" ) { event ->
3360 try {
@@ -67,6 +94,9 @@ fun setBackgroundCommand(jda: JDA) {
6794 val card = makeProfileCard(event.user, getSlicedBG())
6895 return event.hook.editMessage(content = " **Preview!**" )
6996 .setFiles(FileUpload .fromData(bufferedImageToByteArray(card), " profile.png" ))
97+ }
98+ fun getFontDropdown () {
99+
70100 }
71101 fun getButtons (): Array <Button > {
72102 val upButton = jda.button(
0 commit comments