mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 22:32:52 +02:00
Pills, thicc, and nitro Commands
This commit is contained in:
@@ -101,6 +101,12 @@ module.exports = class HatCommand extends Command {
|
||||
url: 'https://www.stickpng.com/',
|
||||
reason: 'Mask Hat Image',
|
||||
reasonURL: 'https://www.stickpng.com/img/science/pandemic/white-surgical-face-mask-front-view'
|
||||
},
|
||||
{
|
||||
name: 'Why We Protest',
|
||||
url: 'https://whyweprotest.net/',
|
||||
reason: 'Anon Hat Image',
|
||||
reasonURL: 'https://whyweprotest.net/threads/big-ass-guy-fawkes-mask-images-thread.22719/'
|
||||
}
|
||||
],
|
||||
args: [
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { createCanvas, loadImage, registerFont } = require('canvas');
|
||||
const path = require('path');
|
||||
const { wrapText } = require('../../util/Canvas');
|
||||
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 PillsCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'pills',
|
||||
aliases: ['hard-to-swallow-pills', 'hard-pills'],
|
||||
group: 'edit-meme',
|
||||
memberName: 'pills',
|
||||
description: 'Sends a "Hard to Swallow Pills" meme with the text of your choice.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 10
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
credit: [
|
||||
{
|
||||
name: 'Overtime2005',
|
||||
url: 'https://github.com/Overtime2005',
|
||||
reason: 'Concept'
|
||||
},
|
||||
{
|
||||
name: 'Google',
|
||||
url: 'https://www.google.com/',
|
||||
reason: 'Noto Font',
|
||||
reasonURL: 'https://www.google.com/get/noto/'
|
||||
}
|
||||
],
|
||||
args: [
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'What do you want to be hard to swallow?',
|
||||
type: 'string',
|
||||
max: 500
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { text }) {
|
||||
const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'pills.png'));
|
||||
const canvas = createCanvas(base.width, base.height);
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.drawImage(base, 0, 0);
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'top';
|
||||
ctx.font = '32px Noto';
|
||||
let fontSize = 32;
|
||||
while (ctx.measureText(text).width > 1260) {
|
||||
fontSize--;
|
||||
ctx.font = `${fontSize}px Noto`;
|
||||
}
|
||||
const lines = await wrapText(ctx, text, 280);
|
||||
const topMost = 455 - (((fontSize * lines.length) / 2) + ((10 * (lines.length - 1)) / 2));
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const height = topMost + ((fontSize + 10) * i);
|
||||
ctx.fillText(lines[i], 183, height);
|
||||
}
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'pills.png' }] });
|
||||
}
|
||||
};
|
||||
@@ -14,7 +14,8 @@ module.exports = class EmojiImageCommand extends Command {
|
||||
{
|
||||
key: 'emoji',
|
||||
prompt: 'Which emoji would you like to get the image of?',
|
||||
type: 'custom-emoji'
|
||||
type: 'custom-emoji',
|
||||
default: msg => msg.guild.emojis.cache.random()
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MersenneTwister19937, integer } = require('random-js');
|
||||
|
||||
module.exports = class ThiccCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'thicc',
|
||||
aliases: ['thick'],
|
||||
group: 'random-seed',
|
||||
memberName: 'thicc',
|
||||
description: 'Determines how thicc you are.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to determine the thiccness of?',
|
||||
type: 'user',
|
||||
default: msg => msg.author
|
||||
}
|
||||
],
|
||||
credit: [
|
||||
{
|
||||
name: 'Overtime2005',
|
||||
url: 'https://github.com/Overtime2005',
|
||||
reason: 'Concept'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
if (this.client.isOwner(user)) {
|
||||
if (user.id === msg.author.id) return msg.reply(`You are thi${'c'.repeat(100)}`);
|
||||
return msg.reply(`They are thi. Not even one c.`);
|
||||
}
|
||||
const clientAuthor = user.id === this.client.user.id;
|
||||
const random = MersenneTwister19937.seed(clientAuthor ? msg.author.id : user.id);
|
||||
const length = integer(0, 100)(random);
|
||||
let pronoun = 'They';
|
||||
if (user.id === msg.author.id) pronoun = 'You'
|
||||
return msg.reply(`${pronoun} are thi${'c'.repeat(clientAuthor ? length + 1 : length)}`);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = class NitroCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'nitro',
|
||||
aliases: ['fake-nitro'],
|
||||
group: 'single',
|
||||
memberName: 'nitro',
|
||||
description: 'Sends an image of a fake nitro giveaway.',
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
url: [
|
||||
{
|
||||
name: 'u/MoonlightCapital',
|
||||
url: 'https://www.reddit.com/user/MoonlightCapital/',
|
||||
reason: 'Image',
|
||||
reasonURL: 'https://www.reddit.com/r/discordapp/comments/a9fr7x/troll_your_friends_with_this/'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say({ files: [path.join(__dirname, '..', '..', 'assets', 'images', 'nitro.png')] });
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user