Search Results for

    Show / Hide Table of Contents

    Class SocketInteractionContext<TInteraction>

    Represents a Web-Socket based context of an IDiscordInteraction.

    Inheritance
    Object
    SocketInteractionContext<TInteraction>
    ShardedInteractionContext<TInteraction>
    SocketInteractionContext
    Implements
    IInteractionContext
    IRouteMatchContainer
    Namespace: Discord.Interactions
    Assembly: Discord.Net.WebSocket.dll
    Syntax
    public class SocketInteractionContext<TInteraction> : object, IInteractionContext, IRouteMatchContainer where TInteraction : SocketInteraction
    Type Parameters
    Name Description
    TInteraction

    Constructors

    | Improve this Doc View Source

    SocketInteractionContext(DiscordSocketClient, TInteraction)

    Initializes a new SocketInteractionContext<TInteraction>.

    Declaration
    public SocketInteractionContext(DiscordSocketClient client, TInteraction interaction)
    Parameters
    Type Name Description
    DiscordSocketClient client

    The underlying client.

    TInteraction interaction

    The underlying interaction.

    Properties

    | Improve this Doc View Source

    Channel

    Gets the ISocketMessageChannel the command originated from.

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

    Client

    Gets the DiscordSocketClient that the command will be executed with.

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

    Guild

    Gets the SocketGuild the command originated from.

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

    Will be null if the command is from a DM Channel.

    | Improve this Doc View Source

    Interaction

    Gets the SocketInteraction the command was received with.

    Declaration
    public TInteraction Interaction { get; }
    Property Value
    Type Description
    TInteraction
    | 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 SocketUser who executed the command.

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

    Methods

    | Improve this Doc View Source

    SetSegmentMatches(IEnumerable<IRouteSegmentMatch>)

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

    Explicit Interface Implementations

    | Improve this Doc View Source

    IInteractionContext.Channel

    Gets the channel the interaction originated from.

    Declaration
    IMessageChannel IInteractionContext.Channel { get; }
    Returns
    Type Description
    IMessageChannel
    | Improve this Doc View Source

    IInteractionContext.Client

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

    Declaration
    IDiscordClient IInteractionContext.Client { get; }
    Returns
    Type Description
    IDiscordClient
    | Improve this Doc View Source

    IInteractionContext.Guild

    Gets the guild the interaction originated from.

    Declaration
    IGuild IInteractionContext.Guild { get; }
    Returns
    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

    IInteractionContext.Interaction

    Gets the underlying interaction.

    Declaration
    IDiscordInteraction IInteractionContext.Interaction { get; }
    Returns
    Type Description
    IDiscordInteraction
    | Improve this Doc View Source

    IInteractionContext.User

    Gets the user who invoked the interaction event.

    Declaration
    IUser IInteractionContext.User { get; }
    Returns
    Type Description
    IUser

    Implements

    IInteractionContext
    IRouteMatchContainer

    Theme

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