fixed commands
This commit is contained in:
parent
7e3375f6f2
commit
dbcd5ec33a
6 changed files with 10 additions and 27 deletions
|
@ -1,5 +1,4 @@
|
||||||
const { Command } = require('discord-akairo');
|
const { Command } = require('discord-akairo');
|
||||||
const Discord = require('discord.js');
|
|
||||||
const { createCanvas, loadImage } = require('canvas');
|
const { createCanvas, loadImage } = require('canvas');
|
||||||
const superagent = require('superagent');
|
const superagent = require('superagent');
|
||||||
|
|
||||||
|
@ -11,7 +10,8 @@ class FetishCommand extends Command {
|
||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
id: 'image',
|
id: 'image',
|
||||||
type: 'string'
|
type: 'string',
|
||||||
|
optional: true,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
@ -40,10 +40,8 @@ class FetishCommand extends Command {
|
||||||
const bg = await loadImage(buffer);
|
const bg = await loadImage(buffer);
|
||||||
ctx.drawImage(bg, 50, 50, 450, 450);
|
ctx.drawImage(bg, 50, 50, 450, 450);
|
||||||
|
|
||||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'myfetish.png');
|
|
||||||
|
|
||||||
|
message.channel.send({files: [canvas.toBuffer()]}).catch(() => {
|
||||||
message.channel.send(attachment).catch(() => {
|
|
||||||
message.channel.send('an error as occured. Check the bot/channel permissions');
|
message.channel.send('an error as occured. Check the bot/channel permissions');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
const { Command } = require('discord-akairo');
|
const { Command } = require('discord-akairo');
|
||||||
const Discord = require('discord.js');
|
|
||||||
const { createCanvas, loadImage } = require('canvas');
|
const { createCanvas, loadImage } = require('canvas');
|
||||||
const superagent = require('superagent');
|
const superagent = require('superagent');
|
||||||
|
|
||||||
|
@ -41,11 +40,8 @@ class GodCommand extends Command {
|
||||||
const bg = await loadImage(buffer);
|
const bg = await loadImage(buffer);
|
||||||
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
|
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
|
||||||
|
|
||||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'god.png');
|
|
||||||
|
|
||||||
message.delete();
|
message.delete();
|
||||||
message.channel.send(attachment)
|
message.channel.send({files: [canvas.toBuffer()]}).catch(() => {
|
||||||
.catch(() => {
|
|
||||||
message.channel.send('an error as occured. Check the bot/channel permissions');
|
message.channel.send('an error as occured. Check the bot/channel permissions');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
const { Command } = require('discord-akairo');
|
const { Command } = require('discord-akairo');
|
||||||
const Discord = require('discord.js');
|
|
||||||
const { createCanvas, loadImage } = require('canvas');
|
const { createCanvas, loadImage } = require('canvas');
|
||||||
const superagent = require('superagent');
|
const superagent = require('superagent');
|
||||||
|
|
||||||
|
@ -65,9 +64,8 @@ class IdubbbzCommand extends Command {
|
||||||
ctx.fillStyle = '#000000';
|
ctx.fillStyle = '#000000';
|
||||||
ctx.fillText(text, canvas.width / 2.1, canvas.height / 1.5);
|
ctx.fillText(text, canvas.width / 2.1, canvas.height / 1.5);
|
||||||
|
|
||||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'edups.png');
|
|
||||||
|
|
||||||
message.channel.send(attachment).catch(() => {
|
message.channel.send({files: [canvas.toBuffer()]}).catch(() => {
|
||||||
message.channel.send('an error as occured. Check the bot/channel permissions');
|
message.channel.send('an error as occured. Check the bot/channel permissions');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
const { Command } = require('discord-akairo');
|
const { Command } = require('discord-akairo');
|
||||||
const Discord = require('discord.js');
|
|
||||||
const { createCanvas, loadImage } = require('canvas');
|
const { createCanvas, loadImage } = require('canvas');
|
||||||
const superagent = require('superagent');
|
const superagent = require('superagent');
|
||||||
|
|
||||||
|
@ -64,9 +63,7 @@ class IdubbbzPaintCommand extends Command {
|
||||||
ctx.fillStyle = '#ffffff';
|
ctx.fillStyle = '#ffffff';
|
||||||
ctx.fillText(text, canvas.width / 3, canvas.height / 1.1);
|
ctx.fillText(text, canvas.width / 3, canvas.height / 1.1);
|
||||||
|
|
||||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'edupspaint.png');
|
message.channel.send({files: [canvas.toBuffer()]}).catch(() => {
|
||||||
|
|
||||||
message.channel.send(attachment).catch(() => {
|
|
||||||
message.channel.send('an error as occured. Check the bot/channel permissions');
|
message.channel.send('an error as occured. Check the bot/channel permissions');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
const { Command } = require('discord-akairo');
|
const { Command } = require('discord-akairo');
|
||||||
const Discord = require('discord.js');
|
|
||||||
const { createCanvas, loadImage } = require('canvas');
|
const { createCanvas, loadImage } = require('canvas');
|
||||||
const superagent = require('superagent');
|
const superagent = require('superagent');
|
||||||
|
|
||||||
|
@ -41,9 +40,7 @@ class LikeCommand extends Command {
|
||||||
const bg = await loadImage(buffer);
|
const bg = await loadImage(buffer);
|
||||||
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
|
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
|
||||||
|
|
||||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'like.png');
|
message.channel.send({files: [canvas.toBuffer()]}).catch(() => {
|
||||||
|
|
||||||
message.channel.send(attachment).catch(() => {
|
|
||||||
message.channel.send('an error as occured. Check the bot/channel permissions');
|
message.channel.send('an error as occured. Check the bot/channel permissions');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
const { Command } = require('discord-akairo');
|
const { Command } = require('discord-akairo');
|
||||||
const Discord = require('discord.js');
|
|
||||||
const { createCanvas, loadImage } = require('canvas');
|
const { createCanvas, loadImage } = require('canvas');
|
||||||
const superagent = require('superagent');
|
const superagent = require('superagent');
|
||||||
|
|
||||||
|
@ -41,9 +40,7 @@ class UglyCommand extends Command {
|
||||||
const bg = await loadImage(buffer);
|
const bg = await loadImage(buffer);
|
||||||
ctx.drawImage(bg, 40, 100, 250, 250);
|
ctx.drawImage(bg, 40, 100, 250, 250);
|
||||||
|
|
||||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'ugly.png');
|
message.channel.send({files: [canvas.toBuffer()]}).catch(() => {
|
||||||
|
|
||||||
message.channel.send(attachment).catch(() => {
|
|
||||||
message.channel.send('an error as occured. Check the bot/channel permissions');
|
message.channel.send('an error as occured. Check the bot/channel permissions');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue