BoxKite.Twitter.TweetExtensions.ReplyToTweetWithImage C# (CSharp) Метод

ReplyToTweetWithImage() публичный статический Метод

Sends a Tweet in reply to another tweet
ref: https://dev.twitter.com/docs/api/1.1/post/statuses/update_with_media
public static ReplyToTweetWithImage ( this session, Tweet tweet, string text, string fileName, byte imageData, double latitude = 0.0, double longitude = 0.0, string placeId = "" ) : Task
session this
tweet BoxKite.Twitter.Models.Tweet Text to send
text string Text of tweet to send
fileName string Name of the file, including extension
imageData byte the image data as a byte array
latitude double Latitude
longitude double Longitude
placeId string A place in the world identified by a Twitter place ID. Place IDs can be retrieved from geo/reverse_geocode.
Результат Task
        public async static Task<Tweet> ReplyToTweetWithImage(this IUserSession session, Tweet tweet, string text, string fileName, byte[] imageData, double latitude = 0.0, double longitude = 0.0, string placeId = "")
        {
            var parameters = new TwitterParametersCollection
                             {
                                 {"status", text},
                                 {"in_reply_to_status_id", tweet.Id.ToString()}
                             };

            parameters.Create(place_id: placeId);
            
            if (Math.Abs(latitude) > 0.0 && Math.Abs(longitude) > 0.0)
            {
                parameters.Add("lat", latitude.ToString());
                parameters.Add("long", longitude.ToString());
            }

            return await session.PostFileAsync(TwitterApi.Upload("/1.1/statuses/update_with_media.json"), parameters, fileName, "media[]", imageData)
                          .ContinueWith(c => c.MapToSingle<Tweet>());
        }

Same methods

TweetExtensions::ReplyToTweetWithImage ( this session, Tweet tweet, string text, string fileName, Stream imageDataStream, double latitude = 0.0, double longitude = 0.0, string placeId = "" ) : Task