Skip to content
This repository has been archived by the owner on Oct 10, 2020. It is now read-only.

Profile command sometimes returns an unknown join date #61

Closed
Shadran opened this issue Aug 19, 2018 · 5 comments
Closed

Profile command sometimes returns an unknown join date #61

Shadran opened this issue Aug 19, 2018 · 5 comments
Assignees

Comments

@Shadran
Copy link
Collaborator

Shadran commented Aug 19, 2018

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)

@camd67
Copy link
Owner

camd67 commented Aug 19, 2018

Interestingly, discordgo's timestamp parse uses non-nano RFC3339 to parse. I agree on using the custom string to parse it out though.

@camd67 camd67 self-assigned this Aug 20, 2018
@camd67
Copy link
Owner

camd67 commented Aug 21, 2018

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.

@camd67 camd67 closed this as completed in bf2df3d Aug 21, 2018
@camd67 camd67 reopened this Aug 23, 2018
@camd67
Copy link
Owner

camd67 commented Aug 23, 2018

Reopening due to more Unknown failures in production. Checking into logs to figure out what the timestamps are and why this is happening

@camd67
Copy link
Owner

camd67 commented Aug 24, 2018

Turns out this was due to a user changing their nickname? Accurate repro steps are:

  1. .moe profile -> works file
  2. Change your nickname
  3. .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"

@camd67
Copy link
Owner

camd67 commented Aug 24, 2018

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

@camd67 camd67 closed this as completed Aug 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants