Skip to main content

Modal Handler

This command parses the modal submitted questions and triggers the Main CC to add them to the queue.

For more information about the QOTD system, see the overview page.

Trigger

Type: Modal
Custom ID: \A0?qotd-

note

For best results, do not restrict this command's channels or roles.

Configuration

All configuration is done via the qotd setup command. Only run the setup command after installing all four CCs in the QOTD system. See the QOTD system overview for more information.

Code

{{/*
Handles modals during QOTD usage.
See <https://yagpdb-cc.github.io/fun/qotd/modal-handler> for more information.

Author: SoggySaussages <https://github.com/SoggySaussages>
*/}}

{{ ephemeralResponse }}

{{ $config := dbGet 0 "qotd-config" }}
{{ with $config }}
{{ $config = .Value }}
{{ else }}
Something went wrong, please run `{{ .ServerPrefix }}qotd setup` again.
{{ return }}
{{ end }}

{{ if not $config.SuggestionsOpen }}
Sorry, a server admin has disabled question suggestions.
{{ end }}

{{ execCC $config.MainCC nil 0 ( sdict "Suggestion" ( index .Values 0 ) ) }}
Done!

Author

This custom command was written by @SoggySaussages.