Restructured file to allow async use
This commit is contained in:
parent
70c4d55cfa
commit
f03314af80
@ -22,7 +22,7 @@ console.log(`Token: ${token} Client ID: ${clientId}`);
|
|||||||
|
|
||||||
const rest = new REST({ version: '9' }).setToken(token);
|
const rest = new REST({ version: '9' }).setToken(token);
|
||||||
|
|
||||||
(async () => {
|
async function deleteCommands() {
|
||||||
try {
|
try {
|
||||||
console.log('Started deleting application (/) commands.');
|
console.log('Started deleting application (/) commands.');
|
||||||
|
|
||||||
@ -35,11 +35,11 @@ const rest = new REST({ version: '9' }).setToken(token);
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
})();
|
}
|
||||||
|
|
||||||
(async () => {
|
async function uploadCommands() {
|
||||||
try {
|
try {
|
||||||
console.log('Started refreshing application (/) commands.');
|
console.log('Started reloading application (/) commands.');
|
||||||
|
|
||||||
await rest.put(
|
await rest.put(
|
||||||
Routes.applicationCommands(clientId),
|
Routes.applicationCommands(clientId),
|
||||||
@ -51,4 +51,9 @@ const rest = new REST({ version: '9' }).setToken(token);
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
await deleteCommands();
|
||||||
|
await uploadCommands();
|
||||||
})();
|
})();
|
Loading…
Reference in New Issue
Block a user