diff --git a/config/config.go b/config/config.go index 4b19b7d..a7b7a8a 100644 --- a/config/config.go +++ b/config/config.go @@ -5,6 +5,7 @@ import ( "os" "path/filepath" "runtime" + "time" "github.com/BurntSushi/toml" ) @@ -41,6 +42,7 @@ type Config struct { Timestamps bool `toml:"timestamps"` MessagesLimit uint `toml:"messages_limit"` Timezone string `toml:"timezone"` + TimeFormat string `toml:"time_format"` AttachmentDownloadsDir string `toml:"attachment_downloads_dir"` Identify IdentifyConfig `toml:"identify"` Theme ThemeConfig `toml:"theme"` @@ -53,6 +55,7 @@ func New() *Config { Timestamps: false, MessagesLimit: 50, Timezone: "Local", + TimeFormat: time.Stamp, AttachmentDownloadsDir: UserDownloadsDir(), Identify: IdentifyConfig{ UserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36", diff --git a/ui/builder.go b/ui/builder.go index beb7862..3570830 100644 --- a/ui/builder.go +++ b/ui/builder.go @@ -29,7 +29,7 @@ func buildMessage(app *App, m discord.Message) []byte { } b.WriteString("[::d]") - b.WriteString(m.Timestamp.Time().In(loc).Format(time.Stamp)) + b.WriteString(m.Timestamp.Time().In(loc).Format(app.Config.TimeFormat)) b.WriteString("[::-]") b.WriteByte(' ') }