Table of Contents

Class MessageExtensions

Namespace
Discord.Commands
Assembly
Discord.Net.Commands.dll

Provides extension methods for IUserMessage that relates to commands.

public static class MessageExtensions
Inheritance
MessageExtensions
Inherited Members

Methods

HasCharPrefix(IUserMessage, char, ref int)

Gets whether the message starts with the provided character.

public static bool HasCharPrefix(this IUserMessage msg, char c, ref int argPos)

Parameters

msg IUserMessage

The message to check against.

c char

The char prefix.

argPos int

References where the command starts.

Returns

bool

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

HasMentionPrefix(IUserMessage, IUser, ref int)

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

public static bool HasMentionPrefix(this IUserMessage msg, IUser user, ref int argPos)

Parameters

msg IUserMessage
user IUser
argPos int

Returns

bool

HasStringPrefix(IUserMessage, string, ref int, StringComparison)

Gets whether the message starts with the provided string.

public static bool HasStringPrefix(this IUserMessage msg, string str, ref int argPos, StringComparison comparisonType = StringComparison.Ordinal)

Parameters

msg IUserMessage
str string
argPos int
comparisonType StringComparison

Returns

bool