Boardroom Meeting Command

This commit is contained in:
Dragon Fire
2020-06-28 21:15:05 -04:00
parent b0bcef5fe2
commit 84cf80c7d7
4 changed files with 92 additions and 2 deletions
+6 -1
View File
@@ -227,7 +227,7 @@ in the appropriate channel's topic to use it.
## Commands
Total: 503
Total: 504
### Utility:
@@ -640,6 +640,7 @@ Total: 503
* **bart-chalkboard:** Sends a "Bart Chalkboard" meme with the text of your choice.
* **be-like-bill:** Sends a "Be Like Bill" meme with the name of your choice.
* **beautiful:** Draws a user's avatar over Gravity Falls' "Oh, this? This is beautiful." meme.
* **boardroom-meeting:** Sends a "Boardroom Meeting" meme with the text of your choice.
* **catch:** Catch users, revealing who is something.
* **challenger:** Draws an image or a user's avatar over Smash Bros.'s "Challenger Approaching" screen.
* **change-my-mind:** Sends a "Change My Mind" meme with the text of your choice.
@@ -1036,6 +1037,7 @@ here.
- [Go Nintendo](https://gonintendo.com/)
* hat ([Ash Hat Image](https://gonintendo.com/stories/306292))
- [Google](https://www.google.com/)
* boardroom-meeting ([Noto Font](https://www.google.com/get/noto/))
* book ([Books API](https://developers.google.com/books/))
* calendar ([Calendar API](https://developers.google.com/calendar/))
* catch ([Noto Font](https://www.google.com/get/noto/))
@@ -1093,6 +1095,8 @@ here.
* scrabble-score ([Original "Scrabble" Game](https://scrabble.hasbro.com/en-us))
- [hbl917070](https://github.com/hbl917070)
* axis-cult-sign-up ([Font](https://github.com/hbl917070/Konosuba-text))
- [hejibits](https://hejibits.com/)
* boardroom-meeting ([Image](https://web.archive.org/web/20121226235748/https://hejibits.com/comics/outlook-oust/))
- [Hollywood Walk of Fame](https://walkoffame.com/)
* hollywood-star (Concept)
- [Horst Faas](https://en.wikipedia.org/wiki/Horst_Faas)
@@ -1319,6 +1323,7 @@ here.
* osu ([API](https://github.com/ppy/osu-api/wiki))
- [Overtime2005](https://github.com/Overtime2005)
* alert (Concept)
* boardroom-meeting (Concept)
* dislike (Concept)
* gun (Concept)
* hands (Concept)
Binary file not shown.

After

Width:  |  Height:  |  Size: 348 KiB

+85
View File
@@ -0,0 +1,85 @@
const Command = require('../../structures/Command');
const { createCanvas, loadImage, registerFont } = require('canvas');
const path = require('path');
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Noto-Regular.ttf'), { family: 'Noto' });
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Noto-CJK.otf'), { family: 'Noto' });
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Noto-Emoji.ttf'), { family: 'Noto' });
module.exports = class BoardroomMeetingCommand extends Command {
constructor(client) {
super(client, {
name: 'boardroom-meeting',
aliases: ['boardroom-suggestion', 'boardroom'],
group: 'edit-meme',
memberName: 'boardroom-meeting',
description: 'Sends a "Boardroom Meeting" meme with the text of your choice.',
throttling: {
usages: 1,
duration: 10
},
clientPermissions: ['ATTACH_FILES'],
credit: [
{
name: 'hejibits',
url: 'https://hejibits.com/',
reason: 'Image',
reasonURL: 'https://web.archive.org/web/20121226235748/https://hejibits.com/comics/outlook-oust/'
},
{
name: 'Google',
url: 'https://www.google.com/',
reason: 'Noto Font',
reasonURL: 'https://www.google.com/get/noto/'
},
{
name: 'Overtime2005',
url: 'https://github.com/Overtime2005',
reason: 'Concept'
}
],
args: [
{
key: 'question',
prompt: 'What question should the meeting leader ask?',
type: 'string',
max: 100
},
{
key: 'suggestion1',
label: 'first suggestion',
prompt: 'What should the first employee suggest?',
type: 'string',
max: 50
},
{
key: 'suggestion2',
label: 'second suggestion',
prompt: 'What should the second employee suggest?',
type: 'string',
max: 50
},
{
key: 'final',
label: 'final suggestion',
prompt: 'What should the employee who gets thrown out the window suggest?',
type: 'string',
max: 50
}
]
});
}
async run(msg, { question, suggestion1, suggestion2, final }) {
const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'boardroom-meeting.png'));
const canvas = createCanvas(base.width, base.height);
const ctx = canvas.getContext('2d');
ctx.drawImage(base, 0, 0);
ctx.font = '25px Noto';
ctx.fillText(question, 153, 8, 300);
ctx.font = '15px Noto';
ctx.fillText(suggestion1, 30, 251, 90);
ctx.fillText(suggestion2, 167, 258, 75);
ctx.fillText(final, 310, 269, 130);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'boardroom-meeting.png' }] });
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "116.40.1",
"version": "116.41.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {