From c82c500444477a927cc2f956b2d1f9ca278ca271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Sun, 1 Sep 2024 12:34:00 +0200 Subject: [PATCH] fix(core): explain peeking during parsing --- docs/core/index.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/core/index.md b/docs/core/index.md index fea1787..ac7b2e1 100644 --- a/docs/core/index.md +++ b/docs/core/index.md @@ -637,6 +637,12 @@ A parser can fail when the input does not match the expectations. The command manager will turn the failure into a command syntax exception which can then be displayed to the sender, informing them about what went wrong. + +!!! note + Cloud v2 does not require you to peek before consuming from the `CommandInput`. The input is defensively copied + before being passed to the parser, unlike in Cloud v1. You may still want to peek in order to determine _how_ + to parse the input, but it is no longer considered incorrect not to do so. + The recommended way of parsing an argument is to: 1. Peek the command input.