Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bot/button/handlers/exitsurveysubmit.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ func (h *ExitSurveySubmitHandler) Execute(cmd *cmdcontext.ModalContext) {

cmd.EditWithRaw(customisation.Green, "Success", "Thank you for your feedback!") // TODO: i18n

if len(responses) == 0 {
return
}

if err := addViewFeedbackButton(ctx, cmd, ticket); err != nil {
cmd.HandleError(err)
return
Expand Down
4 changes: 2 additions & 2 deletions bot/button/handlers/form.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ func parseModalComponents(actionRows []interaction.ModalSubmitInteractionActionR
case component.ComponentRadioGroup:
answer = c.Value
}
if input, ok := inputsByCustomId[c.CustomId]; ok {
if input, ok := inputsByCustomId[c.CustomId]; ok && component.ComponentType(input.Type) == c.Type {
answers[input] = answer
}
continue
}
for _, comp := range actionRow.Components {
if formInput, ok := inputsByCustomId[comp.CustomId]; ok {
if formInput, ok := inputsByCustomId[comp.CustomId]; ok && component.ComponentType(formInput.Type) == comp.Type {
answers[formInput] = comp.Value
}
}
Expand Down
3 changes: 3 additions & 0 deletions bot/button/handlers/panel.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ func buildFormComponents(inputs []database.FormInput, inputOptions map[int][]dat
MaxValues: maxLength,
Required: utils.Ptr(input.Required),
})
case int(component.ComponentTextDisplay):
components[i] = component.BuildTextDisplay(component.TextDisplay{Content: utils.ValueOrZero(input.Content)})
continue // Discord only allows Text Display at the top level, not inside a Label
}

label := component.Label{
Expand Down
2 changes: 1 addition & 1 deletion bot/button/handlers/viewsurvey.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (h *ViewSurveyHandler) Execute(ctx *context.ButtonContext) {

for _, answer := range surveyResponse.Responses {
var title string
if answer.Question == nil {
if answer.Question == nil || *answer.Question == "" {
title = "Unknown Question"
} else {
title = *answer.Question
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ go 1.26.0
require (
cloud.google.com/go/profiler v0.4.2
github.com/TicketsBot-cloud/archiverclient v0.0.0-20251015181023-f0b66a074704
github.com/TicketsBot-cloud/common v0.0.0-20260905165836-38e4090764a4
github.com/TicketsBot-cloud/database v0.0.0-20260913165941-c2ecc7191b02
github.com/TicketsBot-cloud/common v0.0.0-20260927072029-424264fc4be2
github.com/TicketsBot-cloud/database v0.0.0-20261002063446-01dca52a987e
github.com/TicketsBot-cloud/gdl v0.0.0-20260426095953-999472e6e538
github.com/caarlos0/env/v10 v10.0.0
github.com/elliotchance/orderedmap v1.8.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0
github.com/ReneKroon/ttlcache v1.6.0/go.mod h1:DG6nbhXKUQhrExfwwLuZUdH7UnRDDRA1IW+nBuCssvs=
github.com/TicketsBot-cloud/archiverclient v0.0.0-20251015181023-f0b66a074704 h1:liLfvCrzoJ89DXFHzsd1iK3cyP8s4i0CnZPRFEj53zg=
github.com/TicketsBot-cloud/archiverclient v0.0.0-20251015181023-f0b66a074704/go.mod h1:Mux1bEPpOHwRw1wo6Fa6qJLJH9Erk9qv1yAIfLi1Wmw=
github.com/TicketsBot-cloud/common v0.0.0-20260905165836-38e4090764a4 h1:zcPcJ+03xW9qalqzqllM6j0ZPdhuL+mrtGw8woLrAMo=
github.com/TicketsBot-cloud/common v0.0.0-20260905165836-38e4090764a4/go.mod h1:yL+VPSYNVK5gxUkA+fbb0WdTjGfWXnr7ScfL0rwk29g=
github.com/TicketsBot-cloud/database v0.0.0-20260913165941-c2ecc7191b02 h1:3Z8PpXBUbdYn2srMRg3Nj0MDxnTB53CzIEAOUBIubhM=
github.com/TicketsBot-cloud/database v0.0.0-20260913165941-c2ecc7191b02/go.mod h1:0fKn7nPX6KeljYNQtGQiuZ5aJ/TczgXvBhnbz+4GEc8=
github.com/TicketsBot-cloud/common v0.0.0-20260927072029-424264fc4be2 h1:qeebeGGdrsDXrngOVrKMDt9G3JUTJwT/IEPTB61d46s=
github.com/TicketsBot-cloud/common v0.0.0-20260927072029-424264fc4be2/go.mod h1:yL+VPSYNVK5gxUkA+fbb0WdTjGfWXnr7ScfL0rwk29g=
github.com/TicketsBot-cloud/database v0.0.0-20261002063446-01dca52a987e h1:kZS42Mp+6wBhApK7zA6F1SX8ZYYG18cVRHB2ZDTvx94=
github.com/TicketsBot-cloud/database v0.0.0-20261002063446-01dca52a987e/go.mod h1:0fKn7nPX6KeljYNQtGQiuZ5aJ/TczgXvBhnbz+4GEc8=
github.com/TicketsBot-cloud/gdl v0.0.0-20260426095953-999472e6e538 h1:ewKw1Wv1x/yi8h1IH7EofcYnPUxWZaVTIPFkT97nhn0=
github.com/TicketsBot-cloud/gdl v0.0.0-20260426095953-999472e6e538/go.mod h1:CdwBR2egPtxUXjD2CgC9ZwfuB8dz9HPePM8nuG6dt7Y=
github.com/TicketsBot-cloud/logarchiver v0.0.0-20251018211319-7a7df5cacbdc h1:qTLNpCvIqM7UwZ6MdWQ9EztcDsIJfHh+VJdG+ULLEaA=
Expand Down
Loading