diff --git a/cmd/messages_text.go b/cmd/messages_text.go index cd6b19f..2a11599 100644 --- a/cmd/messages_text.go +++ b/cmd/messages_text.go @@ -97,10 +97,10 @@ func (mt *MessagesText) createMessage(m discord.Message) { } func (mt *MessagesText) createHeader(w io.Writer, m discord.Message, isReply bool) { - time := m.Timestamp.Time().In(time.Local).Format(time.Kitchen) + time := m.Timestamp.Time().In(time.Local).Format(cfg.TimestampsFormat) if cfg.Timestamps && cfg.TimestampsBeforeAuthor { - fmt.Fprintf(w, "[::d]%7s[::-] ", time) + fmt.Fprintf(w, "[::d]%s[::-] ", time) } if isReply { diff --git a/internal/config/config.go b/internal/config/config.go index 5def224..11adf90 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -3,6 +3,7 @@ package config import ( "os" "path/filepath" + "time" "github.com/BurntSushi/toml" "github.com/ayn2op/discordo/internal/constants" @@ -13,6 +14,7 @@ type Config struct { Timestamps bool `toml:"timestamps"` TimestampsBeforeAuthor bool `toml:"timestamps_before_author"` + TimestampsFormat string `toml:"timestamps_format"` MessagesLimit uint8 `toml:"messages_limit"` @@ -28,6 +30,7 @@ func DefaultConfig() Config { Timestamps: false, TimestampsBeforeAuthor: false, + TimestampsFormat: time.Kitchen, MessagesLimit: 50, Editor: "default",