feat: ideashow command with interactive controls and todo management
This commit is contained in:
@@ -3,6 +3,7 @@ package commands
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
)
|
||||
@@ -24,6 +25,7 @@ func getAllCommands() []*Cmd {
|
||||
newLogoutCommand(),
|
||||
newListCommand(),
|
||||
newDeleteCommand(),
|
||||
newIdeashowCommand(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +68,17 @@ func HandleInteraction(s *discordgo.Session, ic *discordgo.InteractionCreate) {
|
||||
data := ic.ModalSubmitData()
|
||||
if data.CustomID == "setup_modal" {
|
||||
handleSetupSubmit(s, ic)
|
||||
} else if strings.HasPrefix(data.CustomID, "ideashow_add_todo_modal_") {
|
||||
handleAddTodoSubmit(s, ic)
|
||||
}
|
||||
case discordgo.InteractionMessageComponent:
|
||||
handleComponent(s, ic)
|
||||
}
|
||||
}
|
||||
|
||||
func handleComponent(s *discordgo.Session, ic *discordgo.InteractionCreate) {
|
||||
data := ic.MessageComponentData()
|
||||
if strings.HasPrefix(data.CustomID, "ideashow_") {
|
||||
handleIdeashowComponent(s, ic)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user