From fc1e2424db1a566547cabbfb5d16b2b7045ccadf Mon Sep 17 00:00:00 2001 From: adminoo Date: Sat, 7 May 2022 11:05:45 +0200 Subject: [PATCH] slash doesn't play well with new settings, experts say --- core/commands.go | 16 ++++++++-------- core/messages.go | 3 --- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/core/commands.go b/core/commands.go index 73abeca..9029da8 100755 --- a/core/commands.go +++ b/core/commands.go @@ -40,15 +40,15 @@ func SetCommand( // add commands to the register func CommandInit() { SetCommand( - []string{"/ggd audio", "/ggd tts"}, + []string{"ggd audio", "ggd tts"}, "*Attach a TTS version of the message on the channel*", - "`/ggd [audio|tts] hello everyone`", + "`ggd [audio|tts] hello everyone`", MessageAudio) SetCommand( - []string{"/ggd voca"}, + []string{"ggd voca"}, "Play audio message in vocal channel", - "`/ggd voca let's go shopping`", + "`ggd voca let's go shopping`", MessageVocal) SetCommand( @@ -58,14 +58,14 @@ func CommandInit() { MessagePing) SetCommand( - []string{"/ggd help", "/ggd info"}, + []string{"ggd help", "ggd info"}, "*Display the available list of commands*", - "`/ggd [help|info]`", + "`ggd [help|info]`", MessageHelp) SetCommand( - []string{"/ggd hat", "/ggd chapeau", "/ggd chapo"}, + []string{"ggd hat", "ggd chapeau", "ggd chapo"}, "*Hand over a set of fancy hats*", - "`/ggd [hat|chapeau|chapo]`", + "`ggd [hat|chapeau|chapo]`", MessageHat) } diff --git a/core/messages.go b/core/messages.go index 17c378a..df9a2d6 100755 --- a/core/messages.go +++ b/core/messages.go @@ -3,7 +3,6 @@ package core import ( "bytes" "fmt" - "log" "math/rand" "sort" "strings" @@ -120,13 +119,11 @@ func MessagePing(s *discordgo.Session, m *discordgo.MessageCreate, message strin // generate TTS version of the message and upload it to the channel func MessageAudio(s *discordgo.Session, m *discordgo.MessageCreate, message string) { - log.Println("Messageaudio :", message) var cleanMessage string = prepareTTSMessage(message) filename, out := getAudioMessage(cleanMessage) file := bytes.NewReader(out) s.ChannelFileSend(m.ChannelID, filename, file) // delete the receveid command after processing it. less clutter - log.Println("Messageaudio :", cleanMessage) s.ChannelMessageDelete(m.ChannelID, m.ID) }