mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-04 07:46:43 +02:00
Lorem Picsum Command
This commit is contained in:
@@ -317,6 +317,7 @@ Total: 433
|
||||
* **karen:** Responds with a random image of Karen.
|
||||
* **lando:** Responds with a random image of Lando Calrissian.
|
||||
* **light-novel-cover:** Responds with a randomly generated Light Novel cover. (NSFW)
|
||||
* **lorem-picsum:** Responds with a random image of a certain size.
|
||||
* **meme:** Responds with a random meme.
|
||||
* **potato:** Responds with a random potato image.
|
||||
* **shiba:** Responds with a random image of a Shiba Inu.
|
||||
@@ -1071,6 +1072,8 @@ here.
|
||||
* light-novel-cover (API)
|
||||
- [LN title generator](https://salty-salty-studios.com/shiz/ln.php)
|
||||
* light-novel-title (API)
|
||||
- [Lorem Picsum](https://picsum.photos/)
|
||||
* lorem-picsum (API)
|
||||
- [LoveToKnow](https://www.lovetoknow.com/)
|
||||
* horse-race ([Horse Name Data](https://horses.lovetoknow.com/horse-names/funny-horse-names))
|
||||
- [Mad Libs](http://www.madlibs.com/)
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class LoremPicsumCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'lorem-picsum',
|
||||
aliases: ['lorem-p', 'picsum'],
|
||||
group: 'random-img',
|
||||
memberName: 'lorem-picsum',
|
||||
description: 'Responds with a random image of a certain size.',
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
credit: [
|
||||
{
|
||||
name: 'Lorem Picsum',
|
||||
url: 'https://picsum.photos/',
|
||||
reason: 'API'
|
||||
}
|
||||
],
|
||||
args: [
|
||||
{
|
||||
key: 'width',
|
||||
prompt: 'What do you want the width of the image to be?',
|
||||
type: 'integer',
|
||||
max: 2000,
|
||||
min: 10
|
||||
},
|
||||
{
|
||||
key: 'height',
|
||||
prompt: 'What do you want the height of the image to be?',
|
||||
type: 'integer',
|
||||
max: 2000,
|
||||
min: 10
|
||||
},
|
||||
{
|
||||
key: 'seed',
|
||||
prompt: 'What seed do you want to provide for image generation?',
|
||||
type: 'string',
|
||||
default: '',
|
||||
max: 100,
|
||||
parse: seed => encodeURIComponent(seed)
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { width, height, seed }) {
|
||||
try {
|
||||
const { body } = await request.get(`https://picsum.photos/${seed ? `seed/${seed}/` : ''}${width}/${height}`);
|
||||
return msg.say({ files: [{ attachment: body, name: `${width}x${height}.jpg` }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "114.21.1",
|
||||
"version": "114.22.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user