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

fix: channel join sound bug

This commit is contained in:
2022-03-23 22:13:28 -05:00
parent 6b8db59e98
commit 149ba48802
7 changed files with 64 additions and 74 deletions

View File

@@ -2,6 +2,7 @@ package bothandlers
import (
"strings"
"time"
"github.com/bwmarrin/discordgo"
"github.com/mgerb/go-discord-bot/server/db"
@@ -16,8 +17,11 @@ func LoggerHandler(s *discordgo.Session, m *discordgo.MessageCreate) {
model.UserSave(db.GetConn(), user)
// create and save message
timestamp, _ := m.Message.Timestamp.Parse()
editedTimestamp, _ := m.Message.EditedTimestamp.Parse()
timestamp := m.Message.Timestamp
var editedTimestamp time.Time
if m.Message.EditedTimestamp != nil {
editedTimestamp = *m.Message.EditedTimestamp
}
attachments := getAttachments(m.Message.Attachments)
message := &model.Message{