mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-08 14:58:12 +03:00
Formatted with prettier
This commit is contained in:
+5
-3
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user