Tickets: settings, category edit and ticket list from Discord; NOTIFY triggers in schema.sql
- /tickets settings (on or off, panel title and text, open tickets per member), /tickets category edit, /tickets list - schema.sql now creates the NOTIFY triggers, so the integration tests run on a database built from it, and two stale expectations (tickets start off) are fixed Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
1 parent
d95ebf473e
commit
acdb5ead35
6 files changed
+483
-20
No files matched your search
@@ -41,7 +41,7 @@ var Tickets = &discordgo.ApplicationCommand{
|
||||
Description: "Set up support tickets",
|
||||
DefaultMemberPermissions: &manageGuild,
|
||||
Contexts: guildOnly,
|
||||
Options: []*discordgo.ApplicationCommandOption{
|
||||
Options: append([]*discordgo.ApplicationCommandOption{
|
||||
{
|
||||
Type: discordgo.ApplicationCommandOptionSubCommand,
|
||||
Name: "setup",
|
||||
@@ -77,6 +77,7 @@ var Tickets = &discordgo.ApplicationCommand{
|
||||
},
|
||||
},
|
||||
{Type: discordgo.ApplicationCommandOptionSubCommand, Name: "list", Description: "Show the categories"},
|
||||
categoryEditOption(),
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -84,7 +85,7 @@ var Tickets = &discordgo.ApplicationCommand{
|
||||
Name: "panel",
|
||||
Description: "Post the ticket panel, or update it after changing categories",
|
||||
},
|
||||
},
|
||||
}, ticketSettingsOptions()...),
|
||||
}
|
||||
|
||||
// Ticket is used inside a ticket thread.
|
||||
@@ -166,6 +167,10 @@ func TicketsHandler(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||
handleSetup(s, i, sub.Options)
|
||||
case "panel":
|
||||
handlePanel(s, i)
|
||||
case "settings":
|
||||
handleSettings(s, i, sub.Options)
|
||||
case "list":
|
||||
handleList(s, i, sub.Options)
|
||||
case "category":
|
||||
if len(sub.Options) == 0 {
|
||||
return
|
||||
@@ -177,6 +182,8 @@ func TicketsHandler(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||
handleCategoryRemove(s, i, sub.Options[0].Options)
|
||||
case "list":
|
||||
handleCategoryList(s, i)
|
||||
case "edit":
|
||||
handleCategoryEdit(s, i, sub.Options[0].Options)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user