Search Results for

    Show / Hide Table of Contents

    Interface ISlashCommandBuildService

    Holds all the methods to build the ISlashCommandInfo.

    Namespace: Color_Chan.Discord.Commands.Services.Builders
    Assembly: Color-Chan.Discord.Commands.dll
    Syntax
    public interface ISlashCommandBuildService

    Methods

    | Improve this Doc View Source

    BuildSlashCommandInfos(Assembly)

    Builds all commands in a specific assembly and stores them in a System.Collections.Generic.IReadOnlyList<T> of System.Collections.Generic.KeyValuePair`2 of System.String, ISlashCommandInfo.

    Declaration
    IReadOnlyList<KeyValuePair<string, ISlashCommandInfo>> BuildSlashCommandInfos(Assembly assembly)
    Parameters
    Type Name Description
    System.Reflection.Assembly assembly

    The System.Reflection.Assembly where the ISlashCommandBuildService will search for commands.

    Returns
    Type Description
    System.Collections.Generic.IReadOnlyList<System.Collections.Generic.KeyValuePair<System.String, ISlashCommandInfo>>

    A System.Collections.Generic.IReadOnlyList<T> of System.Collections.Generic.KeyValuePair`2 of System.String, ISlashCommandInfo. The key System.String contains the command name. And the value ISlashCommandInfo contains the commands information to execute it.

    | Improve this Doc View Source

    BuildSlashCommandsParams(IEnumerable<ISlashCommandInfo>)

    Builds the slash command parameters so it can be send to Discord's API.

    Declaration
    IEnumerable<DiscordCreateApplicationCommand> BuildSlashCommandsParams(IEnumerable<ISlashCommandInfo> commandInfos)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<ISlashCommandInfo> commandInfos

    The ISlashCommandInfos.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<DiscordCreateApplicationCommand>

    The build slash command parameters.

    | Improve this Doc View Source

    GetSlashCommandModules(Assembly)

    Get all the interaction command modules. These modules need to inherit ISlashCommandModule so they can be found by the ISlashCommandBuildService.

    Declaration
    IEnumerable<TypeInfo> GetSlashCommandModules(Assembly assembly)
    Parameters
    Type Name Description
    System.Reflection.Assembly assembly

    The System.Reflection.Assembly where the ISlashCommandBuildService will search for the modules.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Reflection.TypeInfo>

    A System.Collections.Generic.IEnumerable<T> of System.Reflection.TypeInfos that inherits ISlashCommandModule.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX