Use url type

This commit is contained in:
loicbersier 2020-07-16 09:24:44 +02:00
parent 8d53b90b4d
commit 7ed7b6c338

View file

@ -12,7 +12,7 @@ class spbCommand extends Command {
args: [ args: [
{ {
id: 'link', id: 'link',
type: 'string', type: 'url',
prompt: { prompt: {
start: 'Need a shitpostbot5000 template link!', start: 'Need a shitpostbot5000 template link!',
} }
@ -27,11 +27,11 @@ class spbCommand extends Command {
} }
async exec(message, args) { async exec(message, args) {
if (!args.link || !args.link.includes('shitpostbot.com/template/')) { if (!args.link || !args.link.href.includes('shitpostbot.com/template/')) {
return message.channel.send('Need a Shitpostbot 5000 template link!\nYou can find them here! <https://www.shitpostbot.com/gallery/templates>'); return message.channel.send('Need a Shitpostbot 5000 template link!\nYou can find them here! <https://www.shitpostbot.com/gallery/templates>');
} }
let link = args.link.replace('template', 'preview'); let link = args.link.href.replace('template', 'preview');
fetch(link) fetch(link)
.then(res => { .then(res => {