Yortw / tweetmoasharp

TweetSharp is a fast, clean wrapper around the Twitter API.
Other
72 stars 22 forks source link

ListDirectMessageOptions.Cursor is the wrong data type #74

Closed acohenX1 closed 5 years ago

acohenX1 commented 5 years ago

ListDirectMessageOptions.Cursor is a long? however the data I get back for TwitterDirectMessageListResult.NextCursor is a string like MTA1NDUzNzI1MDc3ODcwMTgyOQ.

Yortw commented 5 years ago

Sigh. It seems the new API is inconsistent with the old API, and I had assumed the same type used for other twitter cursors would work.

Not sure what to do about this. Either need to convert the existing type to use strings, which is a breaking change and may or may not be cool going forward, or invent a new type that is used only by the direct message API. Either way I'm not sure when I'll get to this sorry.

acohenX1 commented 5 years ago

For what it's worth, modifying src/TweetSharp/_TwitterService.5.DirectMessages.json did the trick in my fork (I'm not able to test all configs, however, just using .NET 4.5):

//GET direct_messages/events/list (get set of dms)
TwitterDirectMessageListResult, "direct_messages/events/list", ListDirectMessages, long? count, string cursor
Yortw commented 5 years ago

Hi, sorry it's taken so long, am looking at fixing this now.

It seems I already got the correct data type for the cursor on TwitterDirectMessageListResult which I had assumed needed to be changed, so it should only be the method you've indicated that needs updating. Unfortunately still a breaking changes to the interface, so will need a major version bump...

Yortw commented 5 years ago

Should be fixed in version 6, just published to Nuget now.