GithubHelp home page GithubHelp logo

weeb.js's Introduction

NPM info

A wrapper for https://weeb.sh/
Replace all instances of "super secret token" with your actual token if you are using a WolkeToken place it as Wolke <token> and if a BearerToken place it as Brearer <token> everything else will throw an error.

Note:

If you have never spoken with a Weeb.sh Developer and they told you, you have access to an Image-generation then you cannot use any of the Generation methods (they will error with missing Scope). If you have access to one that does not mean you have access to all. The scopes needed are in the comments and brackets on the example.

Official Documentation

Click Me!
Please note that Settings & Reputation are not supported as of now, they will be supported as part of the major refactor in v2

Get Random Images

const weeb = require("weeb.js");

const sh = new weeb("super secret token", "Weeb.js Example/v1.6.1");
                                            //User Agent (Optional)

sh.getRandom({type: "awoo", nsfw: false, filetype: "gif"}).then(object => {
    console.log(object)
    // Example Object
    /*
     {
        "id": "BJZfMrXwb",
        "type": "awoo",
        "baseType": "awoo",
        "nsfw": false,
        "fileType": "gif",
        "mimeType": "image/gif",
        "tags": [],
        "url": "https://cdn.weeb.sh/images/BJZfMrXwb.gif",
        "hidden": false,
        "account": "HyxjFGfPb"
    }
    */
});

Get all available Types

const weeb = require("weeb.js");

const sh = new weeb("super secret token", "Weeb.js Example/v1.6.1");
                                            //User Agent (Optional)
sh.getTypes().then(array => {
    console.log(array)
});

Get all available Tags

const weeb = require("weeb.js");

const sh = new weeb("super secret token", "Weeb.js Example/v1.6.1");
                                            //User Agent (Optional)
sh.getTags().then(array => {
    console.log(array)
});

Generate an Image (Requires Simple Image Gen Scope)

const weeb = require("weeb.js");

const sh = new weeb("super secret token", "Weeb.js Example/v1.6.1");
                                            //User Agent (Optional)
//Requires you to have the Simple Image Gen Scope
//Type can be won, awooo or eyes (Awooo supports hair and face as options which needs to be a hex code)

sh.generateImage("won").then(buffer => {
    console.log(buffer)
});

Generate a Discord Status Mock (Requires Simple Image Gen Scope)

const weeb = require("weeb.js");

const sh = new weeb("super secret token", "Weeb.js Example/v1.6.1");
                                            //User Agent (Optional)
//Requires you to have the Simple Image Gen Scope
//Status (first argument) can be "online", "dnd", "idle", "offline" or "streaming"

sh.generateDiscordMock("online", "https://cdn.discordapp.com/avatars/132584525296435200/8c7423df35ef1258db65451a011d63ca.png").then(buffer => {
    console.log(buffer)
});

Generate a License (Requires License Scope)

const weeb = require("weeb.js");

const sh = new weeb("super secret token", "Weeb.js Example/v1.6.1");
                                            //User Agent (Optional)

const options = {
    title: "test",
    avatar: "https://cdn.discordapp.com/avatars/132584525296435200/a9f823c7a39a53f562fe8dcb6edf4607.webp",
    badges: ["https://cdn.discordapp.com/avatars/267207628965281792/e13af85a8abbd8fd2a5ec76d3ca2fbd6.webp"],
    widgets: ["Hi", "bye", "kek"]
};

//Requires you to have the License Scope
sh.generateLicense(options).then(buffer => {
    console.log(buffer)
});

Generate a Waifu Insult Image (Requires Waifu Image Gen Scope)

const weeb = require("weeb.js");
const sh = new weeb("super secret token", "Weeb.js Example/v1.6.1");
                                            //User Agent (Optional)

const url = "https://cdn.discordapp.com/avatars/132584525296435200/3a0631c5d4df2a5e8795547964bd1027.webp";
//Requires you to have the Waifu Image Gen Scope
sh.generateInsult(url).then(buffer => {
    console.log(buffer)
});

Generate a Love-Ship Image (Requires Love-Ship Scope)

const weeb = require("weeb.js");

const sh = new weeb("super secret token", "Weeb.js Example/v1.6.1");
                                            //User Agent (Optional)

const targetOne = "https://cdn.discordapp.com/avatars/185476724627210241/615ee9f0e97aab7fa0725165531df3a7.webp?size=256";
const targetTwo = "https://cdn.discordapp.com/avatars/388799526103941121/b5acd5dd89aa8ff7c3600f2b7edaff57.webp?size=256";
//Requires you to have the Waifu Image Gen Scope
sh.generateLoveShip(targetOne, targetTwo).then(buffer => {
    console.log(buffer)
});

DO NOT COPY PASTE THESE AND EXPECT THEM TO WORK

Sometimes I used images in these examples that no longer exist, causing these examples to not always work. Please test it with working URL's and double check that you have said scopes before opening an issue or contacting me. Thanks.

weeb.js's People

Contributors

mrlar avatar natanbc avatar

Stargazers

Kostiz avatar Luan AP avatar yuna0x0 (edisonlee55) avatar

Watchers

 avatar

Forkers

luan0ap yuujet

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.