spb5k meme
This commit is contained in:
parent
041f84741a
commit
8bbbbbf148
1 changed files with 41 additions and 0 deletions
41
commands/utility/spb.js
Normal file
41
commands/utility/spb.js
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
const { Command } = require('discord-akairo');
|
||||||
|
const fs = require('fs');
|
||||||
|
const fetch = require('node-fetch');
|
||||||
|
|
||||||
|
class spbCommand extends Command {
|
||||||
|
constructor() {
|
||||||
|
super('spb', {
|
||||||
|
aliases: ['spb', '!spb'],
|
||||||
|
category: 'utility',
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
id: 'link',
|
||||||
|
type: 'string'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
description: {
|
||||||
|
content: 'Generate a meme from template you send with spb5k (ONLY WORK WITH TEMPLATES)',
|
||||||
|
usage: '',
|
||||||
|
examples: ['']
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async exec(message, args) {
|
||||||
|
if (!args.link.includes('shitpostbot.com/template/')) {
|
||||||
|
return message.channel.send('Need a template Shitpostbot 5000 link!');
|
||||||
|
}
|
||||||
|
|
||||||
|
let link = args.link.replace('template', 'preview');
|
||||||
|
|
||||||
|
fetch(link)
|
||||||
|
.then(res => {
|
||||||
|
const dest = fs.createWriteStream('./spb.png');
|
||||||
|
res.body.pipe(dest);
|
||||||
|
});
|
||||||
|
|
||||||
|
return message.channel.send({files: ['./spb.png']});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = spbCommand;
|
Loading…
Reference in a new issue