You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DotNET/Parser/CommandParser.cs
+24-3Lines changed: 24 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,27 @@ public CommandParser OnError(Action<object, string> callback)
121
121
/// If the input does not start with a prefix, it returns false so the message can be processed further. (As a chat message, for example)
122
122
/// </returns>
123
123
publicboolParse(stringinput,intaccessLevel=0)
124
+
{
125
+
returnParse(input,null,accessLevel);
126
+
}
127
+
128
+
/// <summary>
129
+
/// Parses text in search of a command (with prefix), and runs it accordingly.
130
+
/// </summary>
131
+
/// <remarks>
132
+
/// Data does not need to be formatted in any way before parsing. Simply pass your input to the function and
133
+
/// it will determine if it is a valid command, check the command's <c>Command.CanExecute</c> function, and run the
134
+
/// command.
135
+
/// Use <c>Arguments[].FromName(...)</c> to get the values of the parsed arguments in the command action.
136
+
/// </remarks>
137
+
/// <param name="data">Data to pass to the command. This data can be used by the command when it is executed.</param>
138
+
/// <param name="input">A string inputted by a user. If the string does not start with the parser prefix, it will return false, otherwise it will parse the command.</param>
139
+
/// <param name="accessLevel">An optional level to limit executing commands if the user doesn't have permission.</param>
140
+
/// <returns>
141
+
/// True if the input is non-empty and starts with the <c>Prefix</c>.
142
+
/// If the input does not start with a prefix, it returns false so the message can be processed further. (As a chat message, for example)
0 commit comments