Merge pull request #522 from VermiumSifell/dev

Fixed more code smells
This commit is contained in:
Axel Olausson Holtenäs 2022-12-13 14:28:31 +01:00 committed by GitHub
commit 05e7cbba6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 7 deletions

View file

@ -142,6 +142,5 @@ export default {
await interaction?.editReply({
embeds: [interactionEmbed],
});
return;
},
};

View file

@ -188,7 +188,6 @@ export default {
await interaction?.editReply({
embeds: [interactionEmbed],
});
return;
});
});
},

View file

@ -22,7 +22,10 @@ export default {
},
});
if (!channelCounter) return logger.debug("No counters found in channel.");
if (!channelCounter) {
logger.debug("No counters found in channel.");
return false;
}
if (
lastMessage?.author.id === author.id &&
@ -32,7 +35,7 @@ export default {
`${author.username} sent the last message therefor not allowing again.`
);
await message.delete();
return;
return false;
}
if (content !== channelCounter.triggerWord) {
@ -41,7 +44,7 @@ export default {
);
await message.delete();
return;
return false;
}
const updateGuildCounter = await prisma.guildCounter.update({

View file

@ -32,7 +32,7 @@ export default async (message: Message) => {
channel?.send(`${author} said **${channelCounter.triggerWord}**.`);
logger?.silly(`${author} said ${channelCounter.triggerWord} in ${channel}`);
return logger?.silly(
logger?.silly(
`User: ${author?.tag} (${author?.id}) in guild: ${guild?.name} (${guild?.id}) said the counter word: ${channelCounter.triggerWord}`
);
};

View file

@ -25,4 +25,5 @@ export const execute = async (oldMessage: Message, newMessage: Message) => {
if (author?.bot) return logger?.silly(`Message update event fired by bot`);
await counter(newMessage);
return;
};

View file

@ -1,4 +1,4 @@
// Dependencies
1; // Dependencies
import { Message } from "discord.js";
// Models
import prisma from "../../../handlers/database";
@ -38,4 +38,5 @@ export default async (message: Message) => {
.catch((error) => {
logger.error(error);
});
return;
};