1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-11 01:22:48 +00:00

feat(Bot): add restart command - update discordgo

This commit is contained in:
2020-08-12 23:12:24 -05:00
parent b308123cff
commit 52341faea9
7 changed files with 93 additions and 56 deletions

View File

@@ -27,7 +27,7 @@ func LoggerHandler(s *discordgo.Session, m *discordgo.MessageCreate) {
Timestamp: timestamp,
EditedTimestamp: editedTimestamp,
MentionRoles: strings.Join(m.Message.MentionRoles, ","),
Tts: m.Message.Tts,
TTS: m.Message.TTS,
MentionEveryone: m.Message.MentionEveryone,
UserID: m.Author.ID,
Attachments: attachments,

View File

@@ -109,6 +109,10 @@ func (conn *AudioConnection) handleMessage(m *discordgo.MessageCreate) {
case "random":
conn.PlayRandomAudio(m, nil)
// restart command handled in bot file - needed here to break out
case "restart":
break
default:
conn.PlayAudio(command, m, nil)
}
@@ -375,7 +379,7 @@ loop:
for {
select {
// grab incomming audio
// grab incoming audio
case opusChannel, ok := <-conn.VoiceConnection.OpusRecv:
if !ok {
continue