Skip to content

Commit d03f90d

Browse files
committed
Improve form commands descriptions and add missing javadocs
1 parent 4ef2c89 commit d03f90d

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed

src/main/java/net/discordjug/javabot/systems/staff_commands/forms/commands/CloseFormSubcommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public CloseFormSubcommand(FormsRepository formsRepo, FormInteractionManager int
3939
super(botConfig, formsRepo);
4040
this.formsRepo = formsRepo;
4141
this.interactionManager = interactionManager;
42-
setCommandData(new SubcommandData("close", "Close an existing form")
42+
setCommandData(new SubcommandData("close", "Close an existing form, preventing further submissions.")
4343
.addOptions(new OptionData(OptionType.INTEGER, FORM_ID_FIELD, "The ID of a form to close", true, true)));
4444
}
4545

src/main/java/net/discordjug/javabot/systems/staff_commands/forms/commands/FormSubcommand.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,40 @@ public abstract class FormSubcommand extends Subcommand {
1919
* Form ID field identificator used in form subcommands.
2020
*/
2121
protected static final String FORM_ID_FIELD = "form-id";
22+
23+
/**
24+
* Channel field identifier.
25+
*/
2226
protected static final String FORM_CHANNEL_FIELD = "channel";
27+
28+
/**
29+
* Message id field identifier.
30+
*/
2331
protected static final String FORM_MESSAGE_ID_FIELD = "message-id";
32+
33+
/**
34+
* Expiration field identifier.
35+
*/
2436
protected static final String FORM_EXPIRATION_FIELD = "expiration";
37+
38+
/**
39+
* "onetime" field identifier.
40+
*/
2541
protected static final String FORM_ONETIME_FIELD = "onetime";
42+
43+
/**
44+
* Submit message field identifier.
45+
*/
2646
protected static final String FORM_SUBMIT_MESSAGE_FIELD = "submit-message";
47+
48+
/**
49+
* Submit channel field identifier.
50+
*/
2751
protected static final String FORM_SUBMIT_CHANNEL_FIELD = "submit-channel";
52+
53+
/**
54+
* Form title field identifier.
55+
*/
2856
protected static final String FORM_TITLE_FIELD = "title";
2957
private final BotConfig botConfig;
3058
private final FormsRepository formsRepository;

src/main/java/net/discordjug/javabot/systems/staff_commands/forms/commands/ModifyFormSubcommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class ModifyFormSubcommand extends FormSubcommand implements AutoCompleta
3737
public ModifyFormSubcommand(FormsRepository formsRepo, BotConfig botConfig) {
3838
super(botConfig, formsRepo);
3939
this.formsRepo = formsRepo;
40-
setCommandData(new SubcommandData("modify", "Modify an existing form").addOptions(
40+
setCommandData(new SubcommandData("modify", "Modify an existing form's data. Use *-field commands to manage form fields").addOptions(
4141
new OptionData(OptionType.INTEGER, FORM_ID_FIELD, "ID of the form to modify", true, true),
4242
new OptionData(OptionType.STRING, FORM_TITLE_FIELD, "Form title (shown in modal)"),
4343
new OptionData(OptionType.CHANNEL, FORM_SUBMIT_CHANNEL_FIELD, "Channel to log form submissions in"),

src/main/java/net/discordjug/javabot/systems/staff_commands/forms/commands/RemoveFieldFormSubcommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class RemoveFieldFormSubcommand extends FormSubcommand implements AutoCom
3838
public RemoveFieldFormSubcommand(FormsRepository formsRepo, BotConfig botConfig) {
3939
super(botConfig, formsRepo);
4040
this.formsRepo = formsRepo;
41-
setCommandData(new SubcommandData("remove-field", "Removse a field from an existing form")
41+
setCommandData(new SubcommandData("remove-field", "Remove a field from an existing form")
4242
.addOption(OptionType.INTEGER, FORM_ID_FIELD, "Form ID to add the field to", true, true)
4343
.addOption(OptionType.INTEGER, FORM_FIELD_INDEX_FIELD, "0-indexed # of the field to remove", true, true));
4444
}

0 commit comments

Comments
 (0)