Locally make Be Like Bill memes

This commit is contained in:
Daniel Odendahl Jr
2017-09-26 02:16:41 +00:00
parent c443e68f7f
commit 61ab9c7c18
5 changed files with 64 additions and 10 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

+32
View File
@@ -0,0 +1,32 @@
[
"{{name}} has a girlfriend, but he\ndoesn't post 56 photos a day about it.\n{{name}} likes to keep these things private.",
"{{name}} is on the internet.\n{{name}} sees something that offends him.\n{{name}} moves on.",
"{{name}} doesn't spam his friends\nwith Be Like Bill memes.",
"{{name}} doesn't drive with his\nfog lights on when it isn't foggy.\n{{name}} knows this is annoying\nand dazzles other drivers.",
"{{name}} doesn't talk to a friend when\nthat friend just woke up.",
"{{name}} can afford a Mac but he\ngets a PC instead because\n{{name}} is not a dumbass.",
"{{name}} does not play Candy Crush.\n{{name}} has a life.",
"{{name}} is a jerk.",
"{{name}} wakes up and sees it snowing outside.\n{{name}} doesn't post about it because\nhe knows his friends also have windows.",
"{{name}} knows tomorrow is Monday.\n{{name}} doesn't post about it, becuase\nhe knows it happens every week.",
"{{name}} doesn't shout at the TV\nwhen football is on.\n{{name}} knows they can't hear him.",
"{{name}} pays attention in class instead of\nchatting with his friends on Discord.",
"{{name}} has a good camera.\n{{name}} doesn't take useless photos\nand call himself a photographer.",
"{{name}} doesn't beg for his PRs to get\nmerged when he had three merged today.",
"{{name}} is a bad meme.\n{{name}} has a good sense of humor about it.",
"{{name}} likes to play games with his nephew.\n{{name}} lets him win all the time.",
"{{name}} meets Della.\n{{name}} loves Della.\nDella loves {{name}}.\n{{name}} and Della dump social networks.",
"{{name}} sees your picture has only three likes.\n{{name}} presses like and comments\nwith a compliement.",
"{{name}} bought a new car.\n{{name}} doesn't post pictures\nand tag 49 others about it.",
"{{name}} is nice.",
"{{name}} has the heart to tell the truth\nwhen his friends don't look very good.",
"{{name}} likes dogs.\n{{name}} doesn't bring his dogs\nto your house uninvited.",
"{{name}} likes to go bowling.\n{{name}} doesn't put up bumpers.",
"{{name}} eats pant.",
"{{name}} likes to use XiaoBot.\n{{name}} doesn't complain when\nit goes closed source.",
"{{name}} loves to buy shoes.\n{{name}} doesn't buy 200 pairs for no reason.",
"{{name}} doesn't like dogs.\n{{name}} doesn't complain on the internet\nbecause he knows no one cares.",
"{{name}}.\nEnough said.",
"{{name}} is a butt.",
"{{name}} knows."
]
+27 -9
View File
@@ -1,5 +1,11 @@
const Command = require('../../structures/Command');
const snekfetch = require('snekfetch');
const { createCanvas, loadImage, registerFont } = require('canvas');
const { stripIndents } = require('common-tags');
const path = require('path');
const texts = require('../../assets/json/be-like-bill');
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Noto.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 BeLikeBillCommand extends Command {
constructor(client) {
@@ -9,6 +15,10 @@ module.exports = class BeLikeBillCommand extends Command {
group: 'image-edit',
memberName: 'be-like-bill',
description: 'Sends a "Be Like Bill" meme with the name of your choice.',
throttling: {
usages: 1,
duration: 15
},
clientPermissions: ['ATTACH_FILES'],
args: [
{
@@ -21,15 +31,23 @@ module.exports = class BeLikeBillCommand extends Command {
});
}
async run(msg, { name }) {
run(msg, { name }) {
try {
const { body } = await snekfetch
.get('http://belikebill.azurewebsites.net/billgen-API.php')
.query({
default: 1,
name
});
return msg.say({ files: [{ attachment: body, name: 'be-like-bill.png' }] });
const canvas = createCanvas(800, 420);
const ctx = canvas.getContext('2d');
const base = loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'be-like-bill.png'));
ctx.drawImage(base, 0, 0);
ctx.font = '23px Noto';
const text = stripIndents`
This is ${name}.
${texts[Math.floor(Math.random() * texts.length)].replace(/{{name}}/gi, name)}
${name} is smart.
Be like ${name}.
`;
ctx.fillText(text, 31, 80);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'be-like-bill.png' }] });
} catch (err) {
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
+4
View File
@@ -9,6 +9,10 @@ module.exports = class ColorCommand extends Command {
group: 'image-edit',
memberName: 'color',
description: 'Sends an image of the color you choose.',
throttling: {
usages: 1,
duration: 15
},
clientPermissions: ['ATTACH_FILES'],
args: [
{
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "42.12.2",
"version": "42.12.3",
"description": "Your personal server companion.",
"main": "Shard.js",
"scripts": {