Skip to content

Commit

Permalink
画像投稿時にTwitterMediaIdからstringへの変換が正しく行えてない不具合を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
upsilon committed Jun 14, 2024
1 parent b9987b8 commit fa09cd6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

==== Unreleased
* FIX: Cookie使用時に「Listの発言取得に公式RTを含める」の設定が適用されない不具合を修正
* FIX: Twitterアカウントでの画像を添付したツイートの投稿がエラーになる不具合を修正

==== Ver 3.15.0(2024/06/14)
* NEW: Misskeyでのノート投稿時のファイル添付に対応しました
Expand Down
5 changes: 3 additions & 2 deletions OpenTween/Api/GraphQL/CreateTweetRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
using OpenTween.Api.DataModel;
using OpenTween.Connection;
using OpenTween.Models;
using OpenTween.SocialProtocol.Twitter;

namespace OpenTween.Api.GraphQL
{
Expand All @@ -43,7 +44,7 @@ public class CreateTweetRequest

public TwitterUserId[] ExcludeReplyUserIds { get; set; } = Array.Empty<TwitterUserId>();

public string[] MediaIds { get; set; } = Array.Empty<string>();
public TwitterMediaId[] MediaIds { get; set; } = Array.Empty<TwitterMediaId>();

public string? AttachmentUrl { get; set; }

Expand Down Expand Up @@ -112,7 +113,7 @@ public string CreateRequestBody()
? new(
MediaEntities: this.MediaIds
.Select(x => new VariableMediaEntity(
MediaId: x,
MediaId: x.Id,
TaggedUsers: Array.Empty<string>()
))
.ToArray(),
Expand Down
2 changes: 1 addition & 1 deletion OpenTween/Twitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ await this.SendDirectMessage(param.Text, mediaId)
TweetText = param.Text,
InReplyToTweetId = param.InReplyTo?.StatusId.ToTwitterStatusId(),
ExcludeReplyUserIds = param.ExcludeReplyUserIds.OfType<TwitterUserId>().ToArray(),
MediaIds = param.MediaIds.Select(x => x.ToString()).ToArray(),
MediaIds = param.MediaIds.ToArray(),
AttachmentUrl = param.AttachmentUrl,
};

Expand Down

0 comments on commit fa09cd6

Please sign in to comment.