mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
feat: better guild command handling
This commit is contained in:
1 parent
bff6eb0503
commit
97d427a6a8
1 file changed
+11
-22
@@ -134,30 +134,19 @@ commands.then((awaitedCommands) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
console.log(`Refreshing ${publicCommands.length} public command(s).`);
|
console.log(`Refreshing ${publicCommands.length} public command(s).`);
|
||||||
rest
|
rest.put(Routes.applicationCommands(getClientId()), {
|
||||||
.put(Routes.applicationCommands(getClientId()), { body: publicCommands })
|
body: publicCommands,
|
||||||
.then((publicData) => {
|
});
|
||||||
console.log(
|
|
||||||
`Successfully refreshed ${
|
|
||||||
(publicData as RESTPostAPIChatInputApplicationCommandsJSONBody[])
|
|
||||||
.length
|
|
||||||
} public command(s).`,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`Refreshing ${guildCommands.length} guild command(s).`);
|
console.log(`Refreshing ${guildCommands.length} guild command(s).`);
|
||||||
rest
|
(isDev()
|
||||||
.put(
|
? [discord.test_guild_id]
|
||||||
Routes.applicationGuildCommands(getClientId(), discord.tres_guild_id),
|
: [discord.tres_guild_id, discord.sklld_guild_id]
|
||||||
{ body: guildCommands },
|
).forEach((guildId) =>
|
||||||
)
|
rest.put(Routes.applicationGuildCommands(getClientId(), guildId), {
|
||||||
.then((guildData) => {
|
body: guildCommands,
|
||||||
console.log(
|
}),
|
||||||
`Successfully refreshed ${
|
);
|
||||||
(guildData as unknown[]).length
|
|
||||||
} guild command(s).`,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user