Skip to main content

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​
TypeNameDescription
System.Stringtext
System.CharcThe char prefix.
System.Int32argPosReferences 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​
TypeName
System.Stringtext
System.Stringstr
System.Int32argPos
StringComparisoncomparisonType