Class Tweet
- Namespace
- Twikit
- Assembly
- Twikit.dll
ツイート。
public class Tweet : IEquatable<Tweet>
- Inheritance
-
Tweet
- Implements
- Inherited Members
Constructors
Tweet(Client, JsonObject, User?)
public Tweet(Client client, JsonObject data, User? user = null)
Parameters
clientClientdataJsonObjectuserUser
Properties
Article
添付された長文記事(Article)。無ければ null。 記事を持つツイートの Text には t.co のリンクしか無いため、タイトルと導入文はここから読みます。 X は本文を送ってこないので、得られるのはタイトル・プレビュー・カバー画像だけです。
public Article? Article { get; }
Property Value
BookmarkCount
ブックマークの数。
public int BookmarkCount { get; }
Property Value
Bookmarked
ブックマーク済みか。
public bool Bookmarked { get; }
Property Value
Community
コミュニティタイムラインから取得した場合の所属コミュニティ。
public Community? Community { get; set; }
Property Value
CommunityNote
コミュニティノートの要約(無ければ null)。
public BirdwatchNote? CommunityNote { get; }
Property Value
ConversationIds
このツイートが含まれていた会話モジュール内の全ツイート ID(X がまとめたもの)。 会話モジュール経由でなければ null。
public List<string>? ConversationIds { get; set; }
Property Value
CreatedAt
作成日時(X の表記)。
public string? CreatedAt { get; }
Property Value
CreatedAtDatetime
CreatedAt を DateTimeOffset にしたもの。
public DateTimeOffset CreatedAtDatetime { get; }
Property Value
Data
X から受け取った生の JSON(tweet result)。
public JsonObject Data { get; }
Property Value
EditTweetIds
編集履歴のツイート ID。
public List<string> EditTweetIds { get; }
Property Value
EditableUntilMsecs
編集可能な期限(ミリ秒)。
public long? EditableUntilMsecs { get; }
Property Value
- long?
EditsRemaining
残りの編集回数。
public int? EditsRemaining { get; }
Property Value
- int?
FavoriteCount
いいねの数。
public int FavoriteCount { get; }
Property Value
Favorited
いいね済みか。
public bool Favorited { get; }
Property Value
FullText
全文。長文ツイートは note_tweet から、リツイートは元ツイートの本文を返します
(リツイート自身の本文は 140 文字で切り詰められているため)。RT @user: ... 形式が欲しければ Text。
public string FullText { get; }
Property Value
HasCard
カードを持つか。
public bool HasCard { get; }
Property Value
HasCommunityNotes
コミュニティノートが付いているか。
public bool HasCommunityNotes { get; }
Property Value
Hashtags
本文に含まれるハッシュタグ。
public List<string> Hashtags { get; }
Property Value
Highlighted
投稿者のプロフィールの「ハイライト」タブに入っているか(Premium 機能)。 X はタイムラインやツイート取得にこのフラグを含めないため、GetUserHighlightsTweetsAsync(string, int, string?) で取得した ツイートか、IsHighlightedAsync()・HighlightAsync()・UnhighlightAsync() を呼んだあと以外は null です(「不明」であり「いいえ」ではありません)。
public bool? Highlighted { get; }
Property Value
- bool?
Id
ツイートの一意な ID。
public string Id { get; }
Property Value
InReplyTo
返信先のツイート ID。
public string? InReplyTo { get; }
Property Value
IsEditEligible
編集可能か。
public bool IsEditEligible { get; }
Property Value
IsQuoteStatus
引用ツイートか。
public bool IsQuoteStatus { get; }
Property Value
IsTranslatable
翻訳可能か。
public bool IsTranslatable { get; }
Property Value
Lang
言語。
public string? Lang { get; }
Property Value
Legacy
legacy ブロック。
public JsonObject Legacy { get; }
Property Value
Media
添付メディア(Photo、Video、AnimatedGif)。
public List<Media> Media { get; }
Property Value
Place
関連付けられた場所(無ければ null)。
public Place? Place { get; }
Property Value
Poll
投票(無ければ null)。
public Poll? Poll { get; }
Property Value
PossiblySensitive
センシティブな内容を含む可能性があるか。
public bool PossiblySensitive { get; }
Property Value
PossiblySensitiveEditable
public bool PossiblySensitiveEditable { get; }
Property Value
Quote
引用元のツイート。
public Tweet? Quote { get; }
Property Value
QuoteCount
引用された数。
public int QuoteCount { get; }
Property Value
QuotedStatusId
引用元ツイートの ID(引用ツイートの場合)。
public string? QuotedStatusId { get; }
Property Value
RelatedTweets
関連ツイート。
public List<Tweet>? RelatedTweets { get; set; }
Property Value
Replies
ツイートへの返信。
public Result<Tweet>? Replies { get; set; }
Property Value
ReplyCount
返信の数。
public int ReplyCount { get; }
Property Value
ReplyTo
このツイートが返信している先のツイート(会話の上流)。
public List<Tweet>? ReplyTo { get; set; }
Property Value
RetweetCount
リツイートの数。
public int RetweetCount { get; }
Property Value
RetweetedTweet
リツイート元のツイート。
public Tweet? RetweetedTweet { get; }
Property Value
Source
投稿元クライアントを表す生のアンカー(例: <a href="...">Twitter for iPhone</a>)。
public string? Source { get; }
Property Value
SourceName
Source から取り出したクライアント名。
public string? SourceName { get; }
Property Value
SourceUrl
Source から取り出したクライアントの URL。
public string? SourceUrl { get; }
Property Value
Text
本文。リツイートの場合は RT @user: ... の形式(140 文字で切り詰められる)。
public string Text { get; }
Property Value
Thread
投稿者自身によるスレッド(古い順、このツイート自身を含む)。
public List<Tweet>? Thread { get; set; }
Property Value
ThumbnailTitle
カードに表示される Web ページのタイトル。
public string? ThumbnailTitle { get; }
Property Value
ThumbnailUrl
カードに表示される画像の URL。
public string? ThumbnailUrl { get; }
Property Value
Url
x.com 上の正規 URL。
public string Url { get; }
Property Value
Urls
本文に含まれる URL(常にリスト)。
public List<UrlEntity> Urls { get; }
Property Value
User
ツイートの投稿者。
public User? User { get; set; }
Property Value
ViewCount
表示回数。無ければ null。
public long? ViewCount { get; }
Property Value
- long?
Remarks
X が数値を送るかどうかは呼び出し方ではなくツイート側の性質です。 ViewCountState が 'EnabledWithCount' なら数値があり、'Enabled' なら X が伏せています。
ViewCountState
表示回数の状態。
public string? ViewCountState { get; }
Property Value
Methods
BookmarkAsync()
ブックマークに追加します。
public Task<HttpResponseMessage> BookmarkAsync()
Returns
DeleteAsync()
ツイートを削除します。
public Task<HttpResponseMessage> DeleteAsync()
Returns
DeleteBookmarkAsync()
ブックマークから削除します。
public Task<HttpResponseMessage> DeleteBookmarkAsync()
Returns
DeleteRetweetAsync()
リツイートを取り消します。
public Task<HttpResponseMessage> DeleteRetweetAsync()
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
Equals(Tweet?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Tweet? other)
Parameters
otherTweetAn object to compare with this object.
Returns
FavoriteAsync()
いいねします。
public Task<HttpResponseMessage> FavoriteAsync()
Returns
FromData(Client, JsonNode?)
タイムラインのエントリなどから Tweet を作ります(Python 版の tweet_from_data)。
墓石(削除済み)や投稿者情報の無いエントリは null。
public static Tweet? FromData(Client client, JsonNode? data)
Parameters
Returns
GetCommunityNotesAsync()
この投稿に提案されたコミュニティノートをすべて取得します。
public Task<List<CommunityNote>> GetCommunityNotesAsync()
Returns
- See Also
GetFavoritersAsync(int, string?)
いいねしたユーザーを取得します。
public Task<Result<User>> GetFavoritersAsync(int count = 40, string? cursor = null)
Parameters
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
GetRetweetersAsync(int, string?)
リツイートしたユーザーを取得します。
public Task<Result<User>> GetRetweetersAsync(int count = 40, string? cursor = null)
Parameters
Returns
GetSimilarTweetsAsync()
類似ツイートを取得します(Premium のみ)。
public Task<List<Tweet>> GetSimilarTweetsAsync()
Returns
HighlightAsync()
プロフィールの「ハイライト」タブに追加します(Premium のみ)。成功すると Highlighted も true になります。
public Task<HttpResponseMessage> HighlightAsync()
Returns
IsHighlightedAsync()
X に問い合わせてハイライト済みかを返し、結果を Highlighted に保存します。
public Task<bool> IsHighlightedAsync()
Returns
PinAsync()
自分のプロフィールにピン留めします。
public Task<HttpResponseMessage> PinAsync()
Returns
- See Also
ReplyAsync(string, IList<string>?, string?, string?, string?, bool, bool, JsonArray?, string?)
このツイートに返信します。
public Task<Tweet> ReplyAsync(string text = "", IList<string>? mediaIds = null, string? conversationControl = null, string? attachmentUrl = null, string? communityId = null, bool shareWithFollowers = false, bool isNoteTweet = false, JsonArray? richtextOptions = null, string? editTweetId = null)
Parameters
textstring返信の本文。
mediaIdsIList<string>添付するメディア ID の一覧。
conversationControlstring返信できる相手('followers'、'verified'、'mentioned')。
attachmentUrlstring引用するツイートの URL。
communityIdstring投稿先コミュニティの ID。
shareWithFollowersboolコミュニティ投稿をフォロワーにも共有するか。
isNoteTweetbool280 文字を超える長文ツイートにするか(Premium)。
richtextOptionsJsonArray装飾オプション(Premium)。
editTweetIdstring編集するツイートの ID(Premium)。
Returns
RetweetAsync()
リツイートします。
public Task<HttpResponseMessage> RetweetAsync()
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
TranslateAsync(string?)
Grok でこのツイートを翻訳します。
public Task<TweetTranslation> TranslateAsync(string? dstLang = null)
Parameters
dstLangstring翻訳先の言語コード。省略時はクライアントの言語。
Returns
- See Also
UnfavoriteAsync()
いいねを解除します。
public Task<HttpResponseMessage> UnfavoriteAsync()
Returns
UnhighlightAsync()
プロフィールの「ハイライト」タブから外します。成功すると Highlighted も false になります。
public Task<HttpResponseMessage> UnhighlightAsync()
Returns
UnpinAsync()
自分のプロフィールのピン留めを外します。
public Task<HttpResponseMessage> UnpinAsync()
Returns
- See Also
UpdateAsync()
最新の情報で更新します。
public Task UpdateAsync()