Fixed gifs, refactor later, this is horrible
This commit is contained in:
parent
640ac92c50
commit
8a39005c32
2 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
const { SlashCommandBuilder } = require('discord.js');
|
const { SlashCommandBuilder } = require('discord.js');
|
||||||
const help = require('../helpFunctions.js');
|
const gifEmbed = require('../gifs.js');
|
||||||
const gifAmount = 50;
|
const gifAmount = 50;
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
|
|
||||||
|
@ -21,14 +21,14 @@ async function getGifEmbed(options) {
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
const gifs = `https://g.tenor.com/v1/random?key=${process.env.TENOR}&limit=${gifAmount}&contentfilter=${rating}`;
|
const gifs = `https://g.tenor.com/v1/random?key=${process.env.TENOR}&limit=${gifAmount}&contentfilter=${rating}`;
|
||||||
return help.getGifEmbed(gifs, gifAmount);
|
return gifEmbed.getGifEmbed(gifs, gifAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
const searchSplits = search.split(/[ ]+/);
|
const searchSplits = search.split(/[ ]+/);
|
||||||
const searchKey = searchSplits.join('-');
|
const searchKey = searchSplits.join('-');
|
||||||
|
|
||||||
const gifs = `https://g.tenor.com/v1/search?q=${searchKey}&key=${process.env.TENOR}&limit=${gifAmount}&contentfilter=${rating}`;
|
const gifs = `https://g.tenor.com/v1/search?q=${searchKey}&key=${process.env.TENOR}&limit=${gifAmount}&contentfilter=${rating}`;
|
||||||
return help.getGifEmbed(gifs, gifAmount);
|
return gifEmbed.getGifEmbed(gifs, gifAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
2
main.js
2
main.js
|
@ -96,6 +96,6 @@ client.on('interactionCreate', async interaction => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
client.login(process.env.TOKEN);
|
client.login(process.env.DEBUGTOKEN);
|
||||||
|
|
||||||
module.exports = client;
|
module.exports = client;
|
Loading…
Reference in a new issue