Haha-Yes/commands/fun/doesntexist.js

28 lines
723 B
JavaScript
Raw Normal View History

2019-03-30 05:08:00 +01:00
const { Command } = require('discord-akairo');
const fs = require('fs');
const fetch = require('node-fetch');
class dosentexistCommand extends Command {
constructor() {
super('dosentexist', {
2019-03-30 15:19:17 +01:00
aliases: ['doesntexist', 'thispersondoesnotexist', 'de'],
2019-03-30 05:08:00 +01:00
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('./img/de.png');
res.body.pipe(dest);
dest.on('finish', () => {
return message.channel.send({files: ['./img/de.png']});
});
}); }
}
module.exports = dosentexistCommand;