bot/node_modules/@discordjs/builders/dist/index.mjs.map

1 line
62 KiB
Plaintext
Raw Normal View History

2022-02-16 11:32:42 +01:00
{"version":3,"sources":["../src/messages/embed/Assertions.ts","../src/messages/embed/Embed.ts","../src/messages/formatters.ts","../src/interactions/slashCommands/Assertions.ts","../src/interactions/slashCommands/SlashCommandBuilder.ts","../src/interactions/slashCommands/options/boolean.ts","../src/interactions/slashCommands/mixins/NameAndDescription.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionBase.ts","../src/interactions/slashCommands/options/channel.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.ts","../src/interactions/slashCommands/options/integer.ts","../src/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.ts","../src/interactions/slashCommands/options/mentionable.ts","../src/interactions/slashCommands/options/number.ts","../src/interactions/slashCommands/options/role.ts","../src/interactions/slashCommands/options/string.ts","../src/interactions/slashCommands/options/user.ts","../src/interactions/slashCommands/mixins/SharedSlashCommandOptions.ts","../src/interactions/slashCommands/SlashCommandSubcommands.ts","../src/interactions/contextMenuCommands/Assertions.ts","../src/interactions/contextMenuCommands/ContextMenuCommandBuilder.ts"],"sourcesContent":["import type { APIEmbedField } from 'discord-api-types/v9';\nimport { z } from 'zod';\n\nexport const fieldNamePredicate = z.string().min(1).max(256);\n\nexport const fieldValuePredicate = z.string().min(1).max(1024);\n\nexport const fieldInlinePredicate = z.boolean().optional();\n\nexport const embedFieldPredicate = z.object({\n\tname: fieldNamePredicate,\n\tvalue: fieldValuePredicate,\n\tinline: fieldInlinePredicate,\n});\n\nexport const embedFieldsArrayPredicate = embedFieldPredicate.array();\n\nexport const fieldLengthPredicate = z.number().lte(25);\n\nexport function validateFieldLength(fields: APIEmbedField[], amountAdding: number): void {\n\tfieldLengthPredicate.parse(fields.length + amountAdding);\n}\n\nexport const authorNamePredicate = fieldNamePredicate.nullable();\n\nexport const urlPredicate = z.string().url().nullish();\n\nexport const colorPredicate = z.number().gte(0).lte(0xffffff).nullable();\n\nexport const descriptionPredicate = z.string().min(1).max(4096).nullable();\n\nexport const footerTextPredicate = z.string().min(1).max(2048).nullable();\n\nexport const timestampPredicate = z.union([z.number(), z.date()]).nullable();\n\nexport const titlePredicate = fieldNamePredicate.nullable();\n","import type {\n\tAPIEmbed,\n\tAPIEmbedAuthor,\n\tAPIEmbedField,\n\tAPIEmbedFooter,\n\tAPIEmbedImage,\n\tAPIEmbedProvider,\n\tAPIEmbedThumbnail,\n\tAPIEmbedVideo,\n} from 'discord-api-types/v9';\nimport {\n\tauthorNamePredicate,\n\tcolorPredicate,\n\tdescriptionPredicate,\n\tembedFieldsArrayPredicate,\n\tfieldInlinePredicate,\n\tfieldNamePredicate,\n\tfieldValuePredicate,\n\tfooterTextPredicate,\n\ttimestampPredicate,\n\ttitlePredicate,\n\turlPredicate,\n\tvalidateFieldLength,\n} from './Assertions';\n\nexport interface AuthorOptions {\n\tname: string;\n\turl?: string;\n\ticonURL?: string;\n}\n\nexport interface FooterOptions {\n\ttext: string;\n\ticonURL?: string;\n}\n\n/**\n * Represents an embed in a message (image/video preview, rich embed, etc.)\n */\nexport class Embed implements APIEmbed {\n\t/**\n\t * An array of fields of this embed\n\t */\n\tpublic fields: APIEmbedField[];\n\n\t/**\n\t * The embed title\n\t */\n\tpublic title?: string;\n\n\t/**\n\t * The embed description\n\t */\n\tpublic description?: string;\n\n\t/**\n\t * The embed url\n\t */\n\tpublic url?: string;\n\n\t/**\n\t * The embed color\n\t */\n\tpublic color?: number;\n\n\t/**\n\t * The timestamp of the embed in the ISO format\n\t */\n\tpublic timestamp?: string;\n\n\t/**\n\t * The embed thumbnail data\n\t */\n\tpublic thumbnail?: APIEmbedThumbnail;\n\n\t/**\n\t * The embed image data\n\t */\n\tpublic image?: APIEmbedImage;\n\n\t/**\n\t * Received video data\n\t */\n\tpublic video?: APIEmbedV