1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-10 09:02:49 +00:00

adjust timestamp

This commit is contained in:
2018-04-09 23:34:22 -05:00
parent 3e0cd3c948
commit 27a42f1b99
2 changed files with 4 additions and 5 deletions

View File

@@ -1,7 +1,6 @@
package bothandlers package bothandlers
import ( import (
"strconv"
"strings" "strings"
"github.com/bwmarrin/discordgo" "github.com/bwmarrin/discordgo"
@@ -24,8 +23,8 @@ func LoggerHandler(s *discordgo.Session, m *discordgo.MessageCreate) {
ID: m.Message.ID, ID: m.Message.ID,
ChannelID: m.Message.ChannelID, ChannelID: m.Message.ChannelID,
Content: m.Message.Content, Content: m.Message.Content,
Timestamp: strconv.Itoa(int(timestamp.Unix())), Timestamp: timestamp,
EditedTimestamp: strconv.Itoa(int(editedTimestamp.Unix())), EditedTimestamp: editedTimestamp,
MentionRoles: strings.Join(m.Message.MentionRoles, ","), MentionRoles: strings.Join(m.Message.MentionRoles, ","),
Tts: m.Message.Tts, Tts: m.Message.Tts,
MentionEveryone: m.Message.MentionEveryone, MentionEveryone: m.Message.MentionEveryone,

View File

@@ -14,8 +14,8 @@ type Message struct {
DeletedAt *time.Time `json:"deleted_at"` DeletedAt *time.Time `json:"deleted_at"`
ChannelID string `json:"channel_id"` ChannelID string `json:"channel_id"`
Content string `json:"content"` Content string `json:"content"`
Timestamp string `json:"timestamp"` Timestamp time.Time `json:"timestamp"`
EditedTimestamp string `json:"edited_timestamp"` EditedTimestamp time.Time `json:"edited_timestamp"`
MentionRoles string `json:"mention_roles"` MentionRoles string `json:"mention_roles"`
Tts bool `json:"tts"` Tts bool `json:"tts"`
MentionEveryone bool `json:"mention_everyone"` MentionEveryone bool `json:"mention_everyone"`