Formatted with prettier

This commit is contained in:
Noah Heague
2021-09-05 16:44:17 +10:00
parent a303ebd254
commit 683c4af480
2 changed files with 11 additions and 15 deletions
+5 -3
View File
@@ -38,9 +38,11 @@ client.on("interactionCreate", async (interaction) => {
logger.info(`Running on ${process.env.ENV} environment`);
await client.login(process.env.DISCORD_TOKEN);
logger.info(`Logged in successfully to ${client.guilds.cache.size} guilds`);
logger.info(`https://discord.com/api/oauth2/authorize?client_id=${client.application.id}&permissions=8&scope=applications.commands%20bot`);
await registerSlashCommands(client);
logger.info(
`https://discord.com/api/oauth2/authorize?client_id=${client.application.id}&permissions=8&scope=applications.commands%20bot`
);
await registerSlashCommands(client);
} catch (e) {
logger.error("Log in Failed:", e);
}
+6 -12
View File
@@ -33,22 +33,16 @@ export const registerSlashCommands = async (client: Client): Promise<void> => {
if (process.env.ENV === "PROD") {
logger.info("Registering global slash commands");
await rest.put(
Routes.applicationCommands(client.application.id),{
body: slashCommands.map((command) => command.info)
}
);
await rest.put(Routes.applicationCommands(client.application.id), {
body: slashCommands.map((command) => command.info)
});
} else {
logger.info("Registering guild slash commands");
await tidyOldGuildCommands(client);
await rest.put(
Routes.applicationGuildCommands(client.application.id, process.env.DEV_SERVER_ID),
{
body: slashCommands.map(command => command.info)
}
);
await rest.put(Routes.applicationGuildCommands(client.application.id, process.env.DEV_SERVER_ID), {
body: slashCommands.map((command) => command.info)
});
}
logger.info("Successfully registered slash commands");