Class ChatMessageExtensions
Extensions for ChatMessage to be used by Commands System.
Namespace: TehGM.Wolfringo.Commands
Assembly: Wolfringo.Commands.dll
Syntax
public static class ChatMessageExtensions
Methods
| Improve this Doc View SourceGetMessageWithoutPrefix(ChatMessage, String, Boolean)
Gets message text without prefix.
Declaration
public static string GetMessageWithoutPrefix(this ChatMessage message, string prefix, bool caseSensitive)
Parameters
Type | Name | Description |
---|---|---|
ChatMessage | message | The received message. |
String | prefix | Prefix. |
Boolean | caseSensitive | Whether the check should be performed case-sensitively. |
Returns
Type | Description |
---|---|
String | The message with prefix stripped off. |
GetMessageWithoutPrefix(ChatMessage, ICommandOptions)
Gets message text without prefix.
Declaration
public static string GetMessageWithoutPrefix(this ChatMessage message, ICommandOptions options)
Parameters
Type | Name | Description |
---|---|---|
ChatMessage | message | The received message. |
ICommandOptions | options | Commands options. |
Returns
Type | Description |
---|---|
String | The message with prefix stripped off. |
MatchesPrefixRequirement(ChatMessage, String, PrefixRequirement, Boolean, out Int32)
Checks if the message matches prefix requirements for command processing.
Declaration
public static bool MatchesPrefixRequirement(this ChatMessage message, string prefix, PrefixRequirement requirement, bool caseSensitive, out int startIndex)
Parameters
Type | Name | Description |
---|---|---|
ChatMessage | message | Message to check. |
String | prefix | Prefix. |
PrefixRequirement | requirement | Prefix requirement to check. |
Boolean | caseSensitive | Whether the check should be performed case-sensitively. |
Int32 | startIndex | Index of start of actual command message, without prefix. |
Returns
Type | Description |
---|---|
Boolean | True if the message matches prefix requirement; otherwise false. |
MatchesPrefixRequirement(ChatMessage, ICommandOptions, out Int32)
Checks if the message matches prefix requirements for command processing.
Declaration
public static bool MatchesPrefixRequirement(this ChatMessage message, ICommandOptions options, out int startIndex)
Parameters
Type | Name | Description |
---|---|---|
ChatMessage | message | Message to check. |
ICommandOptions | options | Commands options to perform the check with. |
Int32 | startIndex | Index of start of actual command message, without prefix. |
Returns
Type | Description |
---|---|
Boolean | True if the message matches prefix requirement; otherwise false. |