Search Results for

    Show / Hide Table of Contents

    Class InteractionContext

    Represents the context of an Interaction.

    Inheritance
    Object
    InteractionContext
    Implements
    IInteractionContext
    IRouteMatchContainer
    Namespace: Discord.Interactions
    Assembly: Discord.Net.Interactions.dll
    Syntax
    public class InteractionContext : object, IInteractionContext, IRouteMatchContainer

    Constructors

    | Improve this Doc View Source

    InteractionContext(IDiscordClient, IDiscordInteraction, IMessageChannel)

    Initializes a new SocketInteractionContext<TInteraction>.

    Declaration
    public InteractionContext(IDiscordClient client, IDiscordInteraction interaction, IMessageChannel channel = null)
    Parameters
    Type Name Description
    IDiscordClient client

    The underlying client.

    IDiscordInteraction interaction

    The underlying interaction.

    IMessageChannel channel

    IMessageChannel the command originated from.

    Properties

    | Improve this Doc View Source

    Channel

    Gets the channel the interaction originated from.

    Declaration
    public IMessageChannel Channel { get; }
    Property Value
    Type Description
    IMessageChannel
    | Improve this Doc View Source

    Client

    Gets the client that will be used to handle this interaction.

    Declaration
    public IDiscordClient Client { get; }
    Property Value
    Type Description
    IDiscordClient
    | Improve this Doc View Source

    Guild

    Gets the guild the interaction originated from.

    Declaration
    public IGuild Guild { get; }
    Property Value
    Type Description
    IGuild
    Remarks

    Will be null if the interaction originated from a DM channel or the interaction was a Context Command interaction.

    | Improve this Doc View Source

    Interaction

    Gets the underlying interaction.

    Declaration
    public IDiscordInteraction Interaction { get; }
    Property Value
    Type Description
    IDiscordInteraction
    | Improve this Doc View Source

    SegmentMatches

    Gets the collection of captured route segments in this container.

    Declaration
    public IReadOnlyCollection<IRouteSegmentMatch> SegmentMatches { get; }
    Property Value
    Type Description
    IReadOnlyCollection<IRouteSegmentMatch>

    A collection of captured route segments.

    | Improve this Doc View Source

    User

    Gets the user who invoked the interaction event.

    Declaration
    public IUser User { get; }
    Property Value
    Type Description
    IUser

    Methods

    | Improve this Doc View Source

    SetSegmentMatches(IEnumerable<IRouteSegmentMatch>)

    Declaration
    public void SetSegmentMatches(IEnumerable<IRouteSegmentMatch> segmentMatches)
    Parameters
    Type Name Description
    IEnumerable<IRouteSegmentMatch> segmentMatches

    Implements

    IInteractionContext
    IRouteMatchContainer

    Theme

    • Improve this Doc
    • View Source
    In This Article
    Back to top Discord.Net (c) 2015-2022 3.9.0