npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kojiro-image-generation

v1.0.7

Published

kojiro-image-generation is a powerfull module that allow you to generate awesome images.

Downloads

6

Readme

discord-image-generation

A powerfull module that allow you to generate awesome images.

Bugs and glitches

Feel free to report all bugs and glitches by creating an issue in the issue section.

A correct and understandable issue contains :

  • Steps to reproduce
  • Code that summonned the error
  • The complete error

Please join this community server to follow all my projects or if you need help.

Links:

Support Server Community

Amandine Discord Bot Support Server

Download

You can download it from npmjs.

npm i kojiro-image-generation

Configuration

The first step is to import the module in your code.

const KIG = require("kojiro-image-generation");

Then you have to request your image and send it as an attachement.

Discord.js v12

// Import the discord.js library.
const Discord = require("discord.js")
// Create a new discord.js client.
const bot = new Discord.Client()

const DIG = require("discord-image-generation");
> You can also destructure to avoid repeating DIG.

// Listen to the ready event
bot.on("ready", () => {
    console.log("ok");  
})

// Listen to the message event
bot.on("message", async (message) => {
    // Send the image in a simple message
    if (message.content === "*delete") {
        // Get the avatarUrl of the user
        let avatar = message.author.displayAvatarURL({ dynamic: false, format: 'png' });
        // Make the image
        let img = await new DIG.Delete().getImage(avatar)
        // Add the image as an attachement
        let attach = new Discord.MessageAttachment(img, "delete.png");;
        message.channel.send(attach)
    }
    // Send the message with the image attached to an embed
    if (message.content === "*blur") {
        // Get the avatarUrl of the user
        let avatar = message.author.displayAvatarURL({ dynamic: false, format: 'png' });
        // Make the image
        let img = await new DIG.Blur().getImage(avatar)
        // Add the image as an attachement
        let embed = new Discord.MessageEmbed()
            .setTitle("Blur")
            .setImage("attachment://delete.png")
        let attach = new Discord.MessageAttachment(img, "blur.png");;
        message.channel.send({ embed: embed, files: [attach])
    }
})

// Log in to the bot
bot.login("super_secret_token")

Discord.js v13

// Import the discord.js library.
const Discord = require("discord.js")
// Create a new discord.js client.
const bot = new Discord.Client()

const DIG = require("discord-image-generation");
> You can also destructure to avoid repeating DIG.

// Listen to the ready event
bot.on("ready", () => {
    console.log("ok");  
})

// Listen to the message event
bot.on("messageCreate", async (message) => {
    // Send the image in a simple message
    if (message.content === "*delete") {
        // Get the avatarUrl of the user
        let avatar = message.author.displayAvatarURL({ dynamic: false, format: 'png' });
        // Make the image
        let img = await new DIG.Delete().getImage(avatar)
        // Add the image as an attachement
        let attach = new Discord.MessageAttachment(img, "delete.png");;
        message.channel.send({ files: [attach] })
    }
    // Send the message with the image attached to an embed
    if (message.content === "*blur") {
        // Get the avatarUrl of the user
        let avatar = message.author.displayAvatarURL({ dynamic: false, format: 'png' });
        // Make the image
        let img = await new DIG.Blur().getImage(avatar)
        // Add the image as an attachement
        let embed = new Discord.MessageEmbed()
            .setTitle("Blur")
            .setImage("attachment://delete.png")
        let attach = new Discord.MessageAttachment(img, "blur.png");;
        message.channel.send({ embeds: [embed], files: [attach])
    }
})

// Log in to the bot
bot.login("super_secret_token")

Available images

Filters

  • new DIG.Blur().getImage(`<Avatar>`, `<Level(Number)>`);

Blur

  • new DIG.Gay().getImage(`<Avatar>`);

Gay

  • new DIG.Greyscale().getImage(`<Avatar>`);

Greyscale

  • new DIG.Invert().getImage(`<Avatar>`);

Invert

  • new DIG.Sepia().getImage(`<Avatar>`);

Sepia

Gifs

  • new DIG.Blink().getImage(`<Avatar>`, `<Avatar2>`.....);

You can add as many images as you want

Blink

  • new DIG.Triggered().getImage(`<Avatar>`);

Triggered

Montage

  • new DIG.Ad().getImage(`<Avatar>`);

Ad

  • new DIG.Affect().getImage(`<Avatar>`);

Affect

  • new DIG.Batslap().getImage(`<Avatar>`, `<Avatar2>`);

Batslap

  • new DIG.Beautiful().getImage(`<Avatar>`);

Beautiful

  • new DIG.Bed().getImage(`<Avatar>`, `<Avatar2>`);

Bed

  • new DIG.Bobross().getImage(`<Avatar>`);

Bobross

  • new DIG.ConfusedStonk().getImage(`<Avatar>`);

ConfusedStonk

  • new DIG.Delete().getImage(`<Avatar>`);

Delete

  • new DIG.DiscordBlack().getImage(`<Avatar>`)

DiscordBlack

  • new DIG.DiscordBlue().getImage(`<Avatar>`)

DiscordBlue

  • new DIG.DoubleStonk().getImage(`<Avatar`, `<Avatar2>`)

DoubleStonk

  • new DIG.Facepalm().getImage(`<Avatar>`);

Facepalm

  • new DIG.Hitler().getImage(`<Avatar>`);

Hitler

  • new DIG.Jail().getImage(`<Avatar>`);

Jail

  • new DIG.Karaba().getImage(`<Avatar>`);

Karaba

  • new DIG.Kiss().getImage(`<Avatar>`, `<Avatar2>`);

Kiss

  • new DIG.LisaPresentation().getImage(`<Text>`);

LisaPresentation

Limited to 300char

(Thanks to sιмση ℓεcℓεяε#5765)

  • new DIG.Mms().getImage(`<Avatar>`);

MMS

  • new DIG.NotStonk().getImage(`<Avatar>`);

NotStonk

  • new DIG.Podium().getImage(`<Avatar1>, <Avatar2>, <Avatar2>, <Name1>, <Name2>, <Name3>`);

Podium

  • new DIG.Poutine().getImage(`<Avatar>`);

Poutine

  • new DIG.Rip().getImage(`<Avatar>`);

RIP

  • new DIG.Spank().getImage(`<Avatar>`, `<Avatar2>`);

Spank

  • new DIG.Stonk().getImage(`<Avatar>`);

Stonk

  • new DIG.Tatoo().getImage(`<Avatar>`)

Tatoo

  • new DIG.Thomas().getImage(`<Avatar>`);

Thomas

  • new DIG.Trash().getImage(`<Avatar>`);

Trash

  • new DIG.Wanted().getImage(`<Avatar>`, `<Currency>`);

Currency ($, €, ...)

Wanted

Utils

  • new DIG.Circle().getImage(`<Avatar>`);

Circle

  • new DIG.Color().getImage(`<Color>`);

An hex color is needed, like "#FF0000"

Color

Changelog

v1.0.7

  • Added Sofa

v1.0.6

  • Added Choke
  • Added Arrest
  • Added News
  • Added Couple

Credits to Mr-KayJayDee and Alex15#0010