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
clientClientdataJsonObject
Properties
AutomatedBy
この bot を運用しているアカウントのスクリーンネーム(X が明示する場合)。
public string? AutomatedBy { get; }
Property Value
AutomatedLabel
プロフィールに表示される affiliate ラベル。bot なら 'Automated'、無ければ null。
public string? AutomatedLabel { get; }
Property Value
BlockedBy
このユーザーがログイン中のアカウントをブロックしているか。
public bool BlockedBy { get; }
Property Value
Blocking
ログイン中のアカウントがこのユーザーをブロックしているか。
public bool Blocking { get; }
Property Value
CanDm
DM を受け取れるか。
public bool CanDm { get; }
Property Value
CanMediaTag
メディアにタグ付けできるか。
public bool CanMediaTag { get; }
Property Value
CreatedAt
アカウント作成日時(X の表記)。
public string CreatedAt { get; }
Property Value
CreatedAtDatetime
CreatedAt を DateTimeOffset にしたもの。
public DateTimeOffset CreatedAtDatetime { get; }
Property Value
Data
X から受け取った生の JSON。
public JsonObject Data { get; }
Property Value
DefaultProfile
既定のプロフィールか。
public bool DefaultProfile { get; }
Property Value
DefaultProfileImage
既定のプロフィール画像か。
public bool DefaultProfileImage { get; }
Property Value
Description
自己紹介。
public string Description { get; }
Property Value
DescriptionUrls
自己紹介に含まれる URL。
public List<UrlEntity> DescriptionUrls { get; }
Property Value
FastFollowersCount
public int FastFollowersCount { get; }
Property Value
FavouritesCount
いいねの数。
public int FavouritesCount { get; }
Property Value
FollowedBy
このユーザーがログイン中のアカウントをフォローしているか。
public bool FollowedBy { get; }
Property Value
FollowersCount
フォロワー数。
public int FollowersCount { get; }
Property Value
Following
ログイン中のアカウントがこのユーザーをフォローしているか。
public bool Following { get; }
Property Value
FollowingCount
フォロー数。
public int FollowingCount { get; }
Property Value
HasCustomTimelines
カスタムタイムラインを持つか。
public bool HasCustomTimelines { get; }
Property Value
Id
ユーザーの一意な ID。
public string Id { get; }
Property Value
IsAutomated
X が自動化アカウントとして表示しているか。
public bool IsAutomated { get; }
Property Value
IsBlueVerified
青いチェックマークで認証済みか。
public bool IsBlueVerified { get; }
Property Value
IsTranslator
翻訳者か。
public bool IsTranslator { get; }
Property Value
ListedCount
リストに追加されている数。
public int ListedCount { get; }
Property Value
LiveFollowing
public bool LiveFollowing { get; }
Property Value
Location
場所。
public string Location { get; }
Property Value
MediaCount
メディアの数。
public int MediaCount { get; }
Property Value
Muting
ログイン中のアカウントがこのユーザーをミュートしているか。
public bool Muting { get; }
Property Value
Name
表示名。
public string Name { get; }
Property Value
NormalFollowersCount
public int NormalFollowersCount { get; }
Property Value
NotificationsEnabled
ログイン中のアカウントがこのユーザーの通知をオンにしているか。
public bool NotificationsEnabled { get; }
Property Value
ParodyCommentaryFanLabel
X が自己申告を求めるアカウントの 'Parody'、'Commentary'、'Fan'。それ以外は null。
public string? ParodyCommentaryFanLabel { get; }
Property Value
PinnedTweetIds
固定ツイートの ID。
public List<string> PinnedTweetIds { get; }
Property Value
PossiblySensitive
センシティブな内容を含む可能性があるか。
public bool PossiblySensitive { get; }
Property Value
ProfileBannerUrl
プロフィールのバナー画像の URL。
public string? ProfileBannerUrl { get; }
Property Value
ProfileImageUrl
プロフィール画像の URL(HTTPS)。
public string ProfileImageUrl { get; }
Property Value
ProfileInterstitialType
プロフィールの警告表示の種類。
public string ProfileInterstitialType { get; }
Property Value
Protected
鍵アカウントか。
public bool Protected { get; }
Property Value
ScreenName
スクリーンネーム(@ 無し)。
public string ScreenName { get; }
Property Value
StatusesCount
ツイート数。
public int StatusesCount { get; }
Property Value
TranslatorType
翻訳者の種類。
public string TranslatorType { get; }
Property Value
Url
ユーザーの URL。
public string? Url { get; }
Property Value
Urls
プロフィールに設定された URL。
public List<UrlEntity> Urls { get; }
Property Value
Verified
旧来の認証バッジを持つか。
public bool Verified { get; }
Property Value
VerifiedType
組織アカウントなら 'Business' または 'Government'、それ以外は null。組織は Verified が false で、表示されるバッジはこのフィールドと IsBlueVerified に由来します。
public string? VerifiedType { get; }
Property Value
WantRetweets
リツイートを希望しているか。
public bool WantRetweets { get; }
Property Value
WithheldInCountries
内容が非表示になっている国。
public List<string> WithheldInCountries { get; }
Property Value
Methods
BlockAsync()
ブロックします。
public Task<User> BlockAsync()
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(User?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(User? other)
Parameters
otherUserAn object to compare with this object.
Returns
FollowAsync()
フォローします。
public Task<User> FollowAsync()
Returns
GetDmHistoryAsync(string?)
このユーザーとの DM 履歴を取得します。
public Task<Result<Message>> GetDmHistoryAsync(string? maxId = null)
Parameters
maxIdstring
Returns
GetFollowersAsync(int)
フォロワーを取得します。
public Task<Result<User>> GetFollowersAsync(int count = 20)
Parameters
countint
Returns
GetFollowersYouKnowAsync(int)
知り合いかもしれないフォロワーを取得します。
public Task<Result<User>> GetFollowersYouKnowAsync(int count = 20)
Parameters
countint
Returns
GetFollowingAsync(int)
フォロー中のユーザーを取得します。
public Task<Result<User>> GetFollowingAsync(int count = 20)
Parameters
countint
Returns
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
Returns
GetLatestFollowersAsync(int, string?)
最新のフォロワーを取得します(最大 200 件)。
public Task<Result<User>> GetLatestFollowersAsync(int count = 200, string? cursor = null)
Parameters
Returns
GetLatestFriendsAsync(int, string?)
最新のフォロー中ユーザーを取得します(最大 200 件)。
public Task<Result<User>> GetLatestFriendsAsync(int count = 200, string? cursor = null)
Parameters
Returns
GetSubscriptionsAsync(int)
サブスクライブしているユーザーを取得します。
public Task<Result<User>> GetSubscriptionsAsync(int count = 20)
Parameters
countint
Returns
GetTweetsAsync(string, int)
ユーザーのツイートを取得します。
public Task<Result<Tweet>> GetTweetsAsync(string tweetType, int count = 40)
Parameters
Returns
GetVerifiedFollowersAsync(int)
認証済みのフォロワーを取得します。
public Task<Result<User>> GetVerifiedFollowersAsync(int count = 20)
Parameters
countint
Returns
MuteAsync()
ミュートします。
public Task<User> MuteAsync()
Returns
SendDmAsync(string, string?, string?)
このユーザーに DM を送ります。
public Task<Message> SendDmAsync(string text, string? mediaId = null, string? replyTo = null)
Parameters
textstring本文。
mediaIdstring添付するメディア ID(UploadMediaAsync(string, bool, double?, string?, string?, bool) で取得)。
replyTostring返信先のメッセージ ID。
Returns
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
UnfollowAsync()
フォローを解除します。
public Task<User> UnfollowAsync()
Returns
UnmuteAsync()
ミュートを解除します。
public Task<User> UnmuteAsync()
Returns
UpdateAsync()
最新の情報で更新します。
public Task UpdateAsync()