Merge pull request 'Clean up comments' (#10) from comment-cleanup into master

Reviewed-on: https://git.thegrind.dev/thegrind/papibot/pulls/10
Reviewed-by: xbazzi <xander@xbazzi.com>
This commit is contained in:
javif89 2025-02-05 01:28:56 -07:00
commit 7246fba257

View File

@ -14,8 +14,6 @@ import (
"github.com/javif89/dotenv"
)
// var commandPrefix string = "!"
var commandHandlers = map[string]func(s *dg.Session, i *dg.InteractionCreate){
"play": playCommand,
}
@ -36,7 +34,6 @@ func main() {
}
discord.AddHandler(ready)
// discord.AddHandler(handleCommand) // This will receive an event when a message is sent
discord.Identify.Intents = dg.IntentsGuilds | dg.IntentsGuildMessages | dg.IntentsGuildVoiceStates
@ -158,7 +155,6 @@ func playOnVoiceChannel(voiceChannel *dg.VoiceConnection) {
log.Fatal(err)
}
// log.Printf("Read packet: %d bytes", n)
packets = append(packets, p[:n])
}
@ -166,7 +162,6 @@ func playOnVoiceChannel(voiceChannel *dg.VoiceConnection) {
log.Printf("bytes sent = %d", bytes_sent)
log.Printf("Took %s seconds to run", elapsedTime)
// log.Printf("Bytes/Sec = %s", elapsedTime)
voiceChannel.Speaking(true)
time.Sleep(time.Second * 2)
@ -177,7 +172,7 @@ func playOnVoiceChannel(voiceChannel *dg.VoiceConnection) {
for _, p := range packets {
log.Printf("Sending packet: %d bytes", len(p))
bytes_sent += len(p)
// packets_sent := packets_sent + p
voiceChannel.OpusSend <- p
}