summaryrefslogtreecommitdiff
path: root/irc/tokens.go
diff options
context:
space:
mode:
Diffstat (limited to 'irc/tokens.go')
-rw-r--r--irc/tokens.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/irc/tokens.go b/irc/tokens.go
index 179454c..ac5456a 100644
--- a/irc/tokens.go
+++ b/irc/tokens.go
@@ -311,6 +311,14 @@ func (msg *Message) Time() (t time.Time, ok bool) {
return
}
+func (msg *Message) TimeOrNow() time.Time {
+ t, ok := msg.Time()
+ if ok {
+ return t
+ }
+ return time.Now()
+}
+
func FullMask(s string) (nick, user, host string) {
if s == "" {
return