summary refs log tree commit diff
path: root/src/api/util
diff options
context:
space:
mode:
authorCyberL1 <cyber.hf18@gmail.com>2026-06-25 11:32:28 +0200
committerRory& <root@rory.gay>2026-06-25 17:56:49 +0200
commitd6c05bdeffc34abc379312e65788c7a51016dba9 (patch)
treebc2a4a700165486987ddd0b55e9fc1bd0571a8ad /src/api/util
parentfix: check for poll answer limit (diff)
downloadserver-ts-d6c05bdeffc34abc379312e65788c7a51016dba9.tar.xz
check opts not message
Diffstat (limited to 'src/api/util')
-rw-r--r--src/api/util/handlers/Message.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts

index 85b76cc2..53360ed7 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts
@@ -497,7 +497,7 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> { } if (opts.poll?.answers) { - if (message.poll.answers.length < 0 && message.poll.answers.length > 10) { + if (opts.poll.answers.length < 1 || opts.poll.answers.length > 10) { const errors: ErrorList = {}; errors["poll"] = makeObjectErrorContent("BASE_TYPE_BAD_LENGTH", "Must be between 1 and 10 in length."); throw new FieldError(50035, "Invalid form body", errors);