mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
I Fear No Man Command
This commit is contained in:
@@ -231,7 +231,7 @@ in the appropriate channel's topic to use it.
|
||||
|
||||
## Commands
|
||||
|
||||
Total: 514
|
||||
Total: 515
|
||||
|
||||
### Utility:
|
||||
|
||||
@@ -670,6 +670,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.
|
||||
* **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.
|
||||
* **illegal:** Makes President Trump make your text illegal.
|
||||
* **kyon-gun:** Draws an image or a user's avatar behind Kyon shooting a gun.
|
||||
@@ -1352,6 +1353,7 @@ here.
|
||||
* gun (Concept)
|
||||
* hands (Concept)
|
||||
* hentai (Original Subreddit List)
|
||||
* i-fear-no-man (Concept)
|
||||
* if-those-kids-could-read (Concept)
|
||||
* like (Concept)
|
||||
* pills (Concept)
|
||||
@@ -1599,6 +1601,7 @@ here.
|
||||
* usps-tracking ([API](https://www.usps.com/business/web-tools-apis/))
|
||||
- [Valve](https://www.valvesoftware.com/en/)
|
||||
* fact-core ([Original "Portal 2" Game](http://www.thinkwithportals.com/))
|
||||
* i-fear-no-man ([Image, Original "Team Fortress 2" Game](https://www.teamfortress.com/))
|
||||
* oracle-turret ([Original "Portal 2" Game](http://www.thinkwithportals.com/))
|
||||
- [vician](https://www.123rf.com/profile_vician)
|
||||
* rip ([Image](https://www.123rf.com/profile_vician?mediapopup=13181623))
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 108 KiB |
@@ -0,0 +1,59 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { createCanvas, loadImage } = require('canvas');
|
||||
const request = require('node-superfetch');
|
||||
const path = require('path');
|
||||
const { centerImagePart } = require('../../util/Canvas');
|
||||
|
||||
module.exports = class IFearNoManCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'i-fear-no-man',
|
||||
aliases: ['i-fear-no', 'i-fear', 'it-scares-me'],
|
||||
group: 'edit-meme',
|
||||
memberName: 'i-fear-no-man',
|
||||
description: 'Sends a "I fear no man" meme with the text of your choice.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 10
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
credit: [
|
||||
{
|
||||
name: 'Valve',
|
||||
url: 'https://www.valvesoftware.com/en/',
|
||||
reasonURL: 'https://www.teamfortress.com/',
|
||||
reason: 'Image, Original "Team Fortress 2" Game'
|
||||
},
|
||||
{
|
||||
name: 'Overtime2005',
|
||||
url: 'https://github.com/Overtime2005',
|
||||
reason: 'Concept'
|
||||
}
|
||||
],
|
||||
args: [
|
||||
{
|
||||
key: 'image',
|
||||
prompt: 'What image would you like to edit?',
|
||||
type: 'image',
|
||||
default: msg => msg.author.displayAvatarURL({ format: 'png', size: 256 })
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { image }) {
|
||||
try {
|
||||
const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'i-fear-no-man.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, 169, 169, 167, 330);
|
||||
ctx.drawImage(data, x, y, width, height);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'i-fear-no-man.png' }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "117.10.0",
|
||||
"version": "117.11.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user