BoxKite.Twitter.DirectMessageExtensions.GetDirectMessages C# (CSharp) 메소드

GetDirectMessages() 공개 정적인 메소드

Returns the most recent direct messages sent to the authenticating user.
ref: https://dev.twitter.com/docs/api/1.1/get/direct_messages
public static GetDirectMessages ( this session, long sinceId, long maxId, int count = 20 ) : Task>
session this
sinceId long Returns results with an ID greater than (that is, more recent than) the specified ID
maxId long Returns results with an ID less than (that is, older than) or equal to the specified ID
count int Specifies the number of direct messages to try and retrieve, up to a maximum of 200
리턴 Task>
        public async static Task<TwitterResponseCollection<DirectMessage>> GetDirectMessages(this IUserSession session, long sinceId = 0, long maxId = 0, int count = 20)
        {
            var parameters = new TwitterParametersCollection();
            parameters.Create(include_entities: true, count: count, since_id: sinceId,
                max_id: maxId,full_text: true);
                
            return await session.GetAsync(TwitterApi.Resolve("/1.1/direct_messages.json"), parameters)
                          .ContinueWith(c => c.MapToMany<DirectMessage>());
        }