diff --git a/src/base/GreetingsCard.js b/src/base/GreetingsCard.js index 2cd621a7..97aee55d 100644 --- a/src/base/GreetingsCard.js +++ b/src/base/GreetingsCard.js @@ -147,7 +147,7 @@ class Greeting { /** * Builds the image - * @returns {Promise} + * @returns {Promise} */ async toAttachment() { if (!this.avatar) throw new Error("avatar is required"); @@ -228,6 +228,14 @@ class Greeting { return canvas; } + + /** + * Builds the image + * @returns {Promise} + */ + async build() { + return (await this.toAttachment()).encode("png"); + } }; module.exports = Greeting; \ No newline at end of file diff --git a/typings/src/Leaver.d.ts b/typings/src/Leaver.d.ts index 7c3e6790..4b9c3caa 100644 --- a/typings/src/Leaver.d.ts +++ b/typings/src/Leaver.d.ts @@ -35,11 +35,6 @@ declare class Leaver extends Base { * @returns {Leaver} */ setMemberCount(memberCount?: number | string): Leaver; - /** - * Builds welcome image - * @returns {Promise} - */ - build(): Promise; } import Base = require("./base/GreetingsCard"); //# sourceMappingURL=Leaver.d.ts.map \ No newline at end of file diff --git a/typings/src/Leaver.d.ts.map b/typings/src/Leaver.d.ts.map index 02870eb8..60bf04f1 100644 --- a/typings/src/Leaver.d.ts.map +++ b/typings/src/Leaver.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Leaver.d.ts","sourceRoot":"","sources":["../../src/Leaver.js"],"names":[],"mappings":";AAGA;IAmBQ;;;OAGG;IACH,WAFU,MAAM,CAEU;IAE1B;;;OAGG;IACH,aAFU,MAAM,CAEsB;IAEtC;;;OAGG;IACH,YAFU,MAAM,CAEW;IAM/B;;;;;OAKG;IACH,qBAYC;IAED;;;;;OAKG;IACH,aAJW,OAAO,GAAC,cAAc,GAAC,QAAQ,GAAC,UAAU,GAAC,cAAc,GAAC,SAAS,GAAC,eAAe,GAAC,mBAAmB,GAAC,SAAS,GAAC,aAAa,GAAC,cAAc,GAAC,YAAY,GAAC,QAAQ,SACpK,MAAM,GACJ,MAAM,CAKlB;IAED;;;;OAIG;IACH,6BAHW,MAAM,GAAC,MAAM,GACX,MAAM,CAKlB;IAED;;;OAGG;IACH,SAFa,QAAQ,MAAM,CAAC,CAI3B;CAEJ"} \ No newline at end of file +{"version":3,"file":"Leaver.d.ts","sourceRoot":"","sources":["../../src/Leaver.js"],"names":[],"mappings":";AAGA;IAmBQ;;;OAGG;IACH,WAFU,MAAM,CAEU;IAE1B;;;OAGG;IACH,aAFU,MAAM,CAEsB;IAEtC;;;OAGG;IACH,YAFU,MAAM,CAEW;IAM/B;;;;;OAKG;IACH,qBAYC;IAED;;;;;OAKG;IACH,aAJW,OAAO,GAAC,cAAc,GAAC,QAAQ,GAAC,UAAU,GAAC,cAAc,GAAC,SAAS,GAAC,eAAe,GAAC,mBAAmB,GAAC,SAAS,GAAC,aAAa,GAAC,cAAc,GAAC,YAAY,GAAC,QAAQ,SACpK,MAAM,GACJ,MAAM,CAKlB;IAED;;;;OAIG;IACH,6BAHW,MAAM,GAAC,MAAM,GACX,MAAM,CAKlB;CAUJ"} \ No newline at end of file diff --git a/typings/src/Welcomer.d.ts b/typings/src/Welcomer.d.ts index 07b0613f..dcdd2e8e 100644 --- a/typings/src/Welcomer.d.ts +++ b/typings/src/Welcomer.d.ts @@ -34,11 +34,6 @@ declare class Welcomer extends Base { * @returns {Welcomer} */ setMemberCount(memberCount?: number | string): Welcomer; - /** - * Builds welcome image - * @returns {Promise} - */ - build(): Promise; } import Base = require("./base/GreetingsCard"); //# sourceMappingURL=Welcomer.d.ts.map \ No newline at end of file diff --git a/typings/src/Welcomer.d.ts.map b/typings/src/Welcomer.d.ts.map index f493096a..8b74554b 100644 --- a/typings/src/Welcomer.d.ts.map +++ b/typings/src/Welcomer.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Welcomer.d.ts","sourceRoot":"","sources":["../../src/Welcomer.js"],"names":[],"mappings":";AAGA;IAmBQ;;;OAGG;IACH,WAFU,MAAM,CAEU;IAE1B;;;OAGG;IACH,aAFU,MAAM,CAEwB;IAExC;;;OAGG;IACH,YAFU,MAAM,CAEW;IAM/B;;;;OAIG;IACH,qBAYC;IAED;;;;;OAKG;IACH,aAJW,OAAO,GAAC,cAAc,GAAC,QAAQ,GAAC,UAAU,GAAC,cAAc,GAAC,SAAS,GAAC,eAAe,GAAC,mBAAmB,GAAC,SAAS,GAAC,aAAa,GAAC,cAAc,GAAC,YAAY,GAAC,QAAQ,SACpK,MAAM,GACJ,QAAQ,CAKpB;IAED;;;;OAIG;IACH,6BAHW,MAAM,GAAC,MAAM,GACX,QAAQ,CAKpB;IAED;;;OAGG;IACH,SAFa,QAAQ,MAAM,CAAC,CAI3B;CAEJ"} \ No newline at end of file +{"version":3,"file":"Welcomer.d.ts","sourceRoot":"","sources":["../../src/Welcomer.js"],"names":[],"mappings":";AAGA;IAmBQ;;;OAGG;IACH,WAFU,MAAM,CAEU;IAE1B;;;OAGG;IACH,aAFU,MAAM,CAEwB;IAExC;;;OAGG;IACH,YAFU,MAAM,CAEW;IAM/B;;;;OAIG;IACH,qBAYC;IAED;;;;;OAKG;IACH,aAJW,OAAO,GAAC,cAAc,GAAC,QAAQ,GAAC,UAAU,GAAC,cAAc,GAAC,SAAS,GAAC,eAAe,GAAC,mBAAmB,GAAC,SAAS,GAAC,aAAa,GAAC,cAAc,GAAC,YAAY,GAAC,QAAQ,SACpK,MAAM,GACJ,QAAQ,CAKpB;IAED;;;;OAIG;IACH,6BAHW,MAAM,GAAC,MAAM,GACX,QAAQ,CAKpB;CAUJ"} \ No newline at end of file diff --git a/typings/src/base/GreetingsCard.d.ts b/typings/src/base/GreetingsCard.d.ts index 31b09656..2f2a82bc 100644 --- a/typings/src/base/GreetingsCard.d.ts +++ b/typings/src/base/GreetingsCard.d.ts @@ -77,10 +77,16 @@ declare class Greeting { * @returns {Greeting} */ setOpacity(variable: string, value: number): Greeting; + /** + * Builds the image + * @returns {Promise} + */ + toAttachment(): Promise; /** * Builds the image * @returns {Promise} */ - toAttachment(): Promise; + build(): Promise; } +import Canvas = require("@napi-rs/canvas"); //# sourceMappingURL=GreetingsCard.d.ts.map \ No newline at end of file diff --git a/typings/src/base/GreetingsCard.d.ts.map b/typings/src/base/GreetingsCard.d.ts.map index 7a316f4d..b2629a2b 100644 --- a/typings/src/base/GreetingsCard.d.ts.map +++ b/typings/src/base/GreetingsCard.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"GreetingsCard.d.ts","sourceRoot":"","sources":["../../../src/base/GreetingsCard.js"],"names":[],"mappings":";AAuBA;IAMQ,iBAAuB;IACvB,kBAA6B;IAC7B,yBAAiC;IACjC,yBAAiC;IACjC,wBAA6C;IAC7C,oBAAoB;IACpB,wBAAiC;IACjC,wBAAkB;IAClB,sBAAwB;IACxB,oBAA4B;IAC5B,sBAA8B;IAC9B,yBAAiC;IACjC,2BAA6B;IAC7B,sBAA2B;IAC3B,2BAAmC;IACnC,gCAAkC;IAClC,8BAAsC;IACtC,qBAA6B;IAC7B,qBAA6B;IAC7B,wBAAgC;IAGpC;;;;OAIG;IACH,iBAHW,MAAM,GAAC,MAAM,GACX,QAAQ,CAKpB;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACJ,QAAQ,CAKpB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,QAAQ,CAKpB;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,QAAQ,CAKpB;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACJ,QAAQ,CAKpB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GAAC,MAAM,GACX,QAAQ,CAKpB;IAED;;;;;OAKG;IACH,mBAJW,MAAM,SACN,MAAM,GACJ,QAAQ,CAMpB;IAED;;;;;OAKG;IACH,kBAJW,MAAM,SACN,MAAM,GACJ,QAAQ,CAMpB;IAED;;;;;OAKG;IACH,qBAJW,MAAM,SACN,MAAM,GACJ,QAAQ,CAMpB;IAED;;;OAGG;IACH,gBAFa,QAAQ,MAAM,CAAC,CAgF3B;CACJ"} \ No newline at end of file +{"version":3,"file":"GreetingsCard.d.ts","sourceRoot":"","sources":["../../../src/base/GreetingsCard.js"],"names":[],"mappings":";AAuBA;IAMQ,iBAAuB;IACvB,kBAA6B;IAC7B,yBAAiC;IACjC,yBAAiC;IACjC,wBAA6C;IAC7C,oBAAoB;IACpB,wBAAiC;IACjC,wBAAkB;IAClB,sBAAwB;IACxB,oBAA4B;IAC5B,sBAA8B;IAC9B,yBAAiC;IACjC,2BAA6B;IAC7B,sBAA2B;IAC3B,2BAAmC;IACnC,gCAAkC;IAClC,8BAAsC;IACtC,qBAA6B;IAC7B,qBAA6B;IAC7B,wBAAgC;IAGpC;;;;OAIG;IACH,iBAHW,MAAM,GAAC,MAAM,GACX,QAAQ,CAKpB;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACJ,QAAQ,CAKpB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,QAAQ,CAKpB;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,QAAQ,CAKpB;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACJ,QAAQ,CAKpB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GAAC,MAAM,GACX,QAAQ,CAKpB;IAED;;;;;OAKG;IACH,mBAJW,MAAM,SACN,MAAM,GACJ,QAAQ,CAMpB;IAED;;;;;OAKG;IACH,kBAJW,MAAM,SACN,MAAM,GACJ,QAAQ,CAMpB;IAED;;;;;OAKG;IACH,qBAJW,MAAM,SACN,MAAM,GACJ,QAAQ,CAMpB;IAED;;;OAGG;IACH,gBAFa,QAAQ,aAAa,CAAC,CAgFlC;IAED;;;OAGG;IACH,SAFa,QAAQ,MAAM,CAAC,CAI3B;CACJ"} \ No newline at end of file