Cause of Death in Rip

This commit is contained in:
Dragon Fire
2020-03-08 18:05:29 -04:00
parent 64a465558f
commit aba47a34e6
4 changed files with 30 additions and 3 deletions
+2
View File
@@ -724,6 +724,8 @@ here.
* http-dog (API) * http-dog (API)
- [Humble Bundle](https://www.humblebundle.com/) - [Humble Bundle](https://www.humblebundle.com/)
* humble-bundle ([API](https://www.humblebundle.com/developer)) * humble-bundle ([API](https://www.humblebundle.com/developer))
- [Iconian Fonts](https://www.fontspace.com/iconian-fonts)
* rip ([Coffin Stone Font](https://www.fontspace.com/coffin-stone-font-f40998))
- [iCrawl](https://github.com/iCrawl) - [iCrawl](https://github.com/iCrawl)
* butt ([Code, Concept](https://github.com/iCrawl/Tohru/blob/master/src/commands/fun/butts.js)) * butt ([Code, Concept](https://github.com/iCrawl/Tohru/blob/master/src/commands/fun/butts.js))
- [iFunny](https://ifunny.co/) - [iFunny](https://ifunny.co/)
Binary file not shown.
+27 -2
View File
@@ -1,8 +1,9 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { createCanvas, loadImage } = require('canvas'); const { createCanvas, loadImage, registerFont } = require('canvas');
const request = require('node-superfetch'); const request = require('node-superfetch');
const path = require('path'); const path = require('path');
const { greyscale } = require('../../util/Canvas'); const { greyscale } = require('../../util/Canvas');
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'CoffinStone-vmmZL.otf'), { family: 'Coffin Stone' });
module.exports = class RipCommand extends Command { module.exports = class RipCommand extends Command {
constructor(client) { constructor(client) {
@@ -23,6 +24,12 @@ module.exports = class RipCommand extends Command {
url: 'https://www.123rf.com/profile_vician', url: 'https://www.123rf.com/profile_vician',
reason: 'Image', reason: 'Image',
reasonURL: 'https://www.123rf.com/profile_vician?mediapopup=13181623' reasonURL: 'https://www.123rf.com/profile_vician?mediapopup=13181623'
},
{
name: 'Iconian Fonts',
url: 'https://www.fontspace.com/iconian-fonts',
reason: 'Coffin Stone Font',
reasonURL: 'https://www.fontspace.com/coffin-stone-font-f40998'
} }
], ],
args: [ args: [
@@ -31,12 +38,19 @@ module.exports = class RipCommand extends Command {
prompt: 'Which user would you like to edit the avatar of?', prompt: 'Which user would you like to edit the avatar of?',
type: 'user', type: 'user',
default: msg => msg.author default: msg => msg.author
},
{
key: 'cause',
label: 'cause of death',
prompt: 'What was the cause of death?',
type: 'string',
default: ''
} }
] ]
}); });
} }
async run(msg, { user }) { async run(msg, { user, cause }) {
const avatarURL = user.displayAvatarURL({ format: 'png', size: 512 }); const avatarURL = user.displayAvatarURL({ format: 'png', size: 512 });
try { try {
const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'rip.png')); const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'rip.png'));
@@ -47,6 +61,17 @@ module.exports = class RipCommand extends Command {
ctx.drawImage(base, 0, 0); ctx.drawImage(base, 0, 0);
ctx.drawImage(avatar, 194, 399, 500, 500); ctx.drawImage(avatar, 194, 399, 500, 500);
greyscale(ctx, 194, 399, 500, 500); greyscale(ctx, 194, 399, 500, 500);
ctx.textAlign = 'center';
ctx.font = '62px Coffin Stone';
ctx.fillStyle = 'white';
ctx.fillText(user.username, 432, 346, 500);
if (cause) {
ctx.fillStyle = 'black';
ctx.fillText(cause, 432, 920, 500);
ctx.fillStyle = 'white';
}
ctx.font = '37px Coffin Stone';
ctx.fillText('In Loving Memory of', 432, 292);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'rip.png' }] }); return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'rip.png' }] });
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "xiao", "name": "xiao",
"version": "112.2.6", "version": "112.3.0",
"description": "Your personal server companion.", "description": "Your personal server companion.",
"main": "Xiao.js", "main": "Xiao.js",
"scripts": { "scripts": {