Class InteractionContext
- Namespace
- Discord.Interactions
- Assembly
- Discord.Net.Interactions.dll
Represents the context of an Interaction.
public class InteractionContext : IInteractionContext, IRouteMatchContainer
- Inheritance
-
InteractionContext
- Implements
- Inherited Members
Constructors
InteractionContext(IDiscordClient, IDiscordInteraction, IMessageChannel)
Initializes a new InteractionContext.
public InteractionContext(IDiscordClient client, IDiscordInteraction interaction, IMessageChannel channel = null)
Parameters
client
IDiscordClientThe underlying client.
interaction
IDiscordInteractionThe underlying interaction.
channel
IMessageChannelIMessageChannel the command originated from.
Properties
Channel
Gets the channel the interaction originated from.
public IMessageChannel Channel { get; }
Property Value
Client
Gets the client that will be used to handle this interaction.
public IDiscordClient Client { get; }
Property Value
Guild
Gets the guild the interaction originated from.
public IGuild Guild { get; }
Property Value
Remarks
Will be null if the interaction originated from a DM channel or the interaction was a Context Command interaction.
Interaction
Gets the underlying interaction.
public IDiscordInteraction Interaction { get; }
Property Value
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 user who invoked the interaction event.
public IUser 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.