From 17d9b4c7da9c50b66f2dc16cd1a7c216b91e56fe Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 17 Feb 2026 14:20:38 +0000 Subject: [PATCH 1/3] RM-19 Ability to hide close / close with reason buttons Signed-off-by: Ben --- multipaneltargets.go | 2 ++ panels.go | 48 +++++++++++++++++++++++++++++++++++--------- settings.go | 24 ++++++++++++++++++---- 3 files changed, 61 insertions(+), 13 deletions(-) diff --git a/multipaneltargets.go b/multipaneltargets.go index f3206b2..24b7a88 100644 --- a/multipaneltargets.go +++ b/multipaneltargets.go @@ -75,6 +75,8 @@ SELECT panels.ticket_notification_channel, panels.cooldown_seconds, panels.ticket_limit, + panels.hide_close_button, + panels.hide_close_with_reason_button, multi_panel_targets.custom_label, multi_panel_targets.description, multi_panel_targets.custom_emoji_name, diff --git a/panels.go b/panels.go index e9bab4f..01a7326 100644 --- a/panels.go +++ b/panels.go @@ -38,6 +38,8 @@ type Panel struct { TicketNotificationChannel *uint64 `json:"ticket_notification_channel,string,omitempty"` CooldownSeconds int `json:"cooldown_seconds"` TicketLimit *uint8 `json:"ticket_limit,omitempty"` + HideCloseButton bool `json:"hide_close_button"` + HideCloseWithReasonButton bool `json:"hide_close_with_reason_button"` } type PanelWithWelcomeMessage struct { @@ -88,6 +90,8 @@ CREATE TABLE IF NOT EXISTS panels( "ticket_notification_channel" int8 DEFAULT NULL, "cooldown_seconds" int NOT NULL DEFAULT 0, "ticket_limit" int2 DEFAULT NULL, + "hide_close_button" bool NOT NULL DEFAULT false, + "hide_close_with_reason_button" bool NOT NULL DEFAULT false, FOREIGN KEY ("welcome_message") REFERENCES embeds("id") ON DELETE SET NULL, FOREIGN KEY ("form_id") REFERENCES forms("form_id"), FOREIGN KEY ("exit_survey_form_id") REFERENCES forms("form_id"), @@ -131,7 +135,9 @@ SELECT use_threads, ticket_notification_channel, cooldown_seconds, - ticket_limit + ticket_limit, + hide_close_button, + hide_close_with_reason_button FROM panels WHERE "message_id" = $1; ` @@ -175,7 +181,9 @@ SELECT use_threads, ticket_notification_channel, cooldown_seconds, - ticket_limit + ticket_limit, + hide_close_button, + hide_close_with_reason_button FROM panels WHERE "panel_id" = $1; ` @@ -220,6 +228,8 @@ SELECT panels.ticket_notification_channel, panels.cooldown_seconds, panels.ticket_limit, + panels.hide_close_button, + panels.hide_close_with_reason_button, embeds.id, embeds.guild_id, embeds.title, @@ -325,7 +335,9 @@ SELECT use_threads, ticket_notification_channel, cooldown_seconds, - ticket_limit + ticket_limit, + hide_close_button, + hide_close_with_reason_button FROM panels WHERE "guild_id" = $1 AND "custom_id" = $2; ` @@ -372,7 +384,9 @@ SELECT use_threads, ticket_notification_channel, cooldown_seconds, - ticket_limit + ticket_limit, + hide_close_button, + hide_close_with_reason_button FROM panels WHERE "guild_id" = $1 AND "form_id" = $2; ` @@ -419,7 +433,9 @@ SELECT panels.use_threads, panels.ticket_notification_channel, panels.cooldown_seconds, - panels.ticket_limit + panels.ticket_limit, + panels.hide_close_button, + panels.hide_close_with_reason_button FROM panels INNER JOIN forms ON forms.form_id = panels.form_id @@ -468,7 +484,9 @@ SELECT use_threads, ticket_notification_channel, cooldown_seconds, - ticket_limit + ticket_limit, + hide_close_button, + hide_close_with_reason_button FROM panels WHERE "guild_id" = $1 ORDER BY "panel_id" ASC;` @@ -523,6 +541,8 @@ SELECT panels.ticket_notification_channel, panels.cooldown_seconds, panels.ticket_limit, + panels.hide_close_button, + panels.hide_close_with_reason_button, embeds.id, embeds.guild_id, embeds.title, @@ -645,9 +665,11 @@ INSERT INTO panels( "use_threads", "ticket_notification_channel", "cooldown_seconds", - "ticket_limit" + "ticket_limit", + "hide_close_button", + "hide_close_with_reason_button" ) -VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28) +VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30) ON CONFLICT("message_id") DO NOTHING RETURNING "panel_id";` @@ -680,6 +702,8 @@ RETURNING "panel_id";` panel.TicketNotificationChannel, panel.CooldownSeconds, panel.TicketLimit, + panel.HideCloseButton, + panel.HideCloseWithReasonButton, ).Scan(&panelId) return @@ -729,7 +753,9 @@ UPDATE panels "use_threads" = $25, "ticket_notification_channel" = $26, "cooldown_seconds" = $27, - "ticket_limit" = $28 + "ticket_limit" = $28, + "hide_close_button" = $29, + "hide_close_with_reason_button" = $30 WHERE "panel_id" = $1 ;` @@ -763,6 +789,8 @@ UPDATE panels panel.TicketNotificationChannel, panel.CooldownSeconds, panel.TicketLimit, + panel.HideCloseButton, + panel.HideCloseWithReasonButton, ) return err @@ -883,5 +911,7 @@ func (p *Panel) fieldPtrs() []interface{} { &p.TicketNotificationChannel, &p.CooldownSeconds, &p.TicketLimit, + &p.HideCloseButton, + &p.HideCloseWithReasonButton, } } diff --git a/settings.go b/settings.go index 2af4849..213568b 100644 --- a/settings.go +++ b/settings.go @@ -21,6 +21,8 @@ type Settings struct { OverflowCategoryId *uint64 `json:"overflow_category_id,string"` // If overflow_enabled and nil, use root ExitSurveyFormId *uint64 `json:"exit_survey_form_id,string"` AnonymiseDashboardResponses bool `json:"anonymise_dashboard_responses"` + HideCloseButton bool `json:"hide_close_button"` + HideCloseWithReasonButton bool `json:"hide_close_with_reason_button"` } func defaultSettings() Settings { @@ -37,6 +39,8 @@ func defaultSettings() Settings { OverflowEnabled: false, OverflowCategoryId: nil, ExitSurveyFormId: nil, + HideCloseButton: false, + HideCloseWithReasonButton: false, } } @@ -67,6 +71,8 @@ CREATE TABLE IF NOT EXISTS settings( "overflow_category_id" int8 DEFAULT NULL, "exit_survey_form_id" int4 DEFAULT NULL, "anonymise_dashboard_responses" bool DEFAULT 'f', + "hide_close_button" bool DEFAULT 'f', + "hide_close_with_reason_button" bool DEFAULT 'f', FOREIGN KEY("context_menu_panel") REFERENCES panels("panel_id") ON DELETE SET NULL, FOREIGN KEY("exit_survey_form_id") REFERENCES forms("form_id") ON DELETE SET NULL, PRIMARY KEY("guild_id"), @@ -89,7 +95,9 @@ SELECT "thread_archive_duration", "overflow_enabled", "overflow_category_id", - "anonymise_dashboard_responses" + "anonymise_dashboard_responses", + "hide_close_button", + "hide_close_with_reason_button" FROM settings WHERE "guild_id" = $1; ` @@ -108,6 +116,8 @@ WHERE "guild_id" = $1; &settings.OverflowEnabled, &settings.OverflowCategoryId, &settings.AnonymiseDashboardResponses, + &settings.HideCloseButton, + &settings.HideCloseWithReasonButton, ) if err == nil { @@ -134,9 +144,11 @@ INSERT INTO settings( "thread_archive_duration", "overflow_enabled", "overflow_category_id", - "anonymise_dashboard_responses" + "anonymise_dashboard_responses", + "hide_close_button", + "hide_close_with_reason_button" ) -VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13) +VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15) ON CONFLICT("guild_id") DO UPDATE SET "hide_claim_button" = $2, @@ -150,7 +162,9 @@ DO UPDATE SET "thread_archive_duration" = $10, "overflow_enabled" = $11, "overflow_category_id" = $12, - "anonymise_dashboard_responses" = $13 + "anonymise_dashboard_responses" = $13, + "hide_close_button" = $14, + "hide_close_with_reason_button" = $15 ; ` @@ -168,6 +182,8 @@ DO UPDATE SET settings.OverflowEnabled, settings.OverflowCategoryId, settings.AnonymiseDashboardResponses, + settings.HideCloseButton, + settings.HideCloseWithReasonButton, ) return From f113f8c4fd535b4a0115341404905f373776b0ae Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 17 Feb 2026 17:49:10 +0000 Subject: [PATCH 2/3] add hide claim button Signed-off-by: Ben --- multipaneltargets.go | 1 + panels.go | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/multipaneltargets.go b/multipaneltargets.go index 24b7a88..0f60b98 100644 --- a/multipaneltargets.go +++ b/multipaneltargets.go @@ -75,6 +75,7 @@ SELECT panels.ticket_notification_channel, panels.cooldown_seconds, panels.ticket_limit, + panels.hide_claim_button, panels.hide_close_button, panels.hide_close_with_reason_button, multi_panel_targets.custom_label, diff --git a/panels.go b/panels.go index 01a7326..194e1ed 100644 --- a/panels.go +++ b/panels.go @@ -38,6 +38,7 @@ type Panel struct { TicketNotificationChannel *uint64 `json:"ticket_notification_channel,string,omitempty"` CooldownSeconds int `json:"cooldown_seconds"` TicketLimit *uint8 `json:"ticket_limit,omitempty"` + HideClaimButton bool `json:"hide_claim_button"` HideCloseButton bool `json:"hide_close_button"` HideCloseWithReasonButton bool `json:"hide_close_with_reason_button"` } @@ -90,6 +91,7 @@ CREATE TABLE IF NOT EXISTS panels( "ticket_notification_channel" int8 DEFAULT NULL, "cooldown_seconds" int NOT NULL DEFAULT 0, "ticket_limit" int2 DEFAULT NULL, + "hide_claim_button" bool NOT NULL DEFAULT false, "hide_close_button" bool NOT NULL DEFAULT false, "hide_close_with_reason_button" bool NOT NULL DEFAULT false, FOREIGN KEY ("welcome_message") REFERENCES embeds("id") ON DELETE SET NULL, @@ -136,6 +138,7 @@ SELECT ticket_notification_channel, cooldown_seconds, ticket_limit, + hide_claim_button, hide_close_button, hide_close_with_reason_button FROM panels @@ -182,6 +185,7 @@ SELECT ticket_notification_channel, cooldown_seconds, ticket_limit, + hide_claim_button, hide_close_button, hide_close_with_reason_button FROM panels @@ -228,6 +232,7 @@ SELECT panels.ticket_notification_channel, panels.cooldown_seconds, panels.ticket_limit, + panels.hide_claim_button, panels.hide_close_button, panels.hide_close_with_reason_button, embeds.id, @@ -336,6 +341,7 @@ SELECT ticket_notification_channel, cooldown_seconds, ticket_limit, + hide_claim_button, hide_close_button, hide_close_with_reason_button FROM panels @@ -385,6 +391,7 @@ SELECT ticket_notification_channel, cooldown_seconds, ticket_limit, + hide_claim_button, hide_close_button, hide_close_with_reason_button FROM panels @@ -434,6 +441,7 @@ SELECT panels.ticket_notification_channel, panels.cooldown_seconds, panels.ticket_limit, + panels.hide_claim_button, panels.hide_close_button, panels.hide_close_with_reason_button FROM panels @@ -485,6 +493,7 @@ SELECT ticket_notification_channel, cooldown_seconds, ticket_limit, + hide_claim_button, hide_close_button, hide_close_with_reason_button FROM panels @@ -541,6 +550,7 @@ SELECT panels.ticket_notification_channel, panels.cooldown_seconds, panels.ticket_limit, + panels.hide_claim_button, panels.hide_close_button, panels.hide_close_with_reason_button, embeds.id, @@ -666,10 +676,11 @@ INSERT INTO panels( "ticket_notification_channel", "cooldown_seconds", "ticket_limit", + "hide_claim_button", "hide_close_button", "hide_close_with_reason_button" ) -VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30) +VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31) ON CONFLICT("message_id") DO NOTHING RETURNING "panel_id";` @@ -702,6 +713,7 @@ RETURNING "panel_id";` panel.TicketNotificationChannel, panel.CooldownSeconds, panel.TicketLimit, + panel.HideClaimButton, panel.HideCloseButton, panel.HideCloseWithReasonButton, ).Scan(&panelId) @@ -754,8 +766,9 @@ UPDATE panels "ticket_notification_channel" = $26, "cooldown_seconds" = $27, "ticket_limit" = $28, - "hide_close_button" = $29, - "hide_close_with_reason_button" = $30 + "hide_claim_button" = $29, + "hide_close_button" = $30, + "hide_close_with_reason_button" = $31 WHERE "panel_id" = $1 ;` @@ -789,6 +802,7 @@ UPDATE panels panel.TicketNotificationChannel, panel.CooldownSeconds, panel.TicketLimit, + panel.HideClaimButton, panel.HideCloseButton, panel.HideCloseWithReasonButton, ) @@ -911,6 +925,7 @@ func (p *Panel) fieldPtrs() []interface{} { &p.TicketNotificationChannel, &p.CooldownSeconds, &p.TicketLimit, + &p.HideClaimButton, &p.HideCloseButton, &p.HideCloseWithReasonButton, } From 622ee57436459b761a9f77126ab7cb5f77c3b927 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 17 Feb 2026 18:46:11 +0000 Subject: [PATCH 3/3] fix order Signed-off-by: Ben --- multipaneltargets.go | 2 +- panels.go | 110 +++++++++++++++++++++---------------------- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/multipaneltargets.go b/multipaneltargets.go index 0f60b98..43f869c 100644 --- a/multipaneltargets.go +++ b/multipaneltargets.go @@ -75,9 +75,9 @@ SELECT panels.ticket_notification_channel, panels.cooldown_seconds, panels.ticket_limit, - panels.hide_claim_button, panels.hide_close_button, panels.hide_close_with_reason_button, + panels.hide_claim_button, multi_panel_targets.custom_label, multi_panel_targets.description, multi_panel_targets.custom_emoji_name, diff --git a/panels.go b/panels.go index 194e1ed..2b39c07 100644 --- a/panels.go +++ b/panels.go @@ -9,38 +9,38 @@ import ( ) type Panel struct { - PanelId int `json:"panel_id"` - MessageId uint64 `json:"message_id,string"` - ChannelId uint64 `json:"channel_id,string"` - GuildId uint64 `json:"guild_id,string"` - Title string `json:"title"` - Content string `json:"content"` - Colour int32 `json:"colour"` - TargetCategory uint64 `json:"category_id,string"` - EmojiName *string `json:"emoji_name"` - EmojiId *uint64 `json:"emoji_id,string"` - WelcomeMessageEmbed *int `json:"welcome_message_embed"` - WithDefaultTeam bool `json:"default_team"` - CustomId string `json:"custom_id"` - ImageUrl *string `json:"image_url,omitempty"` - ThumbnailUrl *string `json:"thumbnail_url,omitempty"` - ButtonStyle int `json:"button_style"` - ButtonLabel string `json:"button_label"` - FormId *int `json:"form_id"` - NamingScheme *string `json:"naming_scheme"` - ForceDisabled bool `json:"force_disabled"` - Disabled bool `json:"disabled"` - ExitSurveyFormId *int `json:"exit_survey_form_id"` - PendingCategory *uint64 `json:"pending_category,string"` - DeleteMentions bool `json:"delete_mentions"` - TranscriptChannelId *uint64 `json:"transcript_channel_id,string,omitempty"` - UseThreads bool `json:"use_threads"` - TicketNotificationChannel *uint64 `json:"ticket_notification_channel,string,omitempty"` - CooldownSeconds int `json:"cooldown_seconds"` - TicketLimit *uint8 `json:"ticket_limit,omitempty"` - HideClaimButton bool `json:"hide_claim_button"` - HideCloseButton bool `json:"hide_close_button"` - HideCloseWithReasonButton bool `json:"hide_close_with_reason_button"` + PanelId int `json:"panel_id"` + MessageId uint64 `json:"message_id,string"` + ChannelId uint64 `json:"channel_id,string"` + GuildId uint64 `json:"guild_id,string"` + Title string `json:"title"` + Content string `json:"content"` + Colour int32 `json:"colour"` + TargetCategory uint64 `json:"category_id,string"` + EmojiName *string `json:"emoji_name"` + EmojiId *uint64 `json:"emoji_id,string"` + WelcomeMessageEmbed *int `json:"welcome_message_embed"` + WithDefaultTeam bool `json:"default_team"` + CustomId string `json:"custom_id"` + ImageUrl *string `json:"image_url,omitempty"` + ThumbnailUrl *string `json:"thumbnail_url,omitempty"` + ButtonStyle int `json:"button_style"` + ButtonLabel string `json:"button_label"` + FormId *int `json:"form_id"` + NamingScheme *string `json:"naming_scheme"` + ForceDisabled bool `json:"force_disabled"` + Disabled bool `json:"disabled"` + ExitSurveyFormId *int `json:"exit_survey_form_id"` + PendingCategory *uint64 `json:"pending_category,string"` + DeleteMentions bool `json:"delete_mentions"` + TranscriptChannelId *uint64 `json:"transcript_channel_id,string,omitempty"` + UseThreads bool `json:"use_threads"` + TicketNotificationChannel *uint64 `json:"ticket_notification_channel,string,omitempty"` + CooldownSeconds int `json:"cooldown_seconds"` + TicketLimit *uint8 `json:"ticket_limit,omitempty"` + HideCloseButton bool `json:"hide_close_button"` + HideCloseWithReasonButton bool `json:"hide_close_with_reason_button"` + HideClaimButton bool `json:"hide_claim_button"` } type PanelWithWelcomeMessage struct { @@ -91,9 +91,9 @@ CREATE TABLE IF NOT EXISTS panels( "ticket_notification_channel" int8 DEFAULT NULL, "cooldown_seconds" int NOT NULL DEFAULT 0, "ticket_limit" int2 DEFAULT NULL, - "hide_claim_button" bool NOT NULL DEFAULT false, "hide_close_button" bool NOT NULL DEFAULT false, "hide_close_with_reason_button" bool NOT NULL DEFAULT false, + "hide_claim_button" bool NOT NULL DEFAULT false, FOREIGN KEY ("welcome_message") REFERENCES embeds("id") ON DELETE SET NULL, FOREIGN KEY ("form_id") REFERENCES forms("form_id"), FOREIGN KEY ("exit_survey_form_id") REFERENCES forms("form_id"), @@ -138,9 +138,9 @@ SELECT ticket_notification_channel, cooldown_seconds, ticket_limit, - hide_claim_button, hide_close_button, - hide_close_with_reason_button + hide_close_with_reason_button, + hide_claim_button FROM panels WHERE "message_id" = $1; ` @@ -185,9 +185,9 @@ SELECT ticket_notification_channel, cooldown_seconds, ticket_limit, - hide_claim_button, hide_close_button, - hide_close_with_reason_button + hide_close_with_reason_button, + hide_claim_button FROM panels WHERE "panel_id" = $1; ` @@ -232,9 +232,9 @@ SELECT panels.ticket_notification_channel, panels.cooldown_seconds, panels.ticket_limit, - panels.hide_claim_button, panels.hide_close_button, panels.hide_close_with_reason_button, + panels.hide_claim_button, embeds.id, embeds.guild_id, embeds.title, @@ -341,9 +341,9 @@ SELECT ticket_notification_channel, cooldown_seconds, ticket_limit, - hide_claim_button, hide_close_button, - hide_close_with_reason_button + hide_close_with_reason_button, + hide_claim_button FROM panels WHERE "guild_id" = $1 AND "custom_id" = $2; ` @@ -391,9 +391,9 @@ SELECT ticket_notification_channel, cooldown_seconds, ticket_limit, - hide_claim_button, hide_close_button, - hide_close_with_reason_button + hide_close_with_reason_button, + hide_claim_button FROM panels WHERE "guild_id" = $1 AND "form_id" = $2; ` @@ -441,9 +441,9 @@ SELECT panels.ticket_notification_channel, panels.cooldown_seconds, panels.ticket_limit, - panels.hide_claim_button, panels.hide_close_button, - panels.hide_close_with_reason_button + panels.hide_close_with_reason_button, + panels.hide_claim_button FROM panels INNER JOIN forms ON forms.form_id = panels.form_id @@ -493,9 +493,9 @@ SELECT ticket_notification_channel, cooldown_seconds, ticket_limit, - hide_claim_button, hide_close_button, - hide_close_with_reason_button + hide_close_with_reason_button, + hide_claim_button FROM panels WHERE "guild_id" = $1 ORDER BY "panel_id" ASC;` @@ -550,9 +550,9 @@ SELECT panels.ticket_notification_channel, panels.cooldown_seconds, panels.ticket_limit, - panels.hide_claim_button, panels.hide_close_button, panels.hide_close_with_reason_button, + panels.hide_claim_button, embeds.id, embeds.guild_id, embeds.title, @@ -676,9 +676,9 @@ INSERT INTO panels( "ticket_notification_channel", "cooldown_seconds", "ticket_limit", - "hide_claim_button", "hide_close_button", - "hide_close_with_reason_button" + "hide_close_with_reason_button", + "hide_claim_button" ) VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31) ON CONFLICT("message_id") DO NOTHING @@ -713,9 +713,9 @@ RETURNING "panel_id";` panel.TicketNotificationChannel, panel.CooldownSeconds, panel.TicketLimit, - panel.HideClaimButton, panel.HideCloseButton, panel.HideCloseWithReasonButton, + panel.HideClaimButton, ).Scan(&panelId) return @@ -766,9 +766,9 @@ UPDATE panels "ticket_notification_channel" = $26, "cooldown_seconds" = $27, "ticket_limit" = $28, - "hide_claim_button" = $29, - "hide_close_button" = $30, - "hide_close_with_reason_button" = $31 + "hide_close_button" = $29, + "hide_close_with_reason_button" = $30, + "hide_claim_button" = $31 WHERE "panel_id" = $1 ;` @@ -802,9 +802,9 @@ UPDATE panels panel.TicketNotificationChannel, panel.CooldownSeconds, panel.TicketLimit, - panel.HideClaimButton, panel.HideCloseButton, panel.HideCloseWithReasonButton, + panel.HideClaimButton, ) return err @@ -925,8 +925,8 @@ func (p *Panel) fieldPtrs() []interface{} { &p.TicketNotificationChannel, &p.CooldownSeconds, &p.TicketLimit, - &p.HideClaimButton, &p.HideCloseButton, &p.HideCloseWithReasonButton, + &p.HideClaimButton, } }