Class MessageExtensions
Provides extension methods for <see cref="!:IUserMessage"></see> that relates to commands.
Assembly: Revolt.Net.Commands.dll​
View Source​
Declaration
public static class MessageExtensions : object
Methods​
HasCharPrefix(String, Char, ref Int32)​
Gets whether the message starts with the provided character.
View Source​
Declaration
public static bool HasCharPrefix(this string text, 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 |
|---|---|---|
System.String | text | |
System.Char | c | The char prefix. |
System.Int32 | argPos | References where the command starts. |
HasStringPrefix(String, String, ref Int32, StringComparison)​
Gets whether the message starts with the provided string.
View Source​
Declaration
public static bool HasStringPrefix(this string text, string str, ref int argPos, StringComparison comparisonType = null)
Returns​
System.Boolean
Parameters​
| Type | Name |
|---|---|
System.String | text |
System.String | str |
System.Int32 | argPos |
StringComparison | comparisonType |