feat: Enforce limit of URLs for link buttons (#11011)

feat: enforce limit of URLs for link buttons
This commit is contained in:
Jiralite
2025-07-23 15:20:56 +01:00
committed by GitHub
parent 90b3692941
commit f2fec9177f
2 changed files with 9 additions and 2 deletions

View File

@@ -32,7 +32,7 @@ const buttonDangerPredicate = buttonCustomIdPredicateBase.extend({ style: z.lite
const buttonLinkPredicate = buttonPredicateBase.extend({
style: z.literal(ButtonStyle.Link),
url: z.url({ protocol: /^(?:https?|discord)$/ }),
url: z.url({ protocol: /^(?:https?|discord)$/ }).max(512),
emoji: emojiPredicate.optional(),
label: labelPredicate,
});