kira-arts 1.4.1 → 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
@@ -2,6 +2,8 @@
2
2
 
3
3
  A TypeScript library for generating Discord-style visual cards — profiles, welcome/leave events, level-ups, achievements, leaderboards, compatibility "ship" cards, now-playing music cards, and giveaways — rendered natively for speed and zero runtime dependencies on a browser or headless Chromium.
4
4
 
5
+ <img src="https://i.imgur.com/AMk4jWr.png" alt="Kira Arts" width="100%">
6
+
5
7
  **📚 Full documentation, live examples, and a Playground: [documentation](https://guide.worddevs.dev/docs/kira-arts)**
6
8
 
7
9
  [![npm version](https://img.shields.io/npm/v/kira-arts.svg)](https://www.npmjs.com/package/kira-arts)
@@ -22,8 +24,9 @@ A TypeScript library for generating Discord-style visual cards — profiles, wel
22
24
 
23
25
  ## ✨ Features
24
26
 
25
- - 🖼️ 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
26
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
27
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
28
31
  - 🧾 Output as `png`, `jpeg`, or `webp`, ready to use as a discord.js `AttachmentBuilder` via `toAttachment()`
29
32
  - ⚡ Built-in, configurable in-memory cache for fetched user data (`setCacheOptions`, `clearCache`, `getCacheSize`)
@@ -79,17 +82,21 @@ Every other card, the music adapters, theming, caching, error handling, and outp
79
82
 
80
83
  ## 🃏 Cards at a glance
81
84
 
82
- | Card | Function | What it's for |
83
- | ----------- | --------------------------------------------- | ------------------------------------------- |
84
- | Profile | `profileImage(userId, options)` | Avatar, badges, nameplate, server tag, rank |
85
- | Welcome | `welcomeImage(userId, guildName, options)` | Member join events |
86
- | Leave | `leaveImage(userId, guildName, options)` | Member leave events |
87
- | Level Up | `levelUpImage(userId, level, options)` | XP progress bar on level-up |
88
- | Achievement | `achievementImage(userId, title, options)` | Unlockable achievements with rarity tiers |
89
- | Leaderboard | `leaderboardImage(entries, options)` | Server ranking table |
90
- | Ship | `shipImage(leftUserId, rightUserId, options)` | Compatibility between two users |
91
- | Now Playing | `nowPlayingImage(track, options)` | Music player card with source detection |
92
- | 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 |
93
100
 
94
101
  ## 🛠️ Utilities
95
102
 
@@ -103,7 +110,7 @@ Every other card, the music adapters, theming, caching, error handling, and outp
103
110
  | `clearCache()` | Clears the internal user-data cache |
104
111
  | `getCacheSize()` | Returns the number of entries currently cached |
105
112
  | `computeCompatibility(leftUserId, rightUserId)` | Deterministic compatibility percentage for the Ship card |
106
- | `pickShipMessage(percentage)` | Flavor text matching a compatibility percentage |
113
+ | `pickShipMessage(leftId, rightId, percentage)` | Flavor text matching a compatibility percentage |
107
114
  | `getThemePalette(theme)` | Resolves a `KiraThemeName` to its full color palette |
108
115
  | `fromMoonlinkTrack(track)` | Adapter: moonlink.js track → `NowPlayingTrack` |
109
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