kira-arts 1.4.2 → 1.5.0

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/README.md CHANGED
@@ -24,8 +24,9 @@ A TypeScript library for generating Discord-style visual cards — profiles, wel
24
24
 
25
25
  ## ✨ Features
26
26
 
27
- - 🖼️ Profile, Welcome/Leave, Level Up, Achievement, Leaderboard, Ship (compatibility), Now Playing, and Giveaway cards
27
+ - 🖼️ Profile, Welcome/Leave, Level Up, Achievement, Leaderboard, Ship (compatibility), Now Playing, Giveaway, Birthday, Marriage, Weekly Recap, and Code Snippet cards
28
28
  - 🎵 Now Playing card ships with adapters for moonlink.js, Lavalink-based clients (erela.js, Shoukaku, Kazagumo, Riffy, Magmastream, lavalink-client), discord-player, and distube
29
+ - 💻 Code Snippet card renders syntax-highlighted code screenshots (JavaScript, TypeScript, Python, Java, C#, JSON, Bash, plaintext) in 6 built-in editor themes, without needing a Discord user ID
29
30
  - 🎨 8 built-in themes (`discord`, `midnight`, `sunset`, `neon`, `forest`, `sakura`, `monochrome`, `gold`), Nitro/role-color aware borders, and up to 4-color custom gradients
30
31
  - 🧾 Output as `png`, `jpeg`, or `webp`, ready to use as a discord.js `AttachmentBuilder` via `toAttachment()`
31
32
  - ⚡ Built-in, configurable in-memory cache for fetched user data (`setCacheOptions`, `clearCache`, `getCacheSize`)
@@ -81,17 +82,21 @@ Every other card, the music adapters, theming, caching, error handling, and outp
81
82
 
82
83
  ## 🃏 Cards at a glance
83
84
 
84
- | Card | Function | What it's for |
85
- | ----------- | --------------------------------------------- | ------------------------------------------- |
86
- | Profile | `profileImage(userId, options)` | Avatar, badges, nameplate, server tag, rank |
87
- | Welcome | `welcomeImage(userId, guildName, options)` | Member join events |
88
- | Leave | `leaveImage(userId, guildName, options)` | Member leave events |
89
- | Level Up | `levelUpImage(userId, level, options)` | XP progress bar on level-up |
90
- | Achievement | `achievementImage(userId, title, options)` | Unlockable achievements with rarity tiers |
91
- | Leaderboard | `leaderboardImage(entries, options)` | Server ranking table |
92
- | Ship | `shipImage(leftUserId, rightUserId, options)` | Compatibility between two users |
93
- | Now Playing | `nowPlayingImage(track, options)` | Music player card with source detection |
94
- | Giveaway | `giveawayImage(prize, options)` | Prize, host, entry count, winners on end |
85
+ | Card | Function | What it's for |
86
+ | ------------ | ------------------------------------------------- | --------------------------------------------------------- |
87
+ | Profile | `profileImage(userId, options)` | Avatar, badges, nameplate, server tag, rank |
88
+ | Welcome | `welcomeImage(userId, guildName, options)` | Member join events |
89
+ | Leave | `leaveImage(userId, guildName, options)` | Member leave events |
90
+ | Level Up | `levelUpImage(userId, level, options)` | XP progress bar on level-up |
91
+ | Achievement | `achievementImage(userId, title, options)` | Unlockable achievements with rarity tiers |
92
+ | Leaderboard | `leaderboardImage(entries, options)` | Server ranking table |
93
+ | Ship | `shipImage(leftUserId, rightUserId, options)` | Compatibility between two users |
94
+ | Now Playing | `nowPlayingImage(track, options)` | Music player card with source detection |
95
+ | Giveaway | `giveawayImage(prize, options)` | Prize, host, entry count, winners on end |
96
+ | Birthday | `birthdayImage(userId, options)` | Balloons, confetti, and an optional age/years counter |
97
+ | Marriage | `marriageImage(leftUserId, rightUserId, options)` | Certificate-style card with automatic days-together count |
98
+ | Weekly Recap | `weeklyRecapImage(userId, options)` | Wrapped-style weekly summary with a 7-day activity chart |
99
+ | Code Snippet | `codeSnippetImage(code, options)` | Carbon-style syntax-highlighted code screenshot |
95
100
 
96
101
  ## 🛠️ Utilities
97
102
 
@@ -105,7 +110,7 @@ Every other card, the music adapters, theming, caching, error handling, and outp
105
110
  | `clearCache()` | Clears the internal user-data cache |
106
111
  | `getCacheSize()` | Returns the number of entries currently cached |
107
112
  | `computeCompatibility(leftUserId, rightUserId)` | Deterministic compatibility percentage for the Ship card |
108
- | `pickShipMessage(percentage)` | Flavor text matching a compatibility percentage |
113
+ | `pickShipMessage(leftId, rightId, percentage)` | Flavor text matching a compatibility percentage |
109
114
  | `getThemePalette(theme)` | Resolves a `KiraThemeName` to its full color palette |
110
115
  | `fromMoonlinkTrack(track)` | Adapter: moonlink.js track → `NowPlayingTrack` |
111
116
  | `fromLavalinkTrack(track)` | Adapter: Lavalink-based clients → `NowPlayingTrack` |
@@ -18,7 +18,7 @@ with others.
18
18
 
19
19
  The OFL allows the licensed fonts to be used, studied, modified and
20
20
  redistributed freely as long as they are not sold by themselves. The
21
- fonts, including any derivative works, can be bundled, embedded,
21
+ fonts, including any derivative works, can be bundled, embedded,
22
22
  redistributed and/or sold with any software provided that any reserved
23
23
  names are not used by derivative works. The fonts and derivatives,
24
24
  however, cannot be released under any other type of license. The
@@ -18,7 +18,7 @@ with others.
18
18
 
19
19
  The OFL allows the licensed fonts to be used, studied, modified and
20
20
  redistributed freely as long as they are not sold by themselves. The
21
- fonts, including any derivative works, can be bundled, embedded,
21
+ fonts, including any derivative works, can be bundled, embedded,
22
22
  redistributed and/or sold with any software provided that any reserved
23
23
  names are not used by derivative works. The fonts and derivatives,
24
24
  however, cannot be released under any other type of license. The
@@ -18,7 +18,7 @@ with others.
18
18
 
19
19
  The OFL allows the licensed fonts to be used, studied, modified and
20
20
  redistributed freely as long as they are not sold by themselves. The
21
- fonts, including any derivative works, can be bundled, embedded,
21
+ fonts, including any derivative works, can be bundled, embedded,
22
22
  redistributed and/or sold with any software provided that any reserved
23
23
  names are not used by derivative works. The fonts and derivatives,
24
24
  however, cannot be released under any other type of license. The
@@ -90,4 +90,4 @@ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
90
  INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
91
  DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
92
  FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
- OTHER DEALINGS IN THE FONT SOFTWARE.
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -18,7 +18,7 @@ with others.
18
18
 
19
19
  The OFL allows the licensed fonts to be used, studied, modified and
20
20
  redistributed freely as long as they are not sold by themselves. The
21
- fonts, including any derivative works, can be bundled, embedded,
21
+ fonts, including any derivative works, can be bundled, embedded,
22
22
  redistributed and/or sold with any software provided that any reserved
23
23
  names are not used by derivative works. The fonts and derivatives,
24
24
  however, cannot be released under any other type of license. The