refactor: ⚰️ Fixed some code smells

Fixed some code smells from https://deepsource.io/gh/ZynerOrg/xyter/run/8058c521-9330-4c14-94b2-0c3a7d9d824b/javascript/
This commit is contained in:
Axel Olausson Holtenäs 2022-12-13 14:16:41 +01:00
parent 6f82b109bd
commit 055f5f6217
2 changed files with 3 additions and 5 deletions

View file

@ -72,7 +72,7 @@ export default {
logger.silly(createGuildMember); logger.silly(createGuildMember);
const reputationType = async (reputation: number) => { const reputationType = (reputation: number) => {
if (reputation < 0) return `negative reputation of ${reputation}`; if (reputation < 0) return `negative reputation of ${reputation}`;
if (reputation > 0) return `positive reputation of ${reputation}`; if (reputation > 0) return `positive reputation of ${reputation}`;
return "neutral reputation"; return "neutral reputation";
@ -86,10 +86,10 @@ export default {
) )
.setDescription( .setDescription(
optionAccount optionAccount
? `${optionAccount} have a ${await reputationType( ? `${optionAccount} have a ${reputationType(
createGuildMember.user.reputationsEarned createGuildMember.user.reputationsEarned
)}` )}`
: `You have a ${await reputationType( : `You have a ${reputationType(
createGuildMember.user.reputationsEarned createGuildMember.user.reputationsEarned
)}` )}`
) )

View file

@ -46,8 +46,6 @@ export default {
const minutes = Math?.floor(totalSeconds / 60); const minutes = Math?.floor(totalSeconds / 60);
const seconds = Math?.floor(totalSeconds % 60); const seconds = Math?.floor(totalSeconds % 60);
const uptime = `${days} days, ${hours} hours, ${minutes} minutes and ${seconds} seconds`;
// // Initialize a storage for the user ids // // Initialize a storage for the user ids
// const userIds = new Set(); // const userIds = new Set();
// // Iterate over all guilds (always cached) // // Iterate over all guilds (always cached)