get-got / discord-downloader-go

A Discord bot program to download and otherwise handle files sent in Discord channels with extensive configuration. Can be used as a genuine Discord Bot or user account / self-bot
MIT License
277 stars 31 forks source link

"Failed to convert timestamp to discord snowflake..." message. #118

Closed kauffy closed 7 months ago

kauffy commented 10 months ago

Not sure if this is of interest, or not, but upon starting, I get a few of these messages:

Failed to convert timestamp to discord snowflake... Format: '2023-10-31', Timestamp: '2006-01-02' - Error: parsing time "2006-01-02" as "2023-10-31": cannot parse "-01-02" as "3"

The filenameDateFormat was left as the default: "filenameDateFormat": "2006-01-02_15-04-05"

and I assume the other date it's mashing it with is: "autoHistorySince": "2023-10-31"

ajgrasmeijer commented 9 months ago

The function discordTimestampToSnowflake in discord.go have the variables swapped around.

The fix would be to swap around the function parameters, so that it says: func discordTimestampToSnowflake(timestamp string, format string) string {

My git knowledge is basically nil, so I hope @get-got reads this. :-)

Edit: It does fix a couple, but breaks some other. This is NOT really the fix...

get-got commented 9 months ago

@ajgrasmeijer If you meant this section, you were totally right, I had these mistakenly reversed at this location in history.go:

image

Changing the parameter order of the actual function isn't the fix since that would break a lot of other things. I need to undo some recent broken thread fix attempts but once I do, I'll send this in the support discord server to see if anyone can help test the date ranges.

Thank you for noticing that! While changing the actual function isn't the fix, this made me check all of the occurrences and notice I had stupidly swapped these at some point.