feat!: Extract logic for autocomplete and component interactions

This commit is contained in:
Marius Begby committed 2023-08-28 13:44:30 +02:00
1 parent f16a18deb5
commit 1ec1281e98
29 files changed
+694 -442

No files matched your search

+16 -14
View File
@@ -20,17 +20,19 @@ const logger = loggerModule.child({
});
(async () => {
const client: ExtendedClient = await createClient({ executionId });
const player = await createPlayer({ client, executionId });
client.on('allShardsReady', async () => {
client.registerClientCommands = registerClientCommands;
await registerEventListeners({ client, player, executionId });
await registerClientCommands({ client, executionId });
client.emit('ready', client as Client);
});
client.login(process.env.DISCORD_BOT_TOKEN);
})().catch((error) => {
logger.error(error);
});
try {
const client: ExtendedClient = await createClient({ executionId });
const player = await createPlayer({ client, executionId });
client.on('allShardsReady', async () => {
client.registerClientCommands = registerClientCommands;
await registerEventListeners({ client, player, executionId });
await registerClientCommands({ client, executionId });
client.emit('ready', client as Client);
});
client.login(process.env.DISCORD_BOT_TOKEN);
} catch (error) {
logger.error(error);
}
})();