send DMs for savegif, reduce spam

This commit is contained in:
= 2021-07-18 21:17:38 -04:00
parent 1113541fdb
commit 7b95f4b0ab

View File

@ -13,9 +13,9 @@ module.exports = {
description: 'Adds a given gif to the hardcoded list.', description: 'Adds a given gif to the hardcoded list.',
usage: '<search query>', usage: '<search query>',
execute(message, file) { execute(message, file) {
const channel = message.channel;
const query = file.name; const query = file.name;
tenor.Search.Query(query, 20) message.author.createDM().then(channel => {
tenor.Search.Query(query, 20)
.then(res => { .then(res => {
if (res[0] == undefined) { if (res[0] == undefined) {
channel.send('Sorry, I wasn\'t able to find a GIF of ' + file.name); channel.send('Sorry, I wasn\'t able to find a GIF of ' + file.name);
@ -92,5 +92,6 @@ module.exports = {
}).catch(err => console.error(err)); }).catch(err => console.error(err));
}) })
.catch(err => console.error(err)); .catch(err => console.error(err));
})
} }
} }