Class SocketInteractionContext<TInteraction>
- Namespace
- Discord.Interactions
- Assembly
- Discord.Net.WebSocket.dll
Represents a Web-Socket based context of an IDiscordInteraction.
public class SocketInteractionContext<TInteraction> : IInteractionContext, IRouteMatchContainer where TInteraction : SocketInteraction
Type Parameters
TInteraction
- Inheritance
-
SocketInteractionContext<TInteraction>
- Implements
- Derived
- Inherited Members
Constructors
SocketInteractionContext(DiscordSocketClient, TInteraction)
Initializes a new SocketInteractionContext<TInteraction>.
public SocketInteractionContext(DiscordSocketClient client, TInteraction interaction)
Parameters
client
DiscordSocketClientThe underlying client.
interaction
TInteractionThe underlying interaction.
Properties
Channel
Gets the ISocketMessageChannel the command originated from.
public ISocketMessageChannel Channel { get; }
Property Value
Client
Gets the DiscordSocketClient that the command will be executed with.
public DiscordSocketClient Client { get; }
Property Value
Guild
Gets the SocketGuild the command originated from.
public SocketGuild Guild { get; }
Property Value
Remarks
Will be null if the command is from a DM Channel.
Interaction
Gets the SocketInteraction the command was received with.
public TInteraction Interaction { get; }
Property Value
- TInteraction
SegmentMatches
Gets the collection of captured route segments in this container.
public IReadOnlyCollection<IRouteSegmentMatch> SegmentMatches { get; }
Property Value
- IReadOnlyCollection<IRouteSegmentMatch>
A collection of captured route segments.
User
Gets the SocketUser who executed the command.
public SocketUser User { get; }
Property Value
Methods
SetSegmentMatches(IEnumerable<IRouteSegmentMatch>)
Sets the SegmentMatches property of this container.
public void SetSegmentMatches(IEnumerable<IRouteSegmentMatch> segmentMatches)
Parameters
segmentMatches
IEnumerable<IRouteSegmentMatch>The collection of captured route segments.