You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 10, 2020. It is now read-only.
Is your feature request related to a problem? Please describe.
The profile command uses RFC3339Nano to parse the date, while discord uses the ISO 8601 date format, which is similar but less restrictive.
This causes the parse to sometimes fail.
Describe the solution you'd like
Changing the time.RFC3339Nano to "2006-01-02T15:04:05-0700" should solve the problem (go has no inbuilt format for ISO 8601)
The text was updated successfully, but these errors were encountered:
Turns out this wasn't due to the parsing (though I did change to the built-in discordgo parsing. Using the string described in this issue (and the stackoverflow comment) actually fails to parse out joinedAt dates in my testing. I'm thinking this was a different issue that manifested itself via the profile command but I added some more logging to test that out.
Turns out this was due to a user changing their nickname? Accurate repro steps are:
.moe profile -> works file
Change your nickname
.moe profile -> unknown start date
The server returns a blank string for the timestamp moebot | 2018/08/24 04:28:03 Problem converting server join date to time. User ID {XXXX}, Joined at time: {} error: parsing time "" as "2006-01-02T15:04:05Z07:00": cannot parse "" as "2006"
After more investigation, this turned out to be a discordgo bug due to undocumented discord behavior... bwmarrin/discordgo#533 so we'll be switching to the develop branch since it's much more up to date
Is your feature request related to a problem? Please describe.
The profile command uses RFC3339Nano to parse the date, while discord uses the ISO 8601 date format, which is similar but less restrictive.
This causes the parse to sometimes fail.
Describe the solution you'd like
Changing the
time.RFC3339Nano
to"2006-01-02T15:04:05-0700"
should solve the problem (go has no inbuilt format for ISO 8601)The text was updated successfully, but these errors were encountered: