Class MessageExtensions
Provides extension methods for IUserMessage that relates to commands.
Namespace: Discord.Commands
Assembly: Discord.Net.Commands.dll
Syntax
public static class MessageExtensions : object
Methods
| Improve this Doc View SourceHasCharPrefix(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 |
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 |
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 |