🧑💻 Fixed some code smelling
This commit is contained in:
parent
74b5ab121c
commit
1d04890c92
2 changed files with 3 additions and 12 deletions
|
@ -3,7 +3,7 @@
|
||||||
import {
|
import {
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
SlashCommandSubcommandBuilder,
|
SlashCommandSubcommandBuilder
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import mongoose from "mongoose";
|
import mongoose from "mongoose";
|
||||||
// Configurations
|
// Configurations
|
||||||
|
@ -200,17 +200,8 @@ export default {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await session.abortTransaction();
|
await session.abortTransaction();
|
||||||
session.endSession();
|
session.endSession();
|
||||||
logger.error(`${error}`);
|
|
||||||
|
|
||||||
return interaction.editReply({
|
thorw new Error("An error occurred while trying to gift credits. Please try again later.")
|
||||||
embeds: [
|
|
||||||
embed
|
|
||||||
.setDescription(
|
|
||||||
"An error occurred while trying to gift credits. Please try again."
|
|
||||||
)
|
|
||||||
.setColor(errorColor),
|
|
||||||
],
|
|
||||||
});
|
|
||||||
} finally {
|
} finally {
|
||||||
// ending the session
|
// ending the session
|
||||||
session.endSession();
|
session.endSession();
|
||||||
|
|
|
@ -56,7 +56,7 @@ export default {
|
||||||
|
|
||||||
userDB.credits += creditsEarned;
|
userDB.credits += creditsEarned;
|
||||||
|
|
||||||
await userDB?.save()?.then(async () => {
|
await userDB?.save()?.then(() => {
|
||||||
logger?.silly(
|
logger?.silly(
|
||||||
`User ${userDB?.userId} worked and earned ${creditsEarned} credits`
|
`User ${userDB?.userId} worked and earned ${creditsEarned} credits`
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue