Skip to content

Commit 1614da9

Browse files
committed
Allow for disabling form expiration time
1 parent 8d35fc7 commit 1614da9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public ModifyFormSubcommand(FormsRepository formsRepo, BotConfig botConfig) {
4343
new OptionData(OptionType.STRING, "submit-message",
4444
"Message displayed to the user once they submit the form"),
4545
new OptionData(OptionType.STRING, "expiration",
46-
"UTC time after which the form will not accept further submissions. "
46+
"UTC time after which the form stops accepting submissions. - for no expiration"
4747
+ FormInteractionManager.DATE_FORMAT_STRING),
4848
new OptionData(OptionType.BOOLEAN, "onetime",
4949
"If the form should only accept one submission per user. Defaults to false.")));
@@ -67,6 +67,7 @@ public void execute(SlashCommandInteractionEvent event) {
6767
if (event.getOption("expiration") == null) {
6868
expiration = oldForm.expiration();
6969
} else {
70+
if ("-".equals(event.getOption("expiration", OptionMapping::getAsString))) expiration = null;
7071
Optional<Instant> expirationOpt;
7172
try {
7273
expirationOpt = FormInteractionManager.parseExpiration(event);

0 commit comments

Comments
 (0)