mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-16 08:22:22 +02:00
Holy crap lois, it's a new command!
This commit is contained in:
@@ -113,7 +113,7 @@ Only if you want to use the DECTalk command.
|
||||
18. Start Xiao up!
|
||||
|
||||
## Commands
|
||||
Total: 514
|
||||
Total: 515
|
||||
|
||||
### Utility:
|
||||
|
||||
@@ -548,6 +548,7 @@ Total: 514
|
||||
* **genie-rules:** Sends a "There are 4 rules" meme with the text of your choice.
|
||||
* **girl-worth-fighting-for:** Draws an image or a user's avatar as the object of Ling's affection.
|
||||
* **gru-plan:** Sends a Gru's Plan meme with steps of your choice.
|
||||
* **holy-crap-lois:** Draws an image or a user\'s avatar at the door to Peter Griffin's house.
|
||||
* **i-cant-believe:** Sends a "I Can't believe it's not butter!" meme with the text of your choice.
|
||||
* **i-fear-no-man:** Sends a "I fear no man" meme with the text of your choice.
|
||||
* **if-those-kids-could-read:** Sends a "If those kids could read, they'd be very upset" meme with the text of your choice.
|
||||
@@ -1311,6 +1312,8 @@ Total: 514
|
||||
* **gru-plan:**
|
||||
- [Illumination](http://www.illumination.com/) ([Original "Despicable Me" Movie](http://www.despicable.me/))
|
||||
- [Google](https://www.google.com/) ([Noto Font](https://fonts.google.com/noto))
|
||||
* **holy-crap-lois:**
|
||||
- [20th Century Fox](https://www.foxmovies.com/) (Image, Original "Family Guy" Show)
|
||||
* **i-cant-believe:**
|
||||
- [I Can't Believe It's Not Butter!](https://www.icantbelieveitsnotbutter.com/en) (Original Logo)
|
||||
- [Kong Font](https://www.dafont.com/kong-font.d8299) ([The Lord Night Font](https://www.dafont.com/the-lord-night.font))
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 219 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,51 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const { PermissionFlagsBits } = require('discord.js');
|
||||
const { createCanvas, loadImage } = require('@napi-rs/canvas');
|
||||
const request = require('node-superfetch');
|
||||
const path = require('path');
|
||||
const { centerImagePart } = require('../../util/Canvas');
|
||||
|
||||
module.exports = class HolyCrapLoisCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'holy-crap-lois',
|
||||
aliases: ['holy-crap', 'peter-door', 'peter-at-the-door'],
|
||||
group: 'edit-meme',
|
||||
description: 'Draws an image or a user\'s avatar at the door to Peter Griffin\'s house.',
|
||||
throttling: {
|
||||
usages: 2,
|
||||
duration: 10
|
||||
},
|
||||
clientPermissions: [PermissionFlagsBits.AttachFiles],
|
||||
credit: [
|
||||
{
|
||||
name: '20th Century Fox',
|
||||
url: 'https://www.foxmovies.com/',
|
||||
reason: 'Image, Original "Family Guy" Show'
|
||||
},
|
||||
],
|
||||
args: [
|
||||
{
|
||||
key: 'image',
|
||||
type: 'image-or-avatar',
|
||||
avatarSize: 512,
|
||||
default: msg => msg.author.displayAvatarURL({ extension: 'png', size: 512, forceStatic: true })
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { image }) {
|
||||
const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'holy-crap-lois', `bg.png`));
|
||||
const door = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'holy-crap-lois', `door.png`));
|
||||
const { body } = await request.get(image);
|
||||
const data = await loadImage(body);
|
||||
const canvas = createCanvas(base.width, base.height);
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.drawImage(base, 0, 0);
|
||||
const { x, y, width, height } = centerImagePart(data, 424, 424, 0, 40);
|
||||
ctx.drawImage(data, x, y, width, height);
|
||||
ctx.drawImage(door, 0, 0);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'holy-crap-lois.png' }] });
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "159.1.1",
|
||||
"version": "159.2.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user