main.go aktualisiert
All checks were successful
release-tag / release-image (push) Successful in 2m4s
All checks were successful
release-tag / release-image (push) Successful in 2m4s
This commit is contained in:
18
main.go
18
main.go
@@ -720,11 +720,12 @@ func onInteractionCreate(_ string) func(s *discordgo.Session, i *discordgo.Inter
|
|||||||
_ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{Content: "Konnte Voice-Channel nicht erstellen. Fehlen dem Bot Rechte (Manage Channels/Move Members)?", Flags: discordgo.MessageFlagsEphemeral}})
|
_ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{Content: "Konnte Voice-Channel nicht erstellen. Fehlen dem Bot Rechte (Manage Channels/Move Members)?", Flags: discordgo.MessageFlagsEphemeral}})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
msg := fmt.Sprintf("✅ Voice-Channel **%s** erstellt.", newChan.Name)
|
|
||||||
|
msg := fmt.Sprintf(translations[getLanguage(guildID)]["response.voicechannel.created"], newChan.Name)
|
||||||
if srcVC == "" {
|
if srcVC == "" {
|
||||||
msg += " Du bist aktuell in keinem Voice-Channel; join bitte manuell in deinen neuen Raum."
|
msg += translations[getLanguage(guildID)]["response.voicechannel.created.notinvoice"]
|
||||||
} else {
|
} else {
|
||||||
msg += " Ich verschiebe dich jetzt dort hinein."
|
msg += translations[getLanguage(guildID)]["response.voicechannel.created.move"]
|
||||||
}
|
}
|
||||||
_ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{Content: msg, Flags: discordgo.MessageFlagsEphemeral}})
|
_ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{Content: msg, Flags: discordgo.MessageFlagsEphemeral}})
|
||||||
|
|
||||||
@@ -734,7 +735,7 @@ func onInteractionCreate(_ string) func(s *discordgo.Session, i *discordgo.Inter
|
|||||||
_ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
_ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
||||||
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
||||||
Data: &discordgo.InteractionResponseData{
|
Data: &discordgo.InteractionResponseData{
|
||||||
Content: "❌ Nur Administratoren dürfen das.",
|
Content: translations[getLanguage(guildID)]["response.setlobby.onlyadmins"],
|
||||||
Flags: discordgo.MessageFlagsEphemeral,
|
Flags: discordgo.MessageFlagsEphemeral,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -753,7 +754,7 @@ func onInteractionCreate(_ string) func(s *discordgo.Session, i *discordgo.Inter
|
|||||||
_ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
_ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
||||||
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
||||||
Data: &discordgo.InteractionResponseData{
|
Data: &discordgo.InteractionResponseData{
|
||||||
Content: "Bitte gib einen Namen an.",
|
Content: translations[getLanguage(guildID)]["response.setlobby.pleaseentername"],
|
||||||
Flags: discordgo.MessageFlagsEphemeral,
|
Flags: discordgo.MessageFlagsEphemeral,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -767,7 +768,7 @@ func onInteractionCreate(_ string) func(s *discordgo.Session, i *discordgo.Inter
|
|||||||
_ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
_ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
||||||
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
||||||
Data: &discordgo.InteractionResponseData{
|
Data: &discordgo.InteractionResponseData{
|
||||||
Content: "⚠️ Lobby-Name gesetzt, aber Speichern fehlgeschlagen. Schau die Logs.",
|
Content: translations[getLanguage(guildID)]["response.setlobby.error.saving"],
|
||||||
Flags: discordgo.MessageFlagsEphemeral,
|
Flags: discordgo.MessageFlagsEphemeral,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -775,10 +776,11 @@ func onInteractionCreate(_ string) func(s *discordgo.Session, i *discordgo.Inter
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Antwort <= 3s
|
// Antwort <= 3s
|
||||||
|
msg := fmt.Sprintf(translations[getLanguage(guildID)]["response.setlobby.success"], name)
|
||||||
_ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
_ = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
||||||
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
||||||
Data: &discordgo.InteractionResponseData{
|
Data: &discordgo.InteractionResponseData{
|
||||||
Content: "✅ Lobby-Name aktualisiert auf: " + name,
|
Content: msg,
|
||||||
Flags: discordgo.MessageFlagsEphemeral,
|
Flags: discordgo.MessageFlagsEphemeral,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -1257,7 +1259,7 @@ func Enabled(k string, def bool) bool {
|
|||||||
func main() {
|
func main() {
|
||||||
initDB()
|
initDB()
|
||||||
|
|
||||||
loadTranslationsFromFile(GetENV("TRANSLATIONS_FILE", "./language.json"))
|
loadTranslationsFromFile(GetENV("TRANSLATIONS_FILE", "/tempsrc/language.json"))
|
||||||
token := GetENV("DISCORD_TOKEN", "")
|
token := GetENV("DISCORD_TOKEN", "")
|
||||||
if token == "" {
|
if token == "" {
|
||||||
log.Fatal("Bitte setze DISCORD_TOKEN")
|
log.Fatal("Bitte setze DISCORD_TOKEN")
|
||||||
|
Reference in New Issue
Block a user