forked from Supositware/Haha-Yes
28 lines
No EOL
735 B
JavaScript
28 lines
No EOL
735 B
JavaScript
const { Command } = require('discord-akairo');
|
|
const fs = require('fs');
|
|
const fetch = require('node-fetch');
|
|
|
|
class dosentexistCommand extends Command {
|
|
constructor() {
|
|
super('dosentexist', {
|
|
aliases: ['doesntexist', 'thispersondoesnotexist', 'de'],
|
|
category: 'fun',
|
|
description: {
|
|
content: 'Send images from thispersondoesnotexist.com',
|
|
usage: '',
|
|
examples: ['']
|
|
}
|
|
});
|
|
}
|
|
|
|
async exec(message) {
|
|
fetch('https://thispersondoesnotexist.com/image')
|
|
.then(res => {
|
|
const dest = fs.createWriteStream('./asset/img/de.png');
|
|
res.body.pipe(dest);
|
|
dest.on('finish', () => {
|
|
return message.channel.send({files: ['./asset/img/de.png']});
|
|
});
|
|
}); }
|
|
}
|
|
module.exports = dosentexistCommand; |