Add timestamps field to configuration
This commit is contained in:
parent
ad9b1cade3
commit
eac2a2cd76
2 changed files with 9 additions and 2 deletions
|
|
@ -36,6 +36,7 @@ type ThemeConfig struct {
|
|||
type Config struct {
|
||||
Mouse bool `yaml:"mouse"`
|
||||
MessagesLimit uint `yaml:"messages_limit"`
|
||||
Timestamps bool `yaml:"timestamps"`
|
||||
|
||||
Theme ThemeConfig `yaml:"theme"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ func newMessagesText() *MessagesText {
|
|||
mt.SetDynamicColors(true)
|
||||
mt.SetRegions(true)
|
||||
mt.SetWordWrap(true)
|
||||
mt.ScrollToEnd()
|
||||
|
||||
mt.SetBorder(cfg.Theme.MessagesText.Border)
|
||||
|
||||
|
|
@ -41,6 +42,7 @@ func (mt *MessagesText) newMessage(m *discord.Message) error {
|
|||
|
||||
// Author
|
||||
mt.newAuthor(m.ReferencedMessage)
|
||||
|
||||
// Content
|
||||
mt.newContent(m.ReferencedMessage)
|
||||
|
||||
|
|
@ -48,10 +50,14 @@ func (mt *MessagesText) newMessage(m *discord.Message) error {
|
|||
fmt.Fprintln(mt)
|
||||
}
|
||||
|
||||
// Timestamps
|
||||
mt.newTimestamp(m)
|
||||
if cfg.Timestamps {
|
||||
// Timestamps
|
||||
mt.newTimestamp(m)
|
||||
}
|
||||
|
||||
// Author
|
||||
mt.newAuthor(m)
|
||||
|
||||
// Content
|
||||
mt.newContent(m)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue