Class Poll
- Namespace
- Twikit
- Assembly
- Twikit.dll
ツイートに付いた投票。
public sealed class Poll : IEquatable<Poll>
- Inheritance
-
Poll
- Implements
- Inherited Members
Constructors
Poll(Client, JsonObject, Tweet?)
public Poll(Client client, JsonObject data, Tweet? tweet = null)
Parameters
clientClientdataJsonObjecttweetTweet
Properties
Choices
選択肢の一覧。
public List<PollChoice> Choices { get; }
Property Value
CountsAreFinal
票数が確定しているか。
public bool CountsAreFinal { get; }
Property Value
DurationMinutes
投票期間(分)。
public int? DurationMinutes { get; }
Property Value
- int?
EndDatetimeUtc
終了日時(UTC)。
public string? EndDatetimeUtc { get; }
Property Value
Id
投票の ID。
public string Id { get; }
Property Value
LastUpdatedDatetimeUtc
最終更新日時(UTC)。
public string? LastUpdatedDatetimeUtc { get; }
Property Value
Name
投票の名前(poll2choice_text_only など)。
public string? Name { get; }
Property Value
SelectedChoice
自分が選んだ選択肢の番号。
public string? SelectedChoice { get; }
Property Value
Tweet
投票が付いたツイート。
public Tweet? Tweet { get; }
Property Value
Methods
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(Poll?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Poll? other)
Parameters
otherPollAn object to compare with this object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
VoteAsync(string)
投票します。
public Task<Poll> VoteAsync(string selectedChoice)
Parameters
selectedChoicestring選択肢のラベル、またはその番号('1'、'2'、...)。X は番号しか受け付けないので、ラベルは変換されます。