Search Results for

    Show / Hide Table of Contents

    Class MessageExtensions

    Provides extension methods for IUserMessage that relates to commands.

    Inheritance
    Object
    MessageExtensions
    Namespace: Discord.Commands
    Assembly: Discord.Net.Commands.dll
    Syntax
    public static class MessageExtensions : object

    Methods

    | Improve this Doc View Source

    HasCharPrefix(IUserMessage, Char, ref Int32)

    Gets whether the message starts with the provided character.

    Declaration
    public static bool HasCharPrefix(this IUserMessage msg, char c, ref int argPos)
    Parameters
    Type Name Description
    IUserMessage msg

    The message to check against.

    Char c

    The char prefix.

    Int32 argPos

    References where the command starts.

    Returns
    Type Description
    Boolean

    true if the message begins with the char c; otherwise false.

    | Improve this Doc View Source

    HasMentionPrefix(IUserMessage, IUser, ref Int32)

    Gets whether the message starts with the user's mention string.

    Declaration
    public static bool HasMentionPrefix(this IUserMessage msg, IUser user, ref int argPos)
    Parameters
    Type Name Description
    IUserMessage msg
    IUser user
    Int32 argPos
    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    HasStringPrefix(IUserMessage, String, ref Int32, StringComparison)

    Gets whether the message starts with the provided string.

    Declaration
    public static bool HasStringPrefix(this IUserMessage msg, string str, ref int argPos, StringComparison comparisonType = null)
    Parameters
    Type Name Description
    IUserMessage msg
    String str
    Int32 argPos
    StringComparison comparisonType
    Returns
    Type Description
    Boolean

    Theme

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