1.5.0 • Published 4 years ago

discord-image v1.5.0

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
4 years ago

discord-image

forthebadge forthebadge Support Server

NPM

An image generation wrapper for Discord or any kind!

Installing

npm install discord-image

Examples

  • Discord.js example (v12)
// import the dependencies
const Discord = require('discord.js');
const { ImageGen, TextGen } = require('discord-image');

const Text = new TextGen();
const Image = new ImageGen();
const client = new Discord.Client();

// message event
client.on('message', async message => {
	if (message.content.startsWith('!cat')) {
		const cat = await Image.cat();
		message.channel.send(cat);
	} else if (message.content.startsWith('!fact')) {
		const fact = await Text.fact();
		message.channel.send(fact);
	} else if (message.content.startsWith('!clyde')) {
		// replace content with the message you want to clydify
		const clyde = await Image.clyde(content);
		message.channel.send(clyde);
	}
});

// login to the discord
client.login('your_token_goes_here');
  • CommonJS example
async function cat() {
	const image = await Image.cat();
	console.log(image);
}

cat();

Available Endpoints

  • cat
  • dog
  • fact
  • clyde
  • bird
1.5.0

4 years ago

1.4.7

4 years ago

1.4.6

4 years ago

1.4.5

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago