7
7
import java .util .regex .Pattern ;
8
8
9
9
/**
10
- * Class which contains all actions a Discord client accepts.
10
+ * Class, which contains all actions a Discord client accepts.
11
11
* <p>
12
12
* This allows you to open DM's {@link Channels#DM_CHANNEL}, specific settings
13
13
* {@link Settings.App#VOICE} and much more.
23
23
* Example:
24
24
*
25
25
* <pre>
26
- * < code>
26
+ * {@ code
27
27
* event.reply("Open Discord's secret home page!")
28
28
* .addActionRow(DiscordClientAction.Guild.GUILD_HOME_CHANNEL.asLinkButton("Open home page!", event.getGuild().getId())
29
- * </code>
29
+ * }
30
30
* </pre>
31
31
*
32
32
* To improve readability, one might want to use a static import like:
33
33
*
34
34
* <pre>
35
- * < code>
35
+ * {@ code
36
36
* event.reply(whoIsCommandOutput)
37
37
* .addActionRow(USER.asLinkButton("Open home page!", target.getId())
38
- * </code>
38
+ * }
39
39
* </pre>
40
40
*/
41
41
public final class DiscordClientAction {
42
42
43
43
/**
44
- * Contains some of the more general actions
44
+ * Contains some of the more general actions.
45
45
*/
46
46
public enum General {
47
47
;
@@ -65,7 +65,7 @@ public enum General {
65
65
}
66
66
67
67
/**
68
- * Contains guild specific actions
68
+ * Contains actions related to guilds.
69
69
*/
70
70
public enum Guild {
71
71
;
@@ -94,7 +94,7 @@ public enum Guild {
94
94
}
95
95
96
96
/**
97
- * Contains actions related to channels
97
+ * Contains actions related to channels.
98
98
*/
99
99
public enum Channels {
100
100
;
@@ -110,7 +110,7 @@ public enum Channels {
110
110
}
111
111
112
112
/**
113
- * Contains actions related to the settings menu
113
+ * Contains actions related to the settings menu.
114
114
*/
115
115
/*
116
116
* The warning is about this inner class being too long, and that it should be external This
@@ -122,7 +122,7 @@ public enum Settings {
122
122
;
123
123
124
124
/**
125
- * Contains all user settings
125
+ * Contains all user settings.
126
126
*/
127
127
public enum User {
128
128
;
@@ -140,7 +140,7 @@ public enum User {
140
140
}
141
141
142
142
/**
143
- * Contains all payment settings
143
+ * Contains all payment settings.
144
144
*/
145
145
public enum Payment {
146
146
;
@@ -156,7 +156,7 @@ public enum Payment {
156
156
}
157
157
158
158
/**
159
- * Contains all app settings
159
+ * Contains all app settings.
160
160
*/
161
161
public enum App {
162
162
;
@@ -195,7 +195,7 @@ public enum App {
195
195
}
196
196
197
197
/**
198
- * Contains some of the more general settings
198
+ * Contains some of the more general settings.
199
199
*/
200
200
public enum General {
201
201
;
@@ -211,6 +211,9 @@ public enum General {
211
211
}
212
212
}
213
213
214
+ /**
215
+ * Contains actions related to game libraries.
216
+ */
214
217
public enum Library {
215
218
;
216
219
@@ -227,15 +230,15 @@ public enum Library {
227
230
}
228
231
229
232
/**
230
- * Pattern for the arguments, finds everything within brackets
233
+ * Pattern for the arguments, finds everything within brackets.
231
234
*/
232
235
public static final Pattern argumentPattern = Pattern .compile ("\\ {[^}]*}" );
233
236
234
- private final String url ;
237
+ private final String rawUrl ;
235
238
236
239
@ Contract (pure = true )
237
240
private DiscordClientAction (final String url ) {
238
- this . url = url ;
241
+ rawUrl = url ;
239
242
}
240
243
241
244
/**
@@ -249,7 +252,7 @@ private DiscordClientAction(final String url) {
249
252
* @see #formatUrl(String...)
250
253
*/
251
254
public String getRawUrl () {
252
- return url ;
255
+ return rawUrl ;
253
256
}
254
257
255
258
/**
@@ -260,7 +263,7 @@ public String getRawUrl() {
260
263
* @throws IllegalArgumentException When missing arguments
261
264
*/
262
265
public String formatUrl (final String ... arguments ) {
263
- String localUrl = url ;
266
+ String localUrl = rawUrl ;
264
267
265
268
for (final String argument : arguments ) {
266
269
localUrl = argumentPattern .matcher (localUrl ).replaceFirst (argument );
@@ -288,6 +291,6 @@ public Button asLinkButton(final String label, final String... arguments) {
288
291
289
292
@ Override
290
293
public String toString () {
291
- return "DiscordClientAction{" + "url='" + url + '\'' + '}' ;
294
+ return "DiscordClientAction{" + "url='" + rawUrl + '\'' + '}' ;
292
295
}
293
296
}
0 commit comments