mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-13 08:19:08 +02:00
More Stoof
This commit is contained in:
@@ -33,7 +33,10 @@ module.exports = class AchievementCommand extends Command {
|
||||
h: 'Achievement Get!',
|
||||
t: text
|
||||
});
|
||||
return msg.say({ files: [{ attachment: body, name: 'achievement.png' }] });
|
||||
return msg.say({ files: [{
|
||||
attachment: body,
|
||||
name: 'achievement.png'
|
||||
}] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
|
||||
@@ -32,9 +32,9 @@ module.exports = class BeLikeBillCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, { name }) {
|
||||
const canvas = createCanvas(800, 420);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'be-like-bill.png'));
|
||||
const canvas = createCanvas(base.width, base.height);
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.drawImage(base, 0, 0);
|
||||
ctx.font = '23px Noto';
|
||||
const text = stripIndents`
|
||||
@@ -46,7 +46,10 @@ module.exports = class BeLikeBillCommand extends Command {
|
||||
Be like ${name}.
|
||||
`;
|
||||
ctx.fillText(text, 31, 80);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'be-like-bill.png' }] });
|
||||
return msg.say({ files: [{
|
||||
attachment: canvas.toBuffer(),
|
||||
name: 'be-like-bill.png'
|
||||
}] });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -30,6 +30,9 @@ module.exports = class ColorCommand extends Command {
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.fillStyle = color;
|
||||
ctx.fillRect(0, 0, 250, 250);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'color.png' }] });
|
||||
return msg.say({ files: [{
|
||||
attachment: canvas.toBuffer(),
|
||||
name: 'color.png'
|
||||
}] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -45,7 +45,10 @@ module.exports = class MemeCommand extends Command {
|
||||
const search = await snekfetch.get(`https://memegen.link/api/search/${type}`);
|
||||
if (!search.body.length) return msg.say('Could not find any results.');
|
||||
const { body } = await snekfetch.get(search.body[0].template.blank.replace(/\/_/, `/${top}/${bottom}`));
|
||||
return msg.say({ files: [{ attachment: body, name: 'meme.jpg' }] });
|
||||
return msg.say({ files: [{
|
||||
attachment: body,
|
||||
name: 'meme.jpg'
|
||||
}] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const snekfetch = require('snekfetch');
|
||||
const pokemon = require('../../assets/json/pokemon-fusion');
|
||||
|
||||
module.exports = class PokemonFusionCommand extends Command {
|
||||
@@ -36,12 +35,7 @@ module.exports = class PokemonFusionCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { body, palette }) {
|
||||
try {
|
||||
const image = await snekfetch.get(`http://images.alexonsager.net/pokemon/fused/${body}/${body}.${palette}.png`);
|
||||
return msg.say({ files: [{ attachment: image.body, name: 'pokemon-fusion.png' }] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
run(msg, { body, palette }) {
|
||||
return msg.say(`http://images.alexonsager.net/pokemon/fused/${body}/${body}.${palette}.png`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,7 +23,10 @@ module.exports = class RobohashCommand extends Command {
|
||||
async run(msg, { text }) {
|
||||
try {
|
||||
const { body } = await snekfetch.get(`https://robohash.org/${text}`);
|
||||
return msg.say({ files: [{ attachment: body, name: 'robohash.png' }] });
|
||||
return msg.say({ files: [{
|
||||
attachment: body,
|
||||
name: 'robohash.png'
|
||||
}] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user