Table of Contents

Class User

Namespace
Twikit
Assembly
Twikit.dll

ユーザー。

public class User : IEquatable<User>
Inheritance
User
Implements
Inherited Members

Remarks

どのフィールドが埋まるかは、そのユーザーがどこから来たかで変わります。X はプロフィールと タイムラインを別のドキュメントから返すためです。

GetUserByScreenNameAsync(string) と GetUserByIdAsync(string) は X の legacy ブロックにしか無い 9 項目(ListedCount、FastFollowersCount、 NormalFollowersCount、DefaultProfile、DefaultProfileImage、 HasCustomTimelines、WantRetweets、IsTranslator、 WithheldInCountries)を含めてすべて埋めます。

ツイート・タイムライン・検索経由のユーザーは legacy を捨てて型付きオブジェクトに 移行したドキュメントから来るため、その 9 項目は既定値(0、false、空リスト)のままで、 既定値は計測値ではありません。そのドキュメントだけが ParodyCommentaryFanLabel を運ぶので、直接のプロフィール取得ではラベルは得られません。

Constructors

User(Client, JsonObject)

public User(Client client, JsonObject data)

Parameters

client Client
data JsonObject

Properties

AutomatedBy

この bot を運用しているアカウントのスクリーンネーム(X が明示する場合)。

public string? AutomatedBy { get; }

Property Value

string

AutomatedLabel

プロフィールに表示される affiliate ラベル。bot なら 'Automated'、無ければ null。

public string? AutomatedLabel { get; }

Property Value

string

BlockedBy

このユーザーがログイン中のアカウントをブロックしているか。

public bool BlockedBy { get; }

Property Value

bool

Blocking

ログイン中のアカウントがこのユーザーをブロックしているか。

public bool Blocking { get; }

Property Value

bool

CanDm

DM を受け取れるか。

public bool CanDm { get; }

Property Value

bool

CanMediaTag

メディアにタグ付けできるか。

public bool CanMediaTag { get; }

Property Value

bool

CreatedAt

アカウント作成日時(X の表記)。

public string CreatedAt { get; }

Property Value

string

CreatedAtDatetime

CreatedAt を DateTimeOffset にしたもの。

public DateTimeOffset CreatedAtDatetime { get; }

Property Value

DateTimeOffset

Data

X から受け取った生の JSON。

public JsonObject Data { get; }

Property Value

JsonObject

DefaultProfile

既定のプロフィールか。

public bool DefaultProfile { get; }

Property Value

bool

DefaultProfileImage

既定のプロフィール画像か。

public bool DefaultProfileImage { get; }

Property Value

bool

Description

自己紹介。

public string Description { get; }

Property Value

string

DescriptionUrls

自己紹介に含まれる URL。

public List<UrlEntity> DescriptionUrls { get; }

Property Value

List<UrlEntity>

FastFollowersCount

public int FastFollowersCount { get; }

Property Value

int

FavouritesCount

いいねの数。

public int FavouritesCount { get; }

Property Value

int

FollowedBy

このユーザーがログイン中のアカウントをフォローしているか。

public bool FollowedBy { get; }

Property Value

bool

FollowersCount

フォロワー数。

public int FollowersCount { get; }

Property Value

int

Following

ログイン中のアカウントがこのユーザーをフォローしているか。

public bool Following { get; }

Property Value

bool

FollowingCount

フォロー数。

public int FollowingCount { get; }

Property Value

int

HasCustomTimelines

カスタムタイムラインを持つか。

public bool HasCustomTimelines { get; }

Property Value

bool

Id

ユーザーの一意な ID。

public string Id { get; }

Property Value

string

IsAutomated

X が自動化アカウントとして表示しているか。

public bool IsAutomated { get; }

Property Value

bool

IsBlueVerified

青いチェックマークで認証済みか。

public bool IsBlueVerified { get; }

Property Value

bool

IsTranslator

翻訳者か。

public bool IsTranslator { get; }

Property Value

bool

ListedCount

リストに追加されている数。

public int ListedCount { get; }

Property Value

int

LiveFollowing

public bool LiveFollowing { get; }

Property Value

bool

Location

場所。

public string Location { get; }

Property Value

string

MediaCount

メディアの数。

public int MediaCount { get; }

Property Value

int

Muting

ログイン中のアカウントがこのユーザーをミュートしているか。

public bool Muting { get; }

Property Value

bool

Name

表示名。

public string Name { get; }

Property Value

string

NormalFollowersCount

public int NormalFollowersCount { get; }

Property Value

int

NotificationsEnabled

ログイン中のアカウントがこのユーザーの通知をオンにしているか。

public bool NotificationsEnabled { get; }

Property Value

bool

ParodyCommentaryFanLabel

X が自己申告を求めるアカウントの 'Parody'、'Commentary'、'Fan'。それ以外は null。

public string? ParodyCommentaryFanLabel { get; }

Property Value

string

PinnedTweetIds

固定ツイートの ID。

public List<string> PinnedTweetIds { get; }

Property Value

List<string>

PossiblySensitive

センシティブな内容を含む可能性があるか。

public bool PossiblySensitive { get; }

Property Value

bool

ProfileBannerUrl

プロフィールのバナー画像の URL。

public string? ProfileBannerUrl { get; }

Property Value

string

ProfileImageUrl

プロフィール画像の URL(HTTPS)。

public string ProfileImageUrl { get; }

Property Value

string

ProfileInterstitialType

プロフィールの警告表示の種類。

public string ProfileInterstitialType { get; }

Property Value

string

Protected

鍵アカウントか。

public bool Protected { get; }

Property Value

bool

ScreenName

スクリーンネーム(@ 無し)。

public string ScreenName { get; }

Property Value

string

StatusesCount

ツイート数。

public int StatusesCount { get; }

Property Value

int

TranslatorType

翻訳者の種類。

public string TranslatorType { get; }

Property Value

string

Url

ユーザーの URL。

public string? Url { get; }

Property Value

string

Urls

プロフィールに設定された URL。

public List<UrlEntity> Urls { get; }

Property Value

List<UrlEntity>

Verified

旧来の認証バッジを持つか。

public bool Verified { get; }

Property Value

bool

VerifiedType

組織アカウントなら 'Business' または 'Government'、それ以外は null。組織は Verified が false で、表示されるバッジはこのフィールドと IsBlueVerified に由来します。

public string? VerifiedType { get; }

Property Value

string

WantRetweets

リツイートを希望しているか。

public bool WantRetweets { get; }

Property Value

bool

WithheldInCountries

内容が非表示になっている国。

public List<string> WithheldInCountries { get; }

Property Value

List<string>

Methods

BlockAsync()

ブロックします。

public Task<User> BlockAsync()

Returns

Task<User>

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Equals(User?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(User? other)

Parameters

other User

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

FollowAsync()

フォローします。

public Task<User> FollowAsync()

Returns

Task<User>

GetDmHistoryAsync(string?)

このユーザーとの DM 履歴を取得します。

public Task<Result<Message>> GetDmHistoryAsync(string? maxId = null)

Parameters

maxId string

Returns

Task<Result<Message>>

GetFollowersAsync(int)

フォロワーを取得します。

public Task<Result<User>> GetFollowersAsync(int count = 20)

Parameters

count int

Returns

Task<Result<User>>

GetFollowersYouKnowAsync(int)

知り合いかもしれないフォロワーを取得します。

public Task<Result<User>> GetFollowersYouKnowAsync(int count = 20)

Parameters

count int

Returns

Task<Result<User>>

GetFollowingAsync(int)

フォロー中のユーザーを取得します。

public Task<Result<User>> GetFollowingAsync(int count = 20)

Parameters

count int

Returns

Task<Result<User>>

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetHighlightsTweetsAsync(int, string?)

ハイライトされたツイートを取得します。

public Task<Result<Tweet>> GetHighlightsTweetsAsync(int count = 20, string? cursor = null)

Parameters

count int
cursor string

Returns

Task<Result<Tweet>>

GetLatestFollowersAsync(int, string?)

最新のフォロワーを取得します(最大 200 件)。

public Task<Result<User>> GetLatestFollowersAsync(int count = 200, string? cursor = null)

Parameters

count int
cursor string

Returns

Task<Result<User>>

GetLatestFriendsAsync(int, string?)

最新のフォロー中ユーザーを取得します(最大 200 件)。

public Task<Result<User>> GetLatestFriendsAsync(int count = 200, string? cursor = null)

Parameters

count int
cursor string

Returns

Task<Result<User>>

GetSubscriptionsAsync(int)

サブスクライブしているユーザーを取得します。

public Task<Result<User>> GetSubscriptionsAsync(int count = 20)

Parameters

count int

Returns

Task<Result<User>>

GetTweetsAsync(string, int)

ユーザーのツイートを取得します。

public Task<Result<Tweet>> GetTweetsAsync(string tweetType, int count = 40)

Parameters

tweetType string

'Tweets'、'Replies'、'Media'、'Likes' のいずれか。

count int

取得する件数。

Returns

Task<Result<Tweet>>

GetVerifiedFollowersAsync(int)

認証済みのフォロワーを取得します。

public Task<Result<User>> GetVerifiedFollowersAsync(int count = 20)

Parameters

count int

Returns

Task<Result<User>>

MuteAsync()

ミュートします。

public Task<User> MuteAsync()

Returns

Task<User>

SendDmAsync(string, string?, string?)

このユーザーに DM を送ります。

public Task<Message> SendDmAsync(string text, string? mediaId = null, string? replyTo = null)

Parameters

text string

本文。

mediaId string

添付するメディア ID(UploadMediaAsync(string, bool, double?, string?, string?, bool) で取得)。

replyTo string

返信先のメッセージ ID。

Returns

Task<Message>

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

UnblockAsync()

ブロックを解除します。

public Task<User> UnblockAsync()

Returns

Task<User>

UnfollowAsync()

フォローを解除します。

public Task<User> UnfollowAsync()

Returns

Task<User>

UnmuteAsync()

ミュートを解除します。

public Task<User> UnmuteAsync()

Returns

Task<User>

UpdateAsync()

最新の情報で更新します。

public Task UpdateAsync()

Returns

Task