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
* Creates a Container with a standardized unexpected error message, including a warning emoji and instructions for the user to try again or contact support if the issue persists.
33
+
*
34
+
* @return a Container containing the unexpected error message
35
+
*/
19
36
@NotNull
20
37
publicstaticContainerunexpectedError() {
21
38
returnContainer.of(TextDisplay.of(
@@ -24,6 +41,13 @@ public static Container unexpectedError() {
24
41
"*If the issue persists, please contact support*"));
25
42
}
26
43
44
+
/**
45
+
* Creates a Container with a standardized unexpected error message that includes the provided error details, along with a warning emoji and instructions for the user to try again or contact support if the issue persists.
46
+
*
47
+
* @param error the specific error details to include in the message
48
+
*
49
+
* @return a Container containing the unexpected error message with the provided error details
* Creates a Container with a standardized no permission message, including a no entry emoji and instructions for the user that they don't have the required permissions to perform the action.
62
+
*
63
+
* @return a Container containing the no permission message
64
+
*/
36
65
@NotNull
37
66
publicstaticContainernoPermission() {
38
67
returnContainer.of(TextDisplay.of(
39
68
"# " + LazyEmoji.NO_CLEAR + " No permission!\n" +
40
69
"You don't have the required permissions to do that!"));
41
70
}
42
71
72
+
/**
73
+
* Creates a Container with a standardized no permission message that includes the specific requirement needed to perform the action, along with a no entry emoji and instructions for the user that they must have the specified requirement to do that.
74
+
*
75
+
* @param requirement the specific requirement (e.g., role, permission) that the user must have to perform the action
76
+
*
77
+
* @return a Container containing the no permission message with the specified requirement
"You must have " + requirement + " to do that!"));
48
84
}
49
85
86
+
/**
87
+
* Creates a Container with a standardized invalid argument message that includes the specific argument and its value that caused the issue, along with a no entry emoji and instructions for the user that the provided argument is invalid.
88
+
*
89
+
* @param argument the name of the argument that is invalid
90
+
* @param value the value of the argument that is invalid (can be null)
91
+
*
92
+
* @return a Container containing the invalid argument message with the specified argument and value
* Creates a Container with a standardized invalid argument message that includes the specific argument and its value that caused the issue, along with a description of why the argument is invalid, a no entry emoji, and instructions for the user that the provided argument is invalid.
103
+
*
104
+
* @param argument the name of the argument that is invalid
105
+
* @param value the value of the argument that is invalid (can be null)
106
+
* @param description a description explaining why the argument is invalid or what the expected format/values are
107
+
*
108
+
* @return a Container containing the invalid argument message with the specified argument, value, and description
@@ -62,6 +115,16 @@ public static Container invalidArgument(@NotNull String argument, @Nullable Obje
62
115
"**" + argument + ":** " + value));
63
116
}
64
117
118
+
/**
119
+
* Creates a Container with a standardized invalid arguments message that includes a list of argument names and their corresponding values that caused the issue, along with a no entry emoji and instructions for the user that the provided arguments are invalid.
120
+
* The argumentsValues parameter should contain pairs of argument names and values (e.g., "argument1", value1, "argument2", value2, etc.).
121
+
*
122
+
* @param argumentsValues an array of objects representing pairs of argument names and their corresponding values that are invalid
123
+
*
124
+
* @return a Container containing the invalid arguments message with the specified argument names and values
125
+
*
126
+
* @throws IllegalArgumentException if the number of elements in argumentsValues is not even (i.e., each argument name does not have a corresponding value)
0 commit comments