Haha-Yes/commands/fun/doesntexist.js
supositware dfd25c8bf2 Bunch of update
mostly replacing message.channel.send with message.reply
( i hope it work this time... )
2021-07-23 04:19:47 +02:00

29 lines
No EOL
786 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',
clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'],
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.reply({files: ['./asset/img/de.png']});
});
}); }
}
module.exports = dosentexistCommand;