Search Results for

    Show / Hide Table of Contents

    Class ExtensionMethods

    Defines various extensions specific to CommandsNext.

    Inheritance
    System.Object
    ExtensionMethods
    Namespace: DisCatSharp.CommandsNext
    Assembly: DisCatSharp.CommandsNext.dll
    Syntax
    public static class ExtensionMethods

    Methods

    | Improve this Doc View Source

    GetCommandsNext(DiscordClient)

    Gets the active CommandsNext module for this client.

    Declaration
    public static CommandsNextExtension GetCommandsNext(this DiscordClient client)
    Parameters
    Type Name Description
    DiscordClient client

    Client to get CommandsNext module from.

    Returns
    Type Description
    CommandsNextExtension

    The module, or null if not activated.

    | Improve this Doc View Source

    GetCommandsNextAsync(DiscordShardedClient)

    Gets the active CommandsNext modules for all shards in this client.

    Declaration
    public static async Task<IReadOnlyDictionary<int, CommandsNextExtension>> GetCommandsNextAsync(this DiscordShardedClient client)
    Parameters
    Type Name Description
    DiscordShardedClient client

    Client to get CommandsNext instances from.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyDictionary<System.Int32, CommandsNextExtension>>

    A dictionary of the modules, indexed by shard id.

    | Improve this Doc View Source

    RegisterCommands(IReadOnlyDictionary<Int32, CommandsNextExtension>, CommandBuilder[])

    Builds and registers all supplied commands.

    Declaration
    public static void RegisterCommands(this IReadOnlyDictionary<int, CommandsNextExtension> extensions, params CommandBuilder[] cmds)
    Parameters
    Type Name Description
    System.Collections.Generic.IReadOnlyDictionary<System.Int32, CommandsNextExtension> extensions

    Extensions to register commands on.

    CommandBuilder[] cmds

    Commands to build and register.

    | Improve this Doc View Source

    RegisterCommands(IReadOnlyDictionary<Int32, CommandsNextExtension>, Assembly)

    Registers all commands from a given assembly. The command classes need to be public to be considered for registration.

    Declaration
    public static void RegisterCommands(this IReadOnlyDictionary<int, CommandsNextExtension> extensions, Assembly assembly)
    Parameters
    Type Name Description
    System.Collections.Generic.IReadOnlyDictionary<System.Int32, CommandsNextExtension> extensions

    Extensions to register commands on.

    System.Reflection.Assembly assembly

    Assembly to register commands from.

    | Improve this Doc View Source

    RegisterCommands(IReadOnlyDictionary<Int32, CommandsNextExtension>, Type)

    Registers all commands from a given command class.

    Declaration
    public static void RegisterCommands(this IReadOnlyDictionary<int, CommandsNextExtension> extensions, Type t)
    Parameters
    Type Name Description
    System.Collections.Generic.IReadOnlyDictionary<System.Int32, CommandsNextExtension> extensions

    Extensions to register commands on.

    System.Type t

    Type of the class which holds commands to register.

    | Improve this Doc View Source

    RegisterCommands<T>(IReadOnlyDictionary<Int32, CommandsNextExtension>)

    Registers all commands from a given command class.

    Declaration
    public static void RegisterCommands<T>(this IReadOnlyDictionary<int, CommandsNextExtension> extensions)
        where T : BaseCommandModule
    Parameters
    Type Name Description
    System.Collections.Generic.IReadOnlyDictionary<System.Int32, CommandsNextExtension> extensions

    Extensions to register commands on.

    Type Parameters
    Name Description
    T

    Class which holds commands to register.

    | Improve this Doc View Source

    RegisterConverter<T>(IReadOnlyDictionary<Int32, CommandsNextExtension>, IArgumentConverter<T>)

    Registers an argument converter for specified type.

    Declaration
    public static void RegisterConverter<T>(this IReadOnlyDictionary<int, CommandsNextExtension> extensions, IArgumentConverter<T> converter)
    Parameters
    Type Name Description
    System.Collections.Generic.IReadOnlyDictionary<System.Int32, CommandsNextExtension> extensions

    Extensions to register the converter on.

    IArgumentConverter<T> converter

    Converter to register.

    Type Parameters
    Name Description
    T

    Type for which to register the converter.

    | Improve this Doc View Source

    RegisterUserFriendlyTypeName<T>(IReadOnlyDictionary<Int32, CommandsNextExtension>, String)

    Registers a user-friendly type name.

    Declaration
    public static void RegisterUserFriendlyTypeName<T>(this IReadOnlyDictionary<int, CommandsNextExtension> extensions, string value)
    Parameters
    Type Name Description
    System.Collections.Generic.IReadOnlyDictionary<System.Int32, CommandsNextExtension> extensions

    Extensions to register the name on.

    System.String value

    Name to register.

    Type Parameters
    Name Description
    T

    Type to register the name for.

    | Improve this Doc View Source

    SetHelpFormatter<T>(IReadOnlyDictionary<Int32, CommandsNextExtension>)

    Sets the help formatter to use with the default help command.

    Declaration
    public static void SetHelpFormatter<T>(this IReadOnlyDictionary<int, CommandsNextExtension> extensions)
        where T : BaseHelpFormatter
    Parameters
    Type Name Description
    System.Collections.Generic.IReadOnlyDictionary<System.Int32, CommandsNextExtension> extensions

    Extensions to set the help formatter on.

    Type Parameters
    Name Description
    T

    Type of the formatter to use.

    | Improve this Doc View Source

    UnregisterCommands(IReadOnlyDictionary<Int32, CommandsNextExtension>, Command[])

    Unregisters specified commands from CommandsNext.

    Declaration
    public static void UnregisterCommands(this IReadOnlyDictionary<int, CommandsNextExtension> extensions, params Command[] cmds)
    Parameters
    Type Name Description
    System.Collections.Generic.IReadOnlyDictionary<System.Int32, CommandsNextExtension> extensions

    Extensions to unregister commands on.

    Command[] cmds

    Commands to unregister.

    | Improve this Doc View Source

    UnregisterConverter<T>(IReadOnlyDictionary<Int32, CommandsNextExtension>)

    Unregisters an argument converter for specified type.

    Declaration
    public static void UnregisterConverter<T>(this IReadOnlyDictionary<int, CommandsNextExtension> extensions)
    Parameters
    Type Name Description
    System.Collections.Generic.IReadOnlyDictionary<System.Int32, CommandsNextExtension> extensions

    Extensions to unregister the converter on.

    Type Parameters
    Name Description
    T

    Type for which to unregister the converter.

    | Improve this Doc View Source

    UseCommandsNext(DiscordClient, CommandsNextConfiguration)

    Enables CommandsNext module on this DiscordClient.

    Declaration
    public static CommandsNextExtension UseCommandsNext(this DiscordClient client, CommandsNextConfiguration cfg)
    Parameters
    Type Name Description
    DiscordClient client

    Client to enable CommandsNext for.

    CommandsNextConfiguration cfg

    CommandsNext configuration to use.

    Returns
    Type Description
    CommandsNextExtension

    Created CommandsNextExtension.

    | Improve this Doc View Source

    UseCommandsNextAsync(DiscordShardedClient, CommandsNextConfiguration)

    Enables CommandsNext module on all shards in this DiscordShardedClient.

    Declaration
    public static async Task<IReadOnlyDictionary<int, CommandsNextExtension>> UseCommandsNextAsync(this DiscordShardedClient client, CommandsNextConfiguration cfg)
    Parameters
    Type Name Description
    DiscordShardedClient client

    Client to enable CommandsNext for.

    CommandsNextConfiguration cfg

    CommandsNext configuration to use.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyDictionary<System.Int32, CommandsNextExtension>>

    A dictionary of created CommandsNextExtension, indexed by shard id.

    • Improve this Doc
    • View Source
    In This Article
    Back to top © 2021-2022 Aiko IT Systems