mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-04 07:46:43 +02:00
TONS of new image editing commands
This commit is contained in:
@@ -243,7 +243,7 @@ in the appropriate channel's topic to use it.
|
||||
|
||||
## Commands
|
||||
|
||||
Total: 515
|
||||
Total: 520
|
||||
|
||||
### Utility:
|
||||
|
||||
@@ -592,6 +592,7 @@ Total: 515
|
||||
* **desaturate:** Draws an image or a user's avatar but desaturated.
|
||||
* **dexter:** Draws an image or a user's avatar over the screen of Dexter from Pokémon.
|
||||
* **distort:** Draws an image or a user's avatar but distorted.
|
||||
* **emboss:** Draws an image or a user's avatar but embossed.
|
||||
* **fire-frame:** Draws a fiery border over an image or a user's avatar.
|
||||
* **fish-eye:** Draws an image or a user's avatar but with a fish-eye lens.
|
||||
* **frame:** Draws a frame around an image or a user's avatar.
|
||||
@@ -604,13 +605,16 @@ Total: 515
|
||||
* **highway-sign:** Sends a highway sign sign with the text of your choice.
|
||||
* **hollywood-star:** Sends a Hollywood Walk of Fame star with the name of your choice.
|
||||
* **ifunny:** Draws an image with the iFunny logo.
|
||||
* **implode:** Draws an image or a user's avatar but imploded.
|
||||
* **invert:** Draws an image or a user's avatar but inverted.
|
||||
* **jeopardy-question:** Sends a Jeopardy Question with the text of your choice.
|
||||
* **magik:** Draws an image or a user's avatar but with liquid rescale from ImageMagick.
|
||||
* **liquid-rescale:** Draws an image or a user's avatar but with liquid rescale from ImageMagick.
|
||||
* **minecraft-skin:** Sends the Minecraft skin for a user.
|
||||
* **mirror:** Draws an image or a user's avatar but mirrored on the X/Y axis (or both).
|
||||
* **needs-more-jpeg:** Draws an image or a user's avatar as a low quality JPEG.
|
||||
* **newspaper:** Creates a fake newspaper with the headline and body of your choice.
|
||||
* **noise:** Draws an image or a user's avatar but with noise.
|
||||
* **oil-painting:** Draws an image or a user's avatar but with oil paints.
|
||||
* **pixelize:** Draws an image or a user's avatar pixelized.
|
||||
* **pokemon-fusion:** Fuses two Generation I Pokémon together.
|
||||
* **police-tape:** Draws police tape over an image or a user's avatar.
|
||||
@@ -629,6 +633,7 @@ Total: 515
|
||||
* **square:** Draws an image or a user's avatar as a square.
|
||||
* **squish:** Draws an image or a user's avatar but squished across the X or Y axis.
|
||||
* **subtitle:** Adds subtitles to an image.
|
||||
* **swirl:** Draws an image or a user's avatar but swirled.
|
||||
* **tint:** Draws an image or a user's avatar but tinted a specific color.
|
||||
* **tweet:** Sends a Twitter tweet with the user and text of your choice.
|
||||
* **undertale:** Sends a text box from Undertale with the quote and character of your choice.
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const gm = require('gm').subClass({ imageMagick: true });
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class EmbossCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'emboss',
|
||||
group: 'edit-image',
|
||||
memberName: 'emboss',
|
||||
description: 'Draws an image or a user\'s avatar but embossed.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 60
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'image',
|
||||
prompt: 'What image would you like to edit?',
|
||||
type: 'image',
|
||||
default: msg => msg.author.displayAvatarURL({ format: 'png', size: 512 })
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { image }) {
|
||||
try {
|
||||
const { body } = await request.get(image);
|
||||
const magik = gm(body);
|
||||
magik.emboss();
|
||||
magik.setFormat('png');
|
||||
const attachment = await this.toBuffer(magik);
|
||||
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
|
||||
return msg.say({ files: [{ attachment, name: 'emboss.png' }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
|
||||
toBuffer(magik) {
|
||||
return new Promise((res, rej) => {
|
||||
magik.toBuffer((err, buffer) => {
|
||||
if (err) return rej(err);
|
||||
return res(buffer);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,57 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const gm = require('gm').subClass({ imageMagick: true });
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class ImplodeCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'implode',
|
||||
group: 'edit-image',
|
||||
memberName: 'implode',
|
||||
description: 'Draws an image or a user\'s avatar but imploded.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 60
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'level',
|
||||
prompt: 'What level would you like to use? From 1-100.',
|
||||
type: 'integer',
|
||||
min: 1,
|
||||
max: 100
|
||||
},
|
||||
{
|
||||
key: 'image',
|
||||
prompt: 'What image would you like to edit?',
|
||||
type: 'image',
|
||||
default: msg => msg.author.displayAvatarURL({ format: 'png', size: 512 })
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { level, image }) {
|
||||
try {
|
||||
const { body } = await request.get(image);
|
||||
const magik = gm(body);
|
||||
magik.implode(level / 100);
|
||||
magik.setFormat('png');
|
||||
const attachment = await this.toBuffer(magik);
|
||||
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
|
||||
return msg.say({ files: [{ attachment, name: 'implode.png' }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
|
||||
toBuffer(magik) {
|
||||
return new Promise((res, rej) => {
|
||||
magik.toBuffer((err, buffer) => {
|
||||
if (err) return rej(err);
|
||||
return res(buffer);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -2,13 +2,13 @@ const Command = require('../../structures/Command');
|
||||
const gm = require('gm').subClass({ imageMagick: true });
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class MagikCommand extends Command {
|
||||
module.exports = class LiquidRescaleCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'magik',
|
||||
aliases: ['magick', 'liquid-rescale'],
|
||||
name: 'liquid-rescale',
|
||||
aliases: ['magick', 'magik'],
|
||||
group: 'edit-image',
|
||||
memberName: 'magik',
|
||||
memberName: 'liquid-rescale',
|
||||
description: 'Draws an image or a user\'s avatar but with liquid rescale from ImageMagick.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
@@ -36,7 +36,7 @@ module.exports = class MagikCommand extends Command {
|
||||
magik.setFormat('png');
|
||||
const attachment = await this.toBuffer(magik);
|
||||
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
|
||||
return msg.say({ files: [{ attachment, name: 'magik.png' }] });
|
||||
return msg.say({ files: [{ attachment, name: 'liquid-rescale.png' }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const gm = require('gm').subClass({ imageMagick: true });
|
||||
const request = require('node-superfetch');
|
||||
const { list } = require('../../util/Util');
|
||||
const types = ['uniform', 'gaussian', 'multiplicative', 'impulse', 'laplacian', 'poisson'];
|
||||
|
||||
module.exports = class NoiseCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'noise',
|
||||
group: 'edit-image',
|
||||
memberName: 'noise',
|
||||
description: 'Draws an image or a user\'s avatar but with noise.',
|
||||
details: `**Types:** ${types.join(', ')}`,
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 60
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'type',
|
||||
prompt: `What type of noise would you like to add? Either ${list(types, 'or')}.`,
|
||||
type: 'string',
|
||||
oneOf: types,
|
||||
default: 'poisson'
|
||||
},
|
||||
{
|
||||
key: 'image',
|
||||
prompt: 'What image would you like to edit?',
|
||||
type: 'image',
|
||||
default: msg => msg.author.displayAvatarURL({ format: 'png', size: 512 })
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { type, image }) {
|
||||
try {
|
||||
const { body } = await request.get(image);
|
||||
const magik = gm(body);
|
||||
magik.noise(type);
|
||||
magik.setFormat('png');
|
||||
const attachment = await this.toBuffer(magik);
|
||||
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
|
||||
return msg.say({ files: [{ attachment, name: 'noise.png' }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
|
||||
toBuffer(magik) {
|
||||
return new Promise((res, rej) => {
|
||||
magik.toBuffer((err, buffer) => {
|
||||
if (err) return rej(err);
|
||||
return res(buffer);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,51 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const gm = require('gm').subClass({ imageMagick: true });
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class OilPaintingCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'oil-painting',
|
||||
aliases: ['oil', 'paint', 'painting'],
|
||||
group: 'edit-image',
|
||||
memberName: 'noise',
|
||||
description: 'Draws an image or a user\'s avatar but with oil paints.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 60
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'image',
|
||||
prompt: 'What image would you like to edit?',
|
||||
type: 'image',
|
||||
default: msg => msg.author.displayAvatarURL({ format: 'png', size: 512 })
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { image }) {
|
||||
try {
|
||||
const { body } = await request.get(image);
|
||||
const magik = gm(body);
|
||||
magik.paint(5);
|
||||
magik.setFormat('png');
|
||||
const attachment = await this.toBuffer(magik);
|
||||
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
|
||||
return msg.say({ files: [{ attachment, name: 'old-painting.png' }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
|
||||
toBuffer(magik) {
|
||||
return new Promise((res, rej) => {
|
||||
magik.toBuffer((err, buffer) => {
|
||||
if (err) return rej(err);
|
||||
return res(buffer);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,57 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const gm = require('gm').subClass({ imageMagick: true });
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class SwirlCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'swirl',
|
||||
group: 'edit-image',
|
||||
memberName: 'swirl',
|
||||
description: 'Draws an image or a user\'s avatar but swirled.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 60
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'degrees',
|
||||
prompt: 'What degrees would you like to use? From 1-360.',
|
||||
type: 'integer',
|
||||
min: 1,
|
||||
max: 360
|
||||
},
|
||||
{
|
||||
key: 'image',
|
||||
prompt: 'What image would you like to edit?',
|
||||
type: 'image',
|
||||
default: msg => msg.author.displayAvatarURL({ format: 'png', size: 512 })
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { degrees, image }) {
|
||||
try {
|
||||
const { body } = await request.get(image);
|
||||
const magik = gm(body);
|
||||
magik.swirl(degrees);
|
||||
magik.setFormat('png');
|
||||
const attachment = await this.toBuffer(magik);
|
||||
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
|
||||
return msg.say({ files: [{ attachment, name: 'swirl.png' }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
|
||||
toBuffer(magik) {
|
||||
return new Promise((res, rej) => {
|
||||
magik.toBuffer((err, buffer) => {
|
||||
if (err) return rej(err);
|
||||
return res(buffer);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "119.3.1",
|
||||
"version": "119.4.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user