mirror of
https://github.com/discordjs/discord.js.git
synced 2026-05-24 04:20:09 +00:00
Compare commits
5 Commits
@discordjs
...
@discordjs
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ce9e66ec1 | ||
|
|
4906aaea4c | ||
|
|
ba5ccab919 | ||
|
|
93cf7721d0 | ||
|
|
e6370ae378 |
@@ -2,6 +2,12 @@
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
# [@discordjs/builders@1.11.3](https://github.com/discordjs/discord.js/compare/@discordjs/builders@1.11.2...@discordjs/builders@1.11.3) - (2025-08-10)
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
- **contextMenuCommands:** Remove regular expression validation (#10996) ([4906aae](https://github.com/discordjs/discord.js/commit/4906aaea4c0e6e868fa658d3359026eb662fbcb8))
|
||||
|
||||
# [@discordjs/builders@1.11.0](https://github.com/discordjs/discord.js/compare/@discordjs/builders@1.10.1...@discordjs/builders@1.11.0) - (2025-04-25)
|
||||
|
||||
## Features
|
||||
|
||||
@@ -16,8 +16,8 @@ describe('Context Menu Commands', () => {
|
||||
// Too short of a name
|
||||
expect(() => ContextMenuCommandAssertions.validateName('')).toThrowError();
|
||||
|
||||
// Invalid characters used
|
||||
expect(() => ContextMenuCommandAssertions.validateName('ABC123$%^&')).toThrowError();
|
||||
// This should be fine, even with trailing and leading spaces (API trims it).
|
||||
expect(() => ContextMenuCommandAssertions.validateName(' 🩵 ABC 123 $%^& ')).not.toThrowError();
|
||||
|
||||
// Too long of a name
|
||||
expect(() =>
|
||||
@@ -60,8 +60,6 @@ describe('Context Menu Commands', () => {
|
||||
});
|
||||
|
||||
test('GIVEN invalid name THEN throw error', () => {
|
||||
expect(() => getBuilder().setName('$$$')).toThrowError();
|
||||
|
||||
expect(() => getBuilder().setName(' ')).toThrowError();
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/package.json",
|
||||
"name": "@discordjs/builders",
|
||||
"version": "1.11.1",
|
||||
"version": "1.11.3",
|
||||
"description": "A set of builders that you can use when creating your bot",
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
@@ -68,7 +68,7 @@
|
||||
"@discordjs/formatters": "workspace:^",
|
||||
"@discordjs/util": "workspace:^",
|
||||
"@sapphire/shapeshift": "^4.0.0",
|
||||
"discord-api-types": "^0.38.1",
|
||||
"discord-api-types": "^0.38.16",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"ts-mixer": "^6.0.4",
|
||||
"tslib": "^2.6.3"
|
||||
|
||||
@@ -57,7 +57,7 @@ export function assertReturnOfBuilder<ReturnType extends MediaGalleryItemBuilder
|
||||
input: unknown,
|
||||
ExpectedInstanceOf: new () => ReturnType,
|
||||
): asserts input is ReturnType {
|
||||
s.instance(ExpectedInstanceOf).parse(input);
|
||||
s.instance(ExpectedInstanceOf).setValidationEnabled(isValidationEnabled).parse(input);
|
||||
}
|
||||
|
||||
export function validateComponentArray<
|
||||
@@ -67,5 +67,6 @@ export function validateComponentArray<
|
||||
.array()
|
||||
.lengthGreaterThanOrEqual(min)
|
||||
.lengthLessThanOrEqual(max)
|
||||
.setValidationEnabled(isValidationEnabled)
|
||||
.parse(input);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import type { AnyComponentBuilder, MessageActionRowComponentBuilder } from '../A
|
||||
import { ActionRowBuilder } from '../ActionRow.js';
|
||||
import { ComponentBuilder } from '../Component.js';
|
||||
import { createComponentBuilder, resolveBuilder } from '../Components.js';
|
||||
import { containerColorPredicate, spoilerPredicate, validateComponentArray } from './Assertions.js';
|
||||
import { containerColorPredicate, spoilerPredicate } from './Assertions.js';
|
||||
import { FileBuilder } from './File.js';
|
||||
import { SeparatorBuilder } from './Separator.js';
|
||||
import { TextDisplayBuilder } from './TextDisplay.js';
|
||||
@@ -231,7 +231,6 @@ export class ContainerBuilder extends ComponentBuilder<APIContainerComponent> {
|
||||
* {@inheritDoc ComponentBuilder.toJSON}
|
||||
*/
|
||||
public toJSON(): APIContainerComponent {
|
||||
validateComponentArray(this.components, 1, 10);
|
||||
return {
|
||||
...this.data,
|
||||
components: this.components.map((component) => component.toJSON()),
|
||||
|
||||
@@ -11,7 +11,7 @@ export class ThumbnailBuilder extends ComponentBuilder<APIThumbnailComponent> {
|
||||
* @example
|
||||
* Creating a thumbnail from an API data object:
|
||||
* ```ts
|
||||
* const thumbnaik = new ThumbnailBuilder({
|
||||
* const thumbnail = new ThumbnailBuilder({
|
||||
* description: 'some text',
|
||||
* media: {
|
||||
* url: 'https://cdn.discordapp.com/embed/avatars/4.png',
|
||||
|
||||
@@ -7,8 +7,7 @@ const namePredicate = s
|
||||
.string()
|
||||
.lengthGreaterThanOrEqual(1)
|
||||
.lengthLessThanOrEqual(32)
|
||||
// eslint-disable-next-line prefer-named-capture-group
|
||||
.regex(/^( *[\p{P}\p{L}\p{N}\p{sc=Devanagari}\p{sc=Thai}]+ *)+$/u)
|
||||
.regex(/\S/)
|
||||
.setValidationEnabled(isValidationEnabled);
|
||||
const typePredicate = s
|
||||
.union([s.literal(ApplicationCommandType.User), s.literal(ApplicationCommandType.Message)])
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
"homepage": "https://discord.js.org",
|
||||
"funding": "https://github.com/discordjs/discord.js?sponsor",
|
||||
"dependencies": {
|
||||
"discord-api-types": "^0.38.1"
|
||||
"discord-api-types": "^0.38.16"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@discordjs/api-extractor": "workspace:^",
|
||||
|
||||
13
pnpm-lock.yaml
generated
13
pnpm-lock.yaml
generated
@@ -680,8 +680,8 @@ importers:
|
||||
specifier: ^4.0.0
|
||||
version: 4.0.0
|
||||
discord-api-types:
|
||||
specifier: ^0.38.1
|
||||
version: 0.38.1
|
||||
specifier: ^0.38.16
|
||||
version: 0.38.16
|
||||
fast-deep-equal:
|
||||
specifier: ^3.1.3
|
||||
version: 3.1.3
|
||||
@@ -1060,8 +1060,8 @@ importers:
|
||||
packages/formatters:
|
||||
dependencies:
|
||||
discord-api-types:
|
||||
specifier: ^0.38.1
|
||||
version: 0.38.1
|
||||
specifier: ^0.38.16
|
||||
version: 0.38.16
|
||||
devDependencies:
|
||||
'@discordjs/api-extractor':
|
||||
specifier: workspace:^
|
||||
@@ -7641,6 +7641,9 @@ packages:
|
||||
discord-api-types@0.38.1:
|
||||
resolution: {integrity: sha512-vsjsqjAuxsPhiwbPjTBeGQaDPlizFmSkU0mTzFGMgRxqCDIRBR7iTY74HacpzrDV0QtERHRKQEk1tq7drZUtHg==}
|
||||
|
||||
discord-api-types@0.38.16:
|
||||
resolution: {integrity: sha512-Cz42dC5WqJD17Yk0bRy7YLTJmh3NKo4FGpxZuA8MHqT0RPxKSrll5YhlODZ2z5DiEV/gpHMeTSrTFTWpSXjT1Q==}
|
||||
|
||||
dlv@1.1.3:
|
||||
resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
|
||||
|
||||
@@ -21517,6 +21520,8 @@ snapshots:
|
||||
|
||||
discord-api-types@0.38.1: {}
|
||||
|
||||
discord-api-types@0.38.16: {}
|
||||
|
||||
dlv@1.1.3: {}
|
||||
|
||||
dmd@6.2.3:
|
||||
|
||||
Reference in New Issue
Block a user