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:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user