🥅 now also catches Typeerrors

This commit is contained in:
Axel Olausson Holtenäs 2022-04-22 15:43:39 +02:00
parent 5ffb65d9d9
commit 4ec45ed190
No known key found for this signature in database
GPG key ID: 7BF6826B76382CBA

View file

@ -15,19 +15,14 @@ export default async (client: Client) => {
plugins.map(async (pluginName) => {
const plugin = await import(`../plugins/${pluginName}`);
await client?.commands?.set(
plugin?.default?.data?.name,
plugin?.default
);
logger.verbose(`Loaded plugin: ${pluginName}`);
await client.commands.set(plugin.default.data.name, plugin.default);
})
)
.then(async () => {
logger.debug("Successfully loaded plugins.");
})
.catch(async (err) => {
logger.error(err);
logger.error(`${err}`);
});
});
};