Skip to content

Commit 90e8a37

Browse files
committed
Log failed form submission attempts
1 parent ac9e2ff commit 90e8a37

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/net/discordjug/javabot/systems/staff_commands/forms/FormInteractionManager.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import java.util.function.Function;
1212

1313
import lombok.RequiredArgsConstructor;
14+
import lombok.extern.slf4j.Slf4j;
1415
import net.discordjug.javabot.annotations.AutoDetectableComponentHandler;
1516
import net.discordjug.javabot.systems.staff_commands.forms.dao.FormsRepository;
1617
import net.discordjug.javabot.systems.staff_commands.forms.model.FormData;
@@ -41,6 +42,7 @@
4142
*/
4243
@AutoDetectableComponentHandler(FormInteractionManager.FORM_COMPONENT_ID)
4344
@RequiredArgsConstructor
45+
@Slf4j
4446
public class FormInteractionManager implements ButtonHandler, ModalHandler {
4547

4648
/**
@@ -140,6 +142,8 @@ public void handleModal(ModalInteractionEvent event, List<ModalMapping> values)
140142

141143
TextChannel channel = event.getGuild().getTextChannelById(form.submitChannel());
142144
if (channel == null) {
145+
log.warn("A user tried to submit a form \"%s\" because the submission channel does not exist."
146+
.formatted(form.title()));
143147
event.getHook()
144148
.sendMessage("We couldn't receive your submission due to an error. Please contact server staff.")
145149
.queue();

0 commit comments

Comments
 (0)