mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
feat(builders): improve embed errors and predicates (#7795)
* feat(builders): improve embed errors * fix: use imageURLPredicates Co-authored-by: Synbulat Biishev <arziksin@gmail.com> Co-authored-by: Synbulat Biishev <arziksin@gmail.com>
This commit is contained in:
@@ -31,6 +31,12 @@ export const urlPredicate = s.string.url({
|
||||
allowedProtocols: ['http:', 'https:'],
|
||||
}).nullish;
|
||||
|
||||
export const embedAuthorPredicate = s.object({
|
||||
name: authorNamePredicate,
|
||||
iconURL: imageURLPredicate,
|
||||
url: urlPredicate,
|
||||
});
|
||||
|
||||
export const RGBPredicate = s.number.int.ge(0).le(255);
|
||||
export const colorPredicate = s.number.int
|
||||
.ge(0)
|
||||
@@ -41,6 +47,11 @@ export const descriptionPredicate = s.string.lengthGe(1).lengthLe(4096).nullable
|
||||
|
||||
export const footerTextPredicate = s.string.lengthGe(1).lengthLe(2048).nullable;
|
||||
|
||||
export const embedFooterPredicate = s.object({
|
||||
text: footerTextPredicate,
|
||||
iconURL: imageURLPredicate,
|
||||
});
|
||||
|
||||
export const timestampPredicate = s.union(s.number, s.date).nullable;
|
||||
|
||||
export const titlePredicate = fieldNamePredicate.nullable;
|
||||
|
||||
Reference in New Issue
Block a user