Class MessageExtensions
Provides extension methods for Discord.IUserMessage that relates to commands.
Assembly: Discord.Net.Commands.dll​
View Source​
Declaration
public static class MessageExtensions
Methods​
HasCharPrefix(IUserMessage, Char, ref Int32)​
Gets whether the message starts with the provided character.
View Source​
Declaration
public static bool HasCharPrefix(this IUserMessage msg, char c, ref int argPos)
Returns​
System.Boolean
:
true
if the message begins with the char <code data-dev-comment-type="paramref" class="paramref">c</code>; otherwise false
.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IUserMessage | msg | The message to check against. |
System.Char | c | The char prefix. |
System.Int32 | argPos | References where the command starts. |
HasStringPrefix(IUserMessage, String, ref Int32, StringComparison)​
Gets whether the message starts with the provided string.
View Source​
Declaration
public static bool HasStringPrefix(this IUserMessage msg, string str, ref int argPos, StringComparison comparisonType = StringComparison.Ordinal)
Returns​
System.Boolean
Parameters​
Type | Name |
---|---|
Discord.IUserMessage | msg |
System.String | str |
System.Int32 | argPos |
System.StringComparison | comparisonType |
HasMentionPrefix(IUserMessage, IUser, ref Int32)​
Gets whether the message starts with the user's mention string.
View Source​
Declaration
public static bool HasMentionPrefix(this IUserMessage msg, IUser user, ref int argPos)
Returns​
System.Boolean
Parameters​
Type | Name |
---|---|
Discord.IUserMessage | msg |
Discord.IUser | user |
System.Int32 | argPos |