diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a2bf7fda0..b5c6c21b9 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,7 @@ ==== Unreleased * FIX: Cookie使用時に「Listの発言取得に公式RTを含める」の設定が適用されない不具合を修正 + * FIX: Twitterアカウントでの画像を添付したツイートの投稿がエラーになる不具合を修正 ==== Ver 3.15.0(2024/06/14) * NEW: Misskeyでのノート投稿時のファイル添付に対応しました diff --git a/OpenTween/Api/GraphQL/CreateTweetRequest.cs b/OpenTween/Api/GraphQL/CreateTweetRequest.cs index b268cb83a..d91da2527 100644 --- a/OpenTween/Api/GraphQL/CreateTweetRequest.cs +++ b/OpenTween/Api/GraphQL/CreateTweetRequest.cs @@ -30,6 +30,7 @@ using OpenTween.Api.DataModel; using OpenTween.Connection; using OpenTween.Models; +using OpenTween.SocialProtocol.Twitter; namespace OpenTween.Api.GraphQL { @@ -43,7 +44,7 @@ public class CreateTweetRequest public TwitterUserId[] ExcludeReplyUserIds { get; set; } = Array.Empty(); - public string[] MediaIds { get; set; } = Array.Empty(); + public TwitterMediaId[] MediaIds { get; set; } = Array.Empty(); public string? AttachmentUrl { get; set; } @@ -112,7 +113,7 @@ public string CreateRequestBody() ? new( MediaEntities: this.MediaIds .Select(x => new VariableMediaEntity( - MediaId: x, + MediaId: x.Id, TaggedUsers: Array.Empty() )) .ToArray(), diff --git a/OpenTween/Twitter.cs b/OpenTween/Twitter.cs index b014d068b..0d1458bb2 100644 --- a/OpenTween/Twitter.cs +++ b/OpenTween/Twitter.cs @@ -228,7 +228,7 @@ await this.SendDirectMessage(param.Text, mediaId) TweetText = param.Text, InReplyToTweetId = param.InReplyTo?.StatusId.ToTwitterStatusId(), ExcludeReplyUserIds = param.ExcludeReplyUserIds.OfType().ToArray(), - MediaIds = param.MediaIds.Select(x => x.ToString()).ToArray(), + MediaIds = param.MediaIds.ToArray(), AttachmentUrl = param.AttachmentUrl, };