@ovencord/builders 1.12.1 → 1.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@ovencord/builders",
4
- "version": "1.12.1",
4
+ "version": "1.12.3",
5
5
  "description": "A set of builders that you can use when creating your bot",
6
6
  "scripts": {
7
7
  "test": "bun test",
@@ -6,6 +6,7 @@ export const textInputPredicate = z.object({
6
6
  id: idPredicate,
7
7
  type: z.literal(ComponentType.TextInput),
8
8
  custom_id: customIdPredicate,
9
+ label: z.string().min(1).max(45),
9
10
  style: z.nativeEnum(TextInputStyle),
10
11
  min_length: z.number().min(0).max(4_000).optional(),
11
12
  max_length: z.number().min(1).max(4_000).optional(),
@@ -50,6 +50,24 @@ export class TextInputBuilder extends ComponentBuilder<APITextInputComponent> {
50
50
  return this;
51
51
  }
52
52
 
53
+ /**
54
+ * Sets the label for this text input.
55
+ *
56
+ * @param label - The label to use
57
+ */
58
+ public setLabel(label: string) {
59
+ this.data.label = label;
60
+ return this;
61
+ }
62
+
63
+ /**
64
+ * Clears the label for this text input.
65
+ */
66
+ public clearLabel() {
67
+ this.data.label = undefined;
68
+ return this;
69
+ }
70
+
53
71
  /**
54
72
  * Sets the style for this text input.
55
73
  *
@@ -11,6 +11,8 @@ import type { APIMessageComponentEmoji } from 'discord-api-types/v10';
11
11
  */
12
12
  export function parseEmoji(text: string): APIMessageComponentEmoji {
13
13
  const decodedText = text.includes('%') ? decodeURIComponent(text) : text;
14
+ // Plain snowflake ID (e.g. '1465147007831380128') — treat as custom emoji ID
15
+ if (/^\d{17,21}$/.test(decodedText)) return { id: decodedText, name: undefined, animated: false };
14
16
  if (!decodedText.includes(':')) return { animated: false, name: decodedText.replace(/\uFE0F/g, ''), id: undefined };
15
17
  const match = /<?(?:(?<animated>a):)?(?<name>\w{2,32}):(?<id>\d{17,19})?>?/.exec(decodedText);
16
18