Skip to content

Commit

Permalink
[Fix] I really gotta stop forget to return from the function!! xD
Browse files Browse the repository at this point in the history
  • Loading branch information
naseif committed Nov 26, 2021
1 parent c9eda8f commit 4244d16
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 39 deletions.
12 changes: 8 additions & 4 deletions commands/Anime/highfive.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ module.exports = {
}`,
},
};
await message.channel.send({
return await message.channel.send({
embeds: [highFiveEmbed],
content: `${user ? user : `${message.member.toString()}`}`,
});
} catch (error) {
client.logger(error.message, "error");
await message.channel.send(`❌ | Couldn't retrieve a hug gif, Sorry!`);
return await message.channel.send(
`❌ | Couldn't retrieve a hug gif, Sorry!`
);
}
},
data: new SlashCommandBuilder()
Expand All @@ -54,12 +56,14 @@ module.exports = {
}`,
},
};
await interaction.followUp({
return await interaction.followUp({
embeds: [highFiveEmbed],
});
} catch (error) {
client.logger(error.message, "error");
await interaction.followUp(`❌ | Couldn't retrieve a hug gif, Sorry!`);
return await interaction.followUp(
`❌ | Couldn't retrieve a hug gif, Sorry!`
);
}
},
};
12 changes: 8 additions & 4 deletions commands/Anime/hug.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ module.exports = {
}`,
},
};
await message.channel.send({ embeds: [hugEmbed] });
return await message.channel.send({ embeds: [hugEmbed] });
} catch (error) {
client.logger(error.message, "error");
await message.channel.send(`❌ | Couldn't retrieve a hug gif, Sorry!`);
return await message.channel.send(
`❌ | Couldn't retrieve a hug gif, Sorry!`
);
}
},
data: new SlashCommandBuilder()
Expand All @@ -48,10 +50,12 @@ module.exports = {
}`,
},
};
await interaction.followUp({ embeds: [hugEmbed] });
return await interaction.followUp({ embeds: [hugEmbed] });
} catch (error) {
client.logger(error.message, "error");
await interaction.followUp(`❌ | Couldn't retrieve a hug gif, Sorry!`);
return await interaction.followUp(
`❌ | Couldn't retrieve a hug gif, Sorry!`
);
}
},
};
6 changes: 3 additions & 3 deletions commands/Anime/searchAnime.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ module.exports = {
timestamp: new Date(),
};

await message.channel.send({ embeds: [animeEmbed] });
return await message.channel.send({ embeds: [animeEmbed] });
} catch (err) {
await message.channel.send({
return await message.channel.send({
embeds: [embedMessage("RED", `❌ Could not find this Anime, Sry!`)],
});
logger(err.message, "error");
Expand Down Expand Up @@ -147,7 +147,7 @@ module.exports = {
timestamp: new Date(),
};

await interaction.followUp({ embeds: [animeEmbed] });
return await interaction.followUp({ embeds: [animeEmbed] });
} catch (err) {
await interaction.followUp({
embeds: [embedMessage("RED", `❌ Could not find this Anime, Sry!`)],
Expand Down
8 changes: 4 additions & 4 deletions commands/Anime/waifu.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ module.exports = {
}`,
},
};
await message.channel.send({ embeds: [waifuEmbed] });
return await message.channel.send({ embeds: [waifuEmbed] });
} catch (error) {
client.logger(error.message, "error");
await message.channel.send(`❌ | Couldn't retrieve a waifu pic, Sorry!`);
return await message.channel.send(`❌ | Couldn't retrieve a waifu pic, Sorry!`);
}
},
data: new SlashCommandBuilder()
Expand All @@ -48,10 +48,10 @@ module.exports = {
}`,
},
};
await interaction.followUp({ embeds: [waifuEmbed] });
return await interaction.followUp({ embeds: [waifuEmbed] });
} catch (error) {
client.logger(error.message, "error");
await interaction.followUp(`❌ | Couldn't retrieve a waifu pic, Sorry!`);
return await interaction.followUp(`❌ | Couldn't retrieve a waifu pic, Sorry!`);
}
},
};
8 changes: 4 additions & 4 deletions commands/Anime/whatAnime.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ module.exports = {
}`,
},
};
await message.channel.send({ embeds: [infoEmbed] });
return await message.channel.send({ embeds: [infoEmbed] });
} catch (error) {
client.logger(error.message, "error");
await message.channel.send(
return await message.channel.send(
`❌ ${interaction.user.toString()}, There was an error processing this image!`
);
}
Expand Down Expand Up @@ -77,10 +77,10 @@ module.exports = {
}`,
},
};
await interaction.followUp({ embeds: [infoEmbed] });
return await interaction.followUp({ embeds: [infoEmbed] });
} catch (error) {
client.logger(error.message, "error");
await interaction.followUp(
return await interaction.followUp(
`❌ ${interaction.user.toString()}, There was an error processing this image!`
);
}
Expand Down
4 changes: 2 additions & 2 deletions commands/Misc/avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = {
timestamp: new Date(),
};

await message.channel.send({ embeds: [embed] });
return await message.channel.send({ embeds: [embed] });
},
data: new SlashCommandBuilder()
.setName("avatar")
Expand Down Expand Up @@ -65,6 +65,6 @@ module.exports = {
timestamp: new Date(),
};

await interaction.followUp({ embeds: [embed] });
return await interaction.followUp({ embeds: [embed] });
},
};
4 changes: 2 additions & 2 deletions commands/Misc/invite.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = {
`Eyesense is a feature-rich discord bot that provides over 100 commands!`,
true
);
await message.channel.send({ embeds: [embed], components: [row] });
return await message.channel.send({ embeds: [embed], components: [row] });
},
data: new SlashCommandBuilder()
.setName("invite")
Expand Down Expand Up @@ -77,6 +77,6 @@ module.exports = {
`Eyesense is a feature-rich discord bot that provides over 100 commands!`,
true
);
await interaction.followUp({ embeds: [embed], components: [row] });
return await interaction.followUp({ embeds: [embed], components: [row] });
},
};
8 changes: 4 additions & 4 deletions commands/Misc/perms.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ module.exports = {
};

try {
await message.channel.send({
return await message.channel.send({
embeds: [permsEmbed],
});
} catch (err) {
client.logger(err.message, "error");
await message.channel.send({
return await message.channel.send({
embeds: [
embedMessage(
"RED",
Expand Down Expand Up @@ -104,12 +104,12 @@ module.exports = {
},
};
try {
await interaction.followUp({
return await interaction.followUp({
embeds: [permsEmbed],
});
} catch (err) {
client.logger(err.message, "error");
await interaction.followUp({
return await interaction.followUp({
embeds: [
embedMessage(
"RED",
Expand Down
4 changes: 2 additions & 2 deletions commands/Misc/ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
color: "#9dcc37",
};

await message.channel.send({ embeds: [embed] });
return await message.channel.send({ embeds: [embed] });
},
data: new SlashCommandBuilder()
.setName("ping")
Expand All @@ -27,6 +27,6 @@ module.exports = {
color: "#9dcc37",
};

await interaction.followUp({ embeds: [embed] });
return await interaction.followUp({ embeds: [embed] });
},
};
4 changes: 2 additions & 2 deletions commands/Misc/searchMovie.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ module.exports = {
timestamp: new Date(),
};

await message.channel.send({ embeds: [movieEmbed] });
return await message.channel.send({ embeds: [movieEmbed] });
} catch (error) {
logger(error.message, "error");
console.error(error);
Expand Down Expand Up @@ -211,7 +211,7 @@ module.exports = {
timestamp: new Date(),
};

await interaction.followUp({ embeds: [movieEmbed] });
return await interaction.followUp({ embeds: [movieEmbed] });
} catch (error) {
logger(error.message, "error");
console.error(error);
Expand Down
8 changes: 4 additions & 4 deletions commands/Misc/serverstats.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ module.exports = {
timestamp: new Date(),
};
try {
await message.channel.send({ embeds: [statssEmbed] });
return await message.channel.send({ embeds: [statssEmbed] });
} catch (err) {
client.logger(err.message, "error");
await message.channel.send(
return await message.channel.send(
`I was not able to fetch the server info, do I have permission ?`
);
console.error(err);
Expand Down Expand Up @@ -89,10 +89,10 @@ module.exports = {
timestamp: new Date(),
};
try {
await interaction.followUp({ embeds: [statssEmbed] });
return await interaction.followUp({ embeds: [statssEmbed] });
} catch (err) {
client.logger(err.message, "error");
await interaction.followUp(
return await interaction.followUp(
`I was not able to fetch the server info, do I have permission ?`
);
console.error(err);
Expand Down
4 changes: 2 additions & 2 deletions commands/Misc/summon.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = {

try {
await guildUser.voice.setChannel(message.member.voice.channelId);
await message.channel.send({
return await message.channel.send({
embeds: [
embedMessage(
"#9dcc37",
Expand Down Expand Up @@ -96,7 +96,7 @@ module.exports = {

try {
await user.voice.setChannel(interaction.member.voice.channelId);
await interaction.followUp({
return await interaction.followUp({
embeds: [
embedMessage(
"#9dcc37",
Expand Down
4 changes: 2 additions & 2 deletions commands/Misc/uptime.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
usage: "up || uptime",
args: false,
async run(message, args, client) {
await message.channel.send({
return await message.channel.send({
embeds: [
embedMessage(
"#9dcc37",
Expand All @@ -23,7 +23,7 @@ module.exports = {
.setName("uptime")
.setDescription("Since how long the bot is online"),
async execute(interaction, client) {
await interaction.reply({
return await interaction.reply({
embeds: [
embedMessage(
"#9dcc37",
Expand Down

0 comments on commit 4244d16

Please sign in to comment.