just renamed 2 functions
This commit is contained in:
@@ -129,13 +129,13 @@ func AutocompleteTag(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
|||||||
s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
||||||
Type: discordgo.InteractionApplicationCommandAutocompleteResult,
|
Type: discordgo.InteractionApplicationCommandAutocompleteResult,
|
||||||
Data: &discordgo.InteractionResponseData{
|
Data: &discordgo.InteractionResponseData{
|
||||||
Choices: generateDynamicChoices(i.GuildID),
|
Choices: generateTagChoices(i.GuildID),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func generateDynamicChoices(guildID string) []*discordgo.ApplicationCommandOptionChoice {
|
func generateTagChoices(guildID string) []*discordgo.ApplicationCommandOptionChoice {
|
||||||
choices := []*discordgo.ApplicationCommandOptionChoice{}
|
choices := []*discordgo.ApplicationCommandOptionChoice{}
|
||||||
IDs, err := getTagIDs(guildID)
|
IDs, err := getTagIDs(guildID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
2
main.go
2
main.go
@@ -28,7 +28,7 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
initTable()
|
initTables()
|
||||||
|
|
||||||
discord, err := discordgo.New("Bot " + os.Getenv("BOT_TOKEN"))
|
discord, err := discordgo.New("Bot " + os.Getenv("BOT_TOKEN"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@@ -6,7 +6,7 @@ import (
|
|||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
func initTable() {
|
func initTables() {
|
||||||
createTableQuery := `CREATE TABLE IF NOT EXISTS tags (
|
createTableQuery := `CREATE TABLE IF NOT EXISTS tags (
|
||||||
tag_id TEXT NOT NULL,
|
tag_id TEXT NOT NULL,
|
||||||
tag_name TEXT NOT NULL,
|
tag_name TEXT NOT NULL,
|
||||||
|
Reference in New Issue
Block a user