Methods
(async) createCard(charaId) → {Promise.<Buffer>}
Creates a character card for a character.
Parameters:
Name | Type | Description |
---|---|---|
charaId |
number | string | The Lodestone ID of the character to generate a card for. |
- Source:
Returns:
A promise representating the construction of the card's image data.
- Type
- Promise.<Buffer>
Example
const fs = require("fs");
const card = new CardCreator();
const lodestoneId = "13821878";
await card.ensureInit();
const png = await card.createCard(lodestoneId);
fs.writeFile("./test.png", png, err => {
if (err) console.error(err);
});
(async) ensureInit() → {Promise}
Ensures that the instance is ready to generate character cards.
This function must be resolved before using character card
generation methods.
- Source:
Returns:
A promise representing the initialization state of this generator.
- Type
- Promise