Table of Contents

Class Message

Namespace
Twikit
Assembly
Twikit.dll

ダイレクトメッセージ。

public class Message : IEquatable<Message>
Inheritance
Message
Implements
Derived
Inherited Members

Constructors

Message(Client, JsonObject, string, string?)

public Message(Client client, JsonObject data, string senderId, string? recipientId)

Parameters

client Client
data JsonObject
senderId string
recipientId string

Fields

ClientRef

protected readonly Client ClientRef

Field Value

Client

Properties

Attachment

添付の情報。

public JsonObject? Attachment { get; }

Property Value

JsonObject

AttachmentUrl

添付メディアの直接 URL(無ければ null)。

public string? AttachmentUrl { get; }

Property Value

string

Id

メッセージの ID。

public string Id { get; }

Property Value

string

RecipientId

受信者の ID(グループでは null)。

public string? RecipientId { get; }

Property Value

string

RepliedToId

返信元のメッセージ ID。

public string? RepliedToId { get; }

Property Value

string

RepliedToText

返信元のメッセージ本文。

public string? RepliedToText { get; }

Property Value

string

ReplyData

返信元のメッセージ(新規メッセージでは null)。

public JsonObject? ReplyData { get; }

Property Value

JsonObject

SenderId

送信者の ID。

public string SenderId { get; }

Property Value

string

Text

本文。

public string Text { get; }

Property Value

string

Time

タイムスタンプ。

public string? Time { get; }

Property Value

string

Methods

AddReactionAsync(string)

リアクションを追加します。

public virtual Task<HttpResponseMessage> AddReactionAsync(string emoji)

Parameters

emoji string

Returns

Task<HttpResponseMessage>

DeleteAsync()

メッセージを削除します。

public Task<HttpResponseMessage> DeleteAsync()

Returns

Task<HttpResponseMessage>

DownloadAttachmentAsync()

添付メディアをダウンロードします。X が Attachment に入れる URL は ton.twitter.com を 指しており公開 CDN ではないため、ログイン中のクライアントを通して取得します。

public Task<byte[]> DownloadAttachmentAsync()

Returns

Task<byte[]>

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(Message?)

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

public bool Equals(Message? other)

Parameters

other Message

An object to compare with this object.

Returns

bool

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

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

RemoveReactionAsync(string)

リアクションを削除します。

public virtual Task<HttpResponseMessage> RemoveReactionAsync(string emoji)

Parameters

emoji string

Returns

Task<HttpResponseMessage>

ReplyAsync(string, string?)

このメッセージに返信します。

public virtual Task<Message> ReplyAsync(string text, string? mediaId = null)

Parameters

text string
mediaId string

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.