Class SocketInteractionContext<TInteraction>
- Namespace
- HeyBox.Interactions
- Assembly
- HeyBox.Net.WebSocket.dll
表示基于 WebSocket 的 IHeyBoxInteraction 上下文。
public class SocketInteractionContext<TInteraction> : IInteractionContext, IRouteMatchContainer where TInteraction : SocketInteraction
Type Parameters
TInteraction
- Inheritance
-
SocketInteractionContext<TInteraction>
- Implements
- Derived
- Inherited Members
Constructors
SocketInteractionContext(HeyBoxSocketClient, TInteraction)
public SocketInteractionContext(HeyBoxSocketClient client, TInteraction interaction)
Parameters
client
HeyBoxSocketClient底层客户端。
interaction
TInteraction底层交互对象。
Properties
Channel
获取命令来源的 ISocketMessageChannel。
public ISocketMessageChannel Channel { get; }
Property Value
Client
获取用于执行命令的 HeyBoxSocketClient。
public HeyBoxSocketClient Client { get; }
Property Value
Interaction
获取接收到命令的 SocketInteraction。
public TInteraction Interaction { get; }
Property Value
- TInteraction
MessageId
获取本次交互来源的消息 ID。
public ulong MessageId { get; }
Property Value
Room
获取命令来源的 SocketRoom。
public SocketRoom? Room { get; }
Property Value
Remarks
如果命令来源为私聊频道,则为 null。
RoomId
获取用于处理本次交互的应用命令信息。
public ulong? RoomId { get; }
Property Value
SegmentMatches
获取此容器中捕获的路由片段集合。
public IReadOnlyCollection<IRouteSegmentMatch> SegmentMatches { get; }
Property Value
- IReadOnlyCollection<IRouteSegmentMatch>
捕获的路由片段集合。
User
获取执行命令的 SocketUser。
public SocketUser? User { get; }
Property Value
UserId
获取触发本次交互的用户 ID。
public uint UserId { get; }
Property Value
Methods
SetSegmentMatches(IEnumerable<IRouteSegmentMatch>)
设置此容器的 SegmentMatches 属性。
public void SetSegmentMatches(IEnumerable<IRouteSegmentMatch> segmentMatches)
Parameters
segmentMatches
IEnumerable<IRouteSegmentMatch>捕获的路由片段集合。