New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
json: cannot unmarshal string into Go value of type int64 #92
Comments
@andrewarrow I was seeing a similar error with one of our slack servers. I found the bit it was unable to unmarshal. Looking at the call to our slack server The json output for the this is datatype string and NOT int64. I have also noticed with another one of our slack servers, where we do not have this problem, that it does not return "Attachments". I can see now this is being discussed in issue #90 |
@kodieGlosser i'm not seeing this error any more, but I think I muted the group in question causing my problem. In my project I cache each room to disk, so running |
Seems like I'm hitting this as well, works fine for some messages but not all. Changing the type to string worked for my scripts |
I'm having this problem as well. It was indeed introduced in https://github.com/nlopes/slack/pull/81 and the Slack API specifies TS as an Integer, however the json presents the value as a String. I've created a fix for this issue in https://github.com/nlopes/slack/pull/96 |
I have the same issue as well, just for some of messages, not for all of them. |
#96 is not a fix for it. |
u don't want string you want |
then int64(ts) to go from 1473362325.000027, to 1473362325 |
IIRC Slack's docs say it's a string and should not be stored as a float. I can't find the link at the moment. The timestamp is also a message ID and a change in precision would render it incorrect. This is why they send it as a string. |
alright let's store it as a string but have two functions to get either part of the number. The string before the dot and the string after. And then might as well have two more functions for getting both those fields as ints or as parsed Time thingys not really objects cuz golang doesn't have objects. |
Ah, I didn't know that the |
Slack discussion about |
Hey, i'm also having this problem. Tried a8ceb9d (latest commit at the time) which seems to address these issue but i'm also getting this error
|
Hi everyone, Unfortunately, Slack still can send a number instead of a string in the |
I'm having same problem. (getting How is use Type http://stackoverflow.com/questions/24480835/go-decoding-json-int-into-string |
@saxsir yep, looks like |
@saxsir his solution fixes it for me too |
plz close this issue, thx. |
more info coming soon, but get that after calling
GetGroupHistory
for 1 specific group and then looping thru:The text was updated successfully, but these errors were encountered: