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