Commit Graph

29 Commits

Author SHA1 Message Date
Jiralite
77e767277b build: Upgrade dependencies and pnpm (#11420)
* build: upgrade dependencies

* build: upgrade pnpm

* test: fix voice

* build: regenerate file

* fix: reports by ESLint

* fix: docs errors

* build: downgrades

* build: no upstream bump

* build: discord-api-types 0.38.40

* build: pnpm 10.30.1

* fix: ignore @typescript-eslint/no-duplicate-type-constituents

* fix: jsdoc lint in api-extractor

* build: update template for ESLint

Co-authored-by: Almeida <github@almeidx.dev>

* chore: explicit TODO

Co-authored-by: Qjuh <76154676+Qjuh@users.noreply.github.com>

* chore: revert typings lint change

---------

Co-authored-by: Qjuh <76154676+Qjuh@users.noreply.github.com>
Co-authored-by: Almeida <github@almeidx.dev>
2026-02-20 17:44:38 +00:00
Denis-Adrian Cristea
9bf1f739e0 chore: remove usage of the prefer-global rules (#11279) 2025-12-10 14:05:29 +00:00
Danial Raza
e8217e335c feat!: support new s/S timestamp styles (#11267)
BREAKING CHANGE: `TimestampStyles.LongTime` has been removed. Use `TimestampStyles.MediumTime` instead.
BREAKING CHANGE: `TimestampStyles.ShortDateTime` has been removed. Use `TimestampStyles.LongDateShortTime` instead.
BREAKING CHANGE: `TimestampStyles.LongDateTime` has been removed. Use `TimestampStyles.FullDateShortTime` instead.
2025-11-12 10:55:20 +00:00
Kendell R
9723cc590b fix: improve handling of italics in the presence of links (#11064)
* fix(formatters): don't escape * in links

* add test for * -> * in url

* `\S+` -> `\S*` (tested locally)

* @Qjuh: handle italics both inside+outside <url>s

* more accurate <link> matcher

---------

Co-authored-by: Qjuh <76154676+Qjuh@users.noreply.github.com>
2025-11-09 09:02:25 +00:00
Almeida
fbdec3d828 feat!: add escapeQuote and escapeBlockQuote (#11129)
BREAKING CHANGE: `escapeMarkdown` now escapes quotes and block quotes by default.

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
2025-10-06 10:30:36 +01:00
Almeida
50018979ed feat: add email and phoneNumber formatters (#11050)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2025-08-26 21:26:05 +00:00
Noel
f580de8025 chore: upgrade deps (#10824) 2025-04-05 13:18:56 +02:00
Jiralite
3ddb73287b refactor!: Better application command mention format approach (#10639)
BREAKING CHANGE: The parameters of `chatInputApplicationCommandMention()` have been reordered.
2025-01-12 20:09:03 +00:00
Jiralite
af4018c25f refactor!: Remove underscore (#10648)
BREAKING CHANGE: Removed the `underscore()` formatter. Use `underline()` instead.
2024-12-09 00:02:34 +00:00
Jaw0r3k
0ac140cd9f refactor!: escape expanded markdown by default (#9463)
feat: support markdown

BREAKING CHANGE: `heading`, `bulletedList`, `numberedList`, `maskedLink` in `EscapeMarkdownOptions` now defaults to `true`.

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
2024-12-05 22:43:40 +00:00
cobalt
f2f7f1f65b refactor(formatters): Change :_: emoji name placeholder (#10567)
* Change `:_:` emoji name placeholder

* Update tests

* Format
2024-11-11 00:42:04 +00:00
Danial Raza
04df3c4130 feat: add linked roles formatters (#10461)
* feat: add linked roles formatters

* docs: requested changes

Co-authored-by: Almeida <github@almeidx.dev>

* docs: remove locale

---------

Co-authored-by: Almeida <github@almeidx.dev>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2024-10-06 14:19:50 +00:00
Danial Raza
fcd35ea2e7 feat: add subtext formatter (#10400)
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
2024-07-24 10:23:55 +00:00
Jiralite
4f59b740d0 feat: Premium buttons (#10353)
* feat: premium buttons

* docs: deprecation string

* feat(InteractionResponses): add deprecation message

* feat(builders): add tests

* chore: remove @ts-expect-errors

* test: update method name

* refactor(formatters): stricter types

* docs: deprecate method in typings

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2024-07-04 18:57:35 +00:00
cobalt
0f9017ef95 fix(Faces): Escape backslash in Shrug (#10156)
* fix(Faces): Escape backslash in `Shrug`

* Update formatters.ts

* Update formatters.ts

* Update formatters.test.ts
2024-02-27 17:23:31 +00:00
codershiba
7b8e0debeb refactor(formatters): Add support for object and name param in formatEmoji() (#10076)
* feat: add support for name param and object in `formatEmoji()`

* Update formatters.ts

* refactor: swap priority

---------

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
2024-01-13 11:02:41 +00:00
Almeida
0f1e02b3dd fix(escape*): dont escape urls (#9958)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-12-24 16:16:33 +00:00
Danial Raza
461948c07d fix: deprecate underscore in favor of underline (#10054)
* fix: deprecate `underscore` in favor of `underline`

* refactor: use `underline` in `underscore`

Co-authored-by: Almeida <github@almeidx.dev>

---------

Co-authored-by: Almeida <github@almeidx.dev>
2023-12-17 20:44:54 +00:00
iCrawl
8f432400d8 build: multi-config build and dep update 2023-11-14 01:26:22 +01:00
Almeida
975d5f18ae chore: use descriptive type parameter names (#9937)
* chore: use descriptive type parameter names

* refactor: requested changes

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-11-12 17:21:51 +00:00
Almeida
efbcda70fc docs: remove markdown (#9914)
docs(formatters): remove markdown

The documentation website does not support rendering markdown

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-11-05 18:18:23 +00:00
Almeida
566d5e2c81 feat(formatters): add guild navigation mentions (#9436)
* feat(formatters): add guild navigation mentions

* docs: dont force support article locale

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>

---------

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
2023-08-25 12:01:58 +00:00
Danial Raza
0d787e9f79 feat: add new markdown formatters (#9613)
* feat: add new markdown formatters

Co-authored-by: Jaw0r3k <jaw0r3k.g@gmail.com>

* Update packages/formatters/src/formatters.ts

Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>

* refactor: remove unnecessary index tracking and rename 'array' to 'items'

Co-authored-by: Almeida <almeidx@pm.me>

* refactor: rename 'array' to 'items'

Co-authored-by: Almeida <almeidx@pm.me>

* refactor(heading): consolidate heading functions into a single function

Also correct param names from array to items.

Co-authored-by: Jaw0r3k <jaw0r3k.g@gmail.com>

* refactor: add HeadingLevel enum and use switch case

* fix: export HeadingLevel enum

Co-authored-by: Jaw0r3k <jaworekwiadomosci@gmail.com>

* feat(heading): add missing documentation for level parameter

* refactor: update list formatters

* docs: correct heading formatter description

* refactor: update list formatters

* fix(heading): remove unnecessary space

* refactor: move list callback function to outer scope

* test: add tests

* refactor: requested changes

* refactor: suggested changes

* docs: add missing documentation

* style: suggested change

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>

* refactor: use math max method instead

Co-authored-by: Almeida <almeidx@pm.me>

---------

Co-authored-by: Jaw0r3k <jaw0r3k.g@gmail.com>
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
Co-authored-by: Almeida <almeidx@pm.me>
Co-authored-by: Jaw0r3k <jaworekwiadomosci@gmail.com>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: space <spaceeec@yahoo.com>
2023-08-25 10:06:13 +00:00
Jiralite
23e0ac56f4 docs(formatters): Enhance the documentation (#9364) 2023-04-10 22:29:06 +02:00
Almeida
869153c3fd refactor: compare with undefined directly (#9191)
* refactor: compare with `undefined` directly

* fix: lint
2023-03-12 20:24:22 +00:00
Cl00e9ment
13ce78af6e refactor: Moved the escapeX functions from discord.js to @discord.js/formatters (#8957)
* refactor: moved escapeX funcs from discord.js to @discord.js/formatters

- moved escapeX functions from discord.js to @discord.js/formatters
- converted code from JS to TS (including JSDoc and TSDoc)
- made linter happy
- modified the escapeHeading's RegExp to pass the RegExp safety test
- escapeBulletedList now conserves the bullet style (- or *)

* fix: removed useless exports and eslint command

removed useless exports and eslint command

* fix(escapeX): emojis with underlines

porting the fix made in 2c4c5c23d6 into the refactorization PR

Co-authored-by: space <spaceeec@yahoo.com>
2023-01-13 16:21:25 +00:00
Almeida
2798ba1eb3 style: run prettier (#9041) 2023-01-12 09:23:02 +01:00
Suneet Tipirneni
273ba45e27 chore: use satisfies where applicable (#8884)
* chore: use satisfies where applicable

* chore: remove unneeded eslint ignores

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-16 02:12:38 +00:00
Suneet Tipirneni
3fca638a84 feat: add @discordjs/formatters (#8889)
* feat: add @discordjs/formatters

* chore: make requested changes

* chore: make requested changes

* chore: fix other places

* chore: make requested changes

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-02 12:55:00 +00:00