1.1.0 • Published 3 years ago

@ibaraki-douji/giffy-weeb v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Giffy Weeb

Access to a lot of GIFs

Getting started

npm i @ibaraki-douji/giffy-weeb --save

Usage

To have an access to this API join the Discord and ask the Owner !

Create the Client

const GiffyWeeb = require('@ibaraki-douji/api').GiffyWeeb

const giffy = new GiffyWeeb("YOUR TOKEN");

Replace YOUR TOKEN by your giffy token

List all tags

const giffy = new GiffyWeeb("YOU TOKEN");

giffy.getTags().then(console.log);

Get Random Image from Tag

const giffy = new GiffyWeeb("YOU TOKEN");

giffy.getRandomImage({
    name: "cry"
})

OR

const giffy = new GiffyWeeb("YOU TOKEN");

giffy.getTags().then(tags => {
    giffy.getRandomImage(tags[0]).then(console.log)
});

Get infos from Image

const giffy = new GiffyWeeb("YOU TOKEN");

giffy.getImageInfo("ID").then(console.log);

Replace ID by the image ID

Download Image

const fs = require('fs');
const giffy = new GiffyWeeb("YOU TOKEN");

giffy.getImage("ID").then(buffer => {
    fs.writeFileSync("./image.gif", buffer);
});

Replace ID by the image ID

Exemple

const GiffyWeeb = require('@ibaraki-douji/api').GiffyWeeb

(async () => {
    const giffy = new GiffyWeeb("YOU TOKEN");
    console.log(await giffy.getTags());
    console.log(await giffy.getRandomImage({
        name: "cry"
    }))
})()

This print all Tags and then print the Image object with the ID inside.

More Help and Support

Discord : https://discord.gg/mD9c4zP4Er