Closed RussellChamp closed 5 years ago
So there are several options for this, we could have a formatted string, a datetime.datetime
object, or just a unix timestamp. Any preferences?
a datetime
object sounds more Pythonic and would be better to manage any kinds of services, no matter what they output. To convert to a single formatted string you would probably need to use a datetime
to parse it at some point so that would be simpler
I would honestly prefer a unix timestamp (similar to what we see in chat logs) as that's what I use persisting certain things in my own bot logs. I also prefer to use inflect
to parse and display the time so I would have to parse it back into a timestamp if I wasn't provided one.
Would there be any reason to not provide both datetime
and timestamp
?
There wouldn't be any technical limitation to that, no. These are just additional attributes in the object.
Going to go with datetime.now(timezone.utc)
for the msg.datetime
and a float of the unix timestamp for msg.timestamp
. That work?
Add
timestamp
to the Message object that gets passed to plugin handlers and listeners