Before I lose what little hair I have left trying to work up a plugin I figured I should ask.
Iāve tried the obvious, User, but last_seen_at is undefined.
Iāve tried combinations of hyphens, underscores, camelCase, etc. etc. with no joy.
Iāve used getOwnPropertyNames to try and drill down into various objects in hopes of finding it elsewhere.
Iāve looked at the dev console in places Iāve never looked before.
tl,dr Iāve tried a lot
Iām sure I must have danced close to the correct syntax, and I know the information has to be available somewhere, somehow, but my āeducated guessesā have so far failed me.
AFAIK the property is neither āprivateā nor āuntrustedā so I hope it can be gotten.
That seems to be equivalent to Discourse.User.current()
i.e. the same set of properties, and again last_seen_at is undefined.
My guess is because itās a datetime data type.
Or maybe it just isnāt able to be called by a plugin in the simple ways Iāve been trying to get the value.
[quote=āMittineague, post:3, topic:30788ā]
My guess is because itās a datetime data type. Or maybe it just isnāt able to be called by a plugin in the simple ways Iāve been trying to get the value.
[/quote]Nope, itās just not included in the basic data included in there. Discourse.User.current().findDetails().then(function(u) { console.log(u.last_seen_at); }); is what you want.