started adding sticky messages

This commit is contained in:
2024-02-21 16:10:52 +01:00
parent 06809f2c40
commit 304f93e28d
5 changed files with 120 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ type Command struct {
ModalID string
}
var commands []Command = []Command{tag_command, short_get_tag_command, dadjoke_command, ping_command, ask_command}
var commands []Command = []Command{tag_command, short_get_tag_command, dadjoke_command, ping_command, sticky_command, ask_command}
func ready(s *discordgo.Session, event *discordgo.Ready) {
for _, guild := range event.Guilds {
@@ -40,7 +40,7 @@ func interactionCreate(s *discordgo.Session, i *discordgo.InteractionCreate) {
if command.Autocomplete != nil && i.ApplicationCommandData().Name == command.Definition.Name {
command.Autocomplete(s, i)
}
case discordgo.InteractionModalSubmit: //g has no modal so it crashes
case discordgo.InteractionModalSubmit:
if command.ModalSubmit != nil && strings.HasPrefix(i.ModalSubmitData().CustomID, command.ModalID) {
command.ModalSubmit(s, i)
}