You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
723 B
JavaScript
28 lines
723 B
JavaScript
6 years ago
|
const { Command } = require('discord-akairo');
|
||
|
const fs = require('fs');
|
||
|
const fetch = require('node-fetch');
|
||
|
|
||
|
class dosentexistCommand extends Command {
|
||
|
constructor() {
|
||
|
super('dosentexist', {
|
||
6 years ago
|
aliases: ['doesntexist', 'thispersondoesnotexist', 'de'],
|
||
6 years ago
|
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;
|