diff --git a/main.go b/main.go index 41e13ce..06124e3 100644 --- a/main.go +++ b/main.go @@ -792,7 +792,7 @@ func onInteractionCreate(_ string) func(s *discordgo.Session, i *discordgo.Inter _ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ - Content: "❌ Nur Administratoren dürfen das.", + Content: translations[getLanguage(guildID)]["response.setcategory.onlyadmins"], Flags: discordgo.MessageFlagsEphemeral, }, }) @@ -811,7 +811,7 @@ func onInteractionCreate(_ string) func(s *discordgo.Session, i *discordgo.Inter _ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ - Content: "Bitte gib einen Namen an.", + Content: translations[getLanguage(guildID)]["response.setcategory.error.name"], Flags: discordgo.MessageFlagsEphemeral, }, }) @@ -825,7 +825,7 @@ func onInteractionCreate(_ string) func(s *discordgo.Session, i *discordgo.Inter _ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ - Content: "⚠️ Kategorie-Name gesetzt, aber Speichern fehlgeschlagen. Schau die Logs.", + Content: translations[getLanguage(guildID)]["response.setcategory.error.saving"], Flags: discordgo.MessageFlagsEphemeral, }, }) @@ -833,10 +833,11 @@ func onInteractionCreate(_ string) func(s *discordgo.Session, i *discordgo.Inter } // Antwort <= 3s + msg := fmt.Sprintf(translations[getLanguage(guildID)]["response.setcategory.success"], name) _ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ - Content: "✅ Kategorie-Name aktualisiert auf: " + name, + Content: msg, Flags: discordgo.MessageFlagsEphemeral, }, }) @@ -847,7 +848,7 @@ func onInteractionCreate(_ string) func(s *discordgo.Session, i *discordgo.Inter _ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ - Content: "❌ Nur Administratoren dürfen das.", + Content: translations[getLanguage(guildID)]["response.settimeout.onlyadmins"], Flags: discordgo.MessageFlagsEphemeral, }, }) @@ -873,7 +874,7 @@ func onInteractionCreate(_ string) func(s *discordgo.Session, i *discordgo.Inter _ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ - Content: "⚠️ Timeout gesetzt, aber Speichern fehlgeschlagen. Schau die Logs.", + Content: translations[getLanguage(guildID)]["response.settimeout.error.saving"], Flags: discordgo.MessageFlagsEphemeral, }, }) @@ -881,10 +882,11 @@ func onInteractionCreate(_ string) func(s *discordgo.Session, i *discordgo.Inter } // Antwort <= 3s + msg := fmt.Sprintf(translations[getLanguage(guildID)]["response.settimeout.success"], minutes) _ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ - Content: fmt.Sprintf("✅ Timeout auf %d Minuten gesetzt.", minutes), + Content: msg, Flags: discordgo.MessageFlagsEphemeral, }, }) @@ -914,7 +916,7 @@ func onInteractionCreate(_ string) func(s *discordgo.Session, i *discordgo.Inter _ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ - Content: "Bitte gib ein gültiges Mitglied an.", + Content: translations[getLanguage(guildID)]["response.adduser.error.user"], Flags: discordgo.MessageFlagsEphemeral, }, }) @@ -927,7 +929,7 @@ func onInteractionCreate(_ string) func(s *discordgo.Session, i *discordgo.Inter _ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ - Content: "Du bist aktuell in keinem Voice-Channel. Betritt zuerst deinen privaten Channel.", + Content: translations[getLanguage(guildID)]["response.adduser.error.notinvoice"], Flags: discordgo.MessageFlagsEphemeral, }, }) @@ -941,7 +943,7 @@ func onInteractionCreate(_ string) func(s *discordgo.Session, i *discordgo.Inter _ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ - Content: "❌ Du bist nicht der Besitzer dieses Channels oder dir fehlen Rechte (Manage Channel).", + Content: translations[getLanguage(guildID)]["response.adduser.error.notowner"], Flags: discordgo.MessageFlagsEphemeral, }, }) @@ -963,20 +965,21 @@ func onInteractionCreate(_ string) func(s *discordgo.Session, i *discordgo.Inter allow, 0, ); err != nil { + msg := fmt.Sprintf(translations[getLanguage(guildID)]["response.adduser.error.setpermissions"], err) _ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ - Content: fmt.Sprintf("Konnte Berechtigung nicht setzen: %v", err), + Content: msg, Flags: discordgo.MessageFlagsEphemeral, }, }) return } - + msg := fmt.Sprintf(translations[getLanguage(guildID)]["response.adduser.success"], target.Username) _ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ - Content: fmt.Sprintf("✅ %s hat jetzt Zugriff auf deinen Voice-Channel.", target.Username), + Content: msg, Flags: discordgo.MessageFlagsEphemeral, }, })