diff --git a/README.md b/README.md index 5231069..6c2c613 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,7 @@ bot.login("super_secret_token") ## Gifs -- ``new DIG.Blink().getImage(``, ``.....);`` +- ``new DIG.Blink().getImage(delay (in ms), ``, ``.....);`` > You can add as many images as you want diff --git a/package.json b/package.json index 2dfa6a6..37ba491 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord-image-generation", - "version": "1.4.14", + "version": "1.4.15", "description": "discord-image-generation is a powerful module that allow you to generate awesome images.", "main": "src/index.js", "types": "typings/index.d.ts", diff --git a/src/module/gif/blink.js b/src/module/gif/blink.js index c54abcc..140fa64 100644 --- a/src/module/gif/blink.js +++ b/src/module/gif/blink.js @@ -2,14 +2,13 @@ const Canvas = require(`canvas`); const GIFEncoder = require(`gifencoder`); module.exports = class Blink { - - async getImage( ...images) { + async getImage(delay, ...images) { if (!images || images.length < 2) throw new Error(`You must provide at least two images.`); const GIF = new GIFEncoder(480, 480); GIF.start(); GIF.setRepeat(0); - GIF.setDelay(1000); + GIF.setDelay(delay); GIF.setTransparent(); const canvas = Canvas.createCanvas(480, 480); @@ -25,4 +24,4 @@ module.exports = class Blink { GIF.finish(); return GIF.out.getData(); } -}; +}; \ No newline at end of file