🚑 config plugin was excluded by .gitignore

This commit is contained in:
Axel Olausson Holtenäs 2022-06-21 17:09:48 +02:00
parent 023589f9d0
commit 537261c988
No known key found for this signature in database
GPG key ID: 7BF6826B76382CBA
13 changed files with 20 additions and 50 deletions

1
.gitignore vendored
View file

@ -6,6 +6,7 @@ package-lock.json
config/
!plugins/commands/config
# Build
build/

View file

@ -42,7 +42,7 @@ export default async (client: Client) => {
logger.info(`Finished updating command list.`);
})
.catch(async (error) => {
logger.error(`${error}`);
throw new Error(`Could not update command list: ${error}`);
});
if (devMode) {
@ -52,7 +52,7 @@ export default async (client: Client) => {
})
.then(async () => logger.info(`Finished updating guild command list.`))
.catch(async (error) => {
logger.error(`${error}`);
throw new Error(`Could not update guild command list: ${error}`);
});
}
};

View file

@ -1,19 +1,16 @@
import { token, intents } from "./config/discord";
import { Client } from "discord.js"; // discord.js
import { Client } from "discord.js";
import * as managers from "./managers";
// Main process that starts all other sub processes
const main = async () => {
// Initiate client object
const client = new Client({
intents,
});
await managers.start(client);
// Authorize with Discord's API
await client.login(token);
};

View file

@ -14,11 +14,11 @@ export const start = async () => {
logger.info(`Connected to database: ${connection.connection.name}`);
})
.catch(async (e) => {
logger.error("Could not connect to database", e);
throw new Error(`Error connecting to database: ${e}`);
});
mongoose.connection.on("error", async (error) => {
logger.error(`${error}`);
throw new Error(`Could not connect to database: ${error}`);
});
mongoose.connection.on("warn", async (warning) => {

View file

@ -12,7 +12,7 @@ export const register = async (client: Client) => {
const event: IEvent = await import(`../../plugins/events/${eventName}`);
const eventExecutor = async (...args: Promise<void>[]) =>
event.execute(...args).catch(async (err) => {
logger.error(`${err}`);
throw new Error(`Error executing event ${eventName}: ${err}`);
});
if (!event.options?.type) return;

View file

@ -201,17 +201,9 @@ export default {
} catch (error) {
await session.abortTransaction();
session.endSession();
logger.error(`${error}`);
return interaction.editReply({
embeds: [
embed
.setDescription(
"An error occurred while trying to gift credits. Please try again."
)
.setColor(errorColor),
],
});
throw new Error(
`There was an error while saving the transaction: ${error}`
);
} finally {
// ending the session
session.endSession();

View file

@ -210,21 +210,9 @@ export default {
} catch (error) {
await session.abortTransaction();
session.endSession();
logger.error(`${error}`);
return interaction.editReply({
embeds: [
new MessageEmbed()
.setTitle("[:toolbox:] Manage - Credits (Transfer)")
.setDescription(
"An error occurred while trying to gift credits. Please try again."
)
.setColor(errorColor)
.setTimestamp(new Date())
.setColor(successColor)
.setFooter({ text: footerText, iconURL: footerIcon }),
],
});
throw new Error(
`There was an error while transferring credits. ${error}`
);
} finally {
// ending the session
session.endSession();

View file

@ -57,7 +57,7 @@ export default {
);
})
.catch(async () => {
logger.error(
throw new Error(
`Audit log failed to send for event interactionCreate in guild ${interaction?.guild?.name} (${interaction?.guild?.id})`
);
});

View file

@ -58,10 +58,7 @@ export default {
);
})
.catch(async (err) => {
logger.error(
`Error saving counter for guild ${guildId} and channel ${channelId}`,
err
);
throw new Error(`There was an error saving the counter: ${err}`);
});
logger.silly(

View file

@ -38,8 +38,8 @@ export default {
);
})
.catch(async (err) => {
logger.error(
`Error saving credits for user ${userId} in guild ${guildId} - ${err}`
throw new Error(
`Error saving user ${userId} in guild ${guildId}: ${err}`
);
});
},

View file

@ -35,10 +35,7 @@ export default {
);
})
.catch(async (err) => {
logger.error(
`Error saving points for user ${author.tag} (${author.id}) in guild: ${guild?.name} (${guild?.id})`,
err
);
throw new Error(`There was an error saving the user: ${err}`);
});
logger.silly(

View file

@ -58,9 +58,7 @@ export default {
);
})
.catch(async () => {
logger.error(
`Audit log failed to send for event messageDelete in guild ${message?.guild?.name} (${message?.guild?.id})`
);
throw new Error(`There was an error sending the audit log`);
});
},
};

View file

@ -60,7 +60,7 @@ export default {
);
})
.catch(async () => {
logger.error(
throw new Error(
`Audit log failed to send for event messageUpdate in guild ${newMessage?.guild?.name} (${newMessage?.guild?.id})`
);
});