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 121ed77042
commit 89c7fe952b
No known key found for this signature in database
GPG key ID: C4EF128A1BB3A5D2
2 changed files with 3 additions and 5 deletions

View file

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

View file

@ -46,8 +46,6 @@ export default {
const minutes = 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
// const userIds = new Set();
// // Iterate over all guilds (always cached)