Skip to content

Commit

Permalink
[Enhancement] return if the api key is not defined!
Browse files Browse the repository at this point in the history
  • Loading branch information
naseif committed Nov 4, 2021
1 parent 9d20d90 commit 3d1e7e1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions commands/Fun/gif.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ module.exports = {
async run(message, args, client) {
const query = args.join(" ");

if (!GiphyKey)
return await message.channel.send({
embeds: [
embedMessage(
"#9dcc37",
`❌ Your Giphy API Key is not defined in config.json!`
),
],
});

if (!query) {
const random = await requestAPI(
`https://api.giphy.com/v1/gifs/random?api_key=${GiphyKey}`,
Expand Down Expand Up @@ -91,6 +101,15 @@ module.exports = {
await interaction.deferReply();
const query = interaction.options.getString("search");

if (!GiphyKey)
return await interaction.followUp({
embeds: [
embedMessage(
"#9dcc37",
`❌ Your Giphy API Key is not defined in config.json!`
),
],
});
if (!query) {
const random = await requestAPI(
`https://api.giphy.com/v1/gifs/random?api_key=${GiphyKey}`,
Expand Down

0 comments on commit 3d1e7e1

Please sign in to comment.