Search Results for

    Show / Hide Table of Contents

    Class RestInteractionContext<TInteraction>

    Represents a Rest based context of an IDiscordInteraction.

    Inheritance
    Object
    RestInteractionContext<TInteraction>
    RestInteractionContext
    Implements
    IRestInteractionContext
    IInteractionContext
    IRouteMatchContainer
    Namespace: Discord.Rest
    Assembly: Discord.Net.Rest.dll
    Syntax
    public class RestInteractionContext<TInteraction> : object, IRestInteractionContext, IInteractionContext, IRouteMatchContainer where TInteraction : RestInteraction
    Type Parameters
    Name Description
    TInteraction

    Constructors

    | Improve this Doc View Source

    RestInteractionContext(DiscordRestClient, TInteraction)

    Initializes a new RestInteractionContext<TInteraction>.

    Declaration
    public RestInteractionContext(DiscordRestClient client, TInteraction interaction)
    Parameters
    Type Name Description
    DiscordRestClient client

    The underlying client.

    TInteraction interaction

    The underlying interaction.

    | Improve this Doc View Source

    RestInteractionContext(DiscordRestClient, TInteraction, Func<String, Task>)

    Initializes a new RestInteractionContext<TInteraction>.

    Declaration
    public RestInteractionContext(DiscordRestClient client, TInteraction interaction, Func<string, Task> interactionResponseCallback)
    Parameters
    Type Name Description
    DiscordRestClient client

    The underlying client.

    TInteraction interaction

    The underlying interaction.

    Func<String, Task> interactionResponseCallback

    The callback for outgoing json.

    Properties

    | Improve this Doc View Source

    Channel

    Gets the IRestMessageChannel the command originated from.

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

    Client

    Gets the DiscordRestClient that the command will be executed with.

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

    Guild

    Gets the RestGuild the command originated from.

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

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

    | Improve this Doc View Source

    Interaction

    Gets the RestInteraction the command was received with.

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

    InteractionResponseCallback

    Gets or sets the callback to use when the service has outgoing json for the rest webhook.

    Declaration
    public Func<string, Task> InteractionResponseCallback { get; set; }
    Property Value
    Type Description
    Func<String, Task>
    Remarks

    If this property is null the default callback will be used.

    | 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 RestUser who executed the command.

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

    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

    IRestInteractionContext
    IInteractionContext
    IRouteMatchContainer

    Theme

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