Class SpaceChat
スペースのチャット。履歴は HTTP で取得でき、ライブの受信・送信は WebSocket(.NET 標準の ClientWebSocket)を使います。
public sealed class SpaceChat
- Inheritance
-
SpaceChat
- Inherited Members
Constructors
SpaceChat(ProxseeApi, string, string?, string?, string?)
public SpaceChat(ProxseeApi proxsee, string chatToken, string? endpoint = null, string? roomId = null, string? accessToken = null)
Parameters
proxseeProxseeApichatTokenstringendpointstringroomIdstringaccessTokenstring
Properties
AccessToken
public string? AccessToken { get; }
Property Value
ChatToken
public string ChatToken { get; }
Property Value
Endpoint
public string? Endpoint { get; }
Property Value
IsLive
ライブの WebSocket が開いているか。
public bool IsLive { get; }
Property Value
ReadOnly
読み取り専用か(リプレイ、または参加者でない)。
public bool ReadOnly { get; }
Property Value
RoomId
public string? RoomId { get; }
Property Value
Methods
CloseAsync()
public Task CloseAsync()
Returns
ConnectAsync()
proxsee でチャットアクセスを解決し、スペースがライブなら WebSocket を開きます。 リプレイは読み取り専用で、履歴は取れますが WebSocket は提供されません。
public Task<SpaceChat> ConnectAsync()
Returns
HistoryAsync(string?, int)
チャット履歴を取得します。
public Task<List<ChatMessage>> HistoryAsync(string? cursor = null, int limit = 1000)
Parameters
Returns
ListenAsync(CancellationToken)
チャットメッセージを到着順に列挙します(WebSocket が必要)。
public IAsyncEnumerable<ChatMessage> ListenAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
SendAsync(string)
チャットメッセージを送ります(WebSocket が必要。読み取り専用なら SpaceException)。
public Task SendAsync(string text)
Parameters
textstring