Releases: Advanced-Command-Handler/Discord.js-Better-Embed
1.4.0
📆 30.09.2024
🏷️ 1.4.0
💾 B17BFCC
🚀 1
✏️ 3
👥 1
New release a few years after the previous one because I needed it, it's now using Discord.js v14.
🚀 New Features
✏️ Chores
7F77973
chore(prettier): Update prettier, move config to.prettierrc
. (@Ayfri)B17BFCC
chore(tsconfig): Update tsconfig. (@Ayfri)06399F4
chore(version): Increase version to 1.4.0, update documentation. (@Ayfri)
👥 Contributors
v1.3.0
This is a small update on the surface but that hugelly improve the typings.
Now templates can have a values
field the defines the values they are waiting, this will allow you to have autocompletion for the values
argument, but because of Typescript behaviors you have to cast the template for a custom template and it cannot work if you use the name.
Example :
import {BetterEmbed, templates} from 'discord.js-better-embed';
import type {Template} from 'discords.js-better-embed';
// Create your template, you could also set the fields of the Template but it's not used anywhere so no need for that
type MyTemplate = Template<{text: string, bar: string}>
// Add the property to the 'templates' object
interface templates {
myTemplate: MyTemplate
}
// Setup the template
templates.myTemplate = {
description: 'Hi ${bar} ! You have ${text.length} bits.'
}
// create your embed
// if you use the name it cannot be casted
const embed = BetterEmbed.fromTemplate(templates.myTemplate as MyTemplate, {text: 'foo', bar: 'baz' });
// but you can do this
const embed = BetterEmbed.fromTemplate<'myTemplate', MyTemplate['values']>('myTemplate', {text: 'foo', bar: 'baz' });
// you can also use it like this :
const embed = BetterEmbed.fromTemplate(templates.myTemplate as templates['myTemplate'], {text: 'foo', bar: 'baz' });
// as it will use the interface types
Thanks to the people using this library !
📆 09.08.2021
🏷️ 1.3.0
💾 C52F54D
🚀 1
📚 1
✏️ 1
👥 1
🚀 New Features
📚 Documentation
✏️ Chores
👥 Contributors
v1.2.1
v1.2.0
This release refactors a lot of methods, there are some breaking changes so be careful when upgrading.
Changelog
- feat: Add badges. (c823e28)
- feat: Add documentation link. (addc8f7)
- feat: Add keywords in
package.json
. (740c9df) - feat: Add
setImageFromFile
&setThumbnailFromFile
. (b0cbbd3) - feat: Add static limits & templates properties. (0a120ab)
- feat: Add
throwIfTooLong
method. (a7e396d) - feat: Improve typings of Templates. (72b220d) (c88a947)
- feat: Rename old
checkSize
tothrowIfTooLong
,checkSize
now return boolean, and you can select field with an argument. (82214a1) - refactor: Ignore
package-lock.json
. (97d93bb) - refactor: Improve exports. (fb9d9b4)
- refactor: Improve types. (0f27a2e)
- style: Improve
prettier
script file selection. (d343558)
Dependencies
[email protected]
[email protected]
@types/[email protected]
v1.1.0
This release is here to improve error messages.
Changelog
Added actual length to error messages. (d8bb76f)
Added apostrophes to error messages for readability. (a64e71a)
Fixed error message for having too much fields. (8554313)
Fixed duplicate error for embed.title
. (27a9516)
Updated typescript to @4.1.3
. (6f985d4)
v1.0.4
v1.0.3
v1.0.2
v1.0.1
v1.0.0
First Release!
I've used this class in other projects (like Advanced-Command-Handler) but I think that making a repo only for this can be a great thing!
Documentation will eventually come later :)