Table of Contents

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)

public SocketInteractionContext(DiscordSocketClient client, TInteraction interaction)

Parameters

client DiscordSocketClient

The underlying client.

interaction TInteraction

The underlying interaction.

Properties

Channel

Gets the ISocketMessageChannel the command originated from.

public ISocketMessageChannel Channel { get; }

Property Value

ISocketMessageChannel

Client

Gets the DiscordSocketClient that the command will be executed with.

public DiscordSocketClient Client { get; }

Property Value

DiscordSocketClient

Guild

Gets the SocketGuild the command originated from.

public SocketGuild Guild { get; }

Property Value

SocketGuild

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

SocketUser

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.