Haha-Yes/commands/fun/doesntexist.js

29 lines
793 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',
2019-11-09 12:04:01 +01:00
clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'],
2019-03-30 05:08:00 +01:00
description: {
2020-06-15 18:13:05 +02:00
content: 'Send images from thispersondoesnotexist.com!',
2019-03-30 05:08:00 +01:00
usage: '',
examples: ['']
}
});
}
async exec(message) {
fetch('https://thispersondoesnotexist.com/image')
.then(res => {
2019-11-04 14:41:45 +01:00
const dest = fs.createWriteStream('./asset/img/de.png');
2019-03-30 05:08:00 +01:00
res.body.pipe(dest);
dest.on('finish', () => {
2019-11-04 14:41:45 +01:00
return message.channel.send({files: ['./asset/img/de.png']});
2019-03-30 05:08:00 +01:00
});
}); }
}
module.exports = dosentexistCommand;