Added logger to scripts
This commit is contained in:
@@ -5,12 +5,12 @@ import { log } from "../src/utils/Logger.js"
|
||||
const rest = new REST({ version: "10" }).setToken(env.dev.devtoken)
|
||||
|
||||
try {
|
||||
log("Started deleting application (/) commands.")
|
||||
log("Started deleting application (/) commands.", "info")
|
||||
await rest.put(
|
||||
Routes.applicationGuildCommands(env.dev.devid, env.dev.guildid),
|
||||
{ body: [] }
|
||||
)
|
||||
log("Successfully deleted application (/) commands.")
|
||||
log("Successfully deleted application (/) commands.", "info")
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
@@ -23,13 +23,13 @@ for (const file of contentMenuCommands) {
|
||||
}
|
||||
|
||||
try {
|
||||
log(`Started refreshing ${commands.length} application (/) commands.`)
|
||||
log(`Started refreshing ${commands.length} application (/) commands.`, "info")
|
||||
|
||||
await rest.put(
|
||||
Routes.applicationGuildCommands(env.dev.devid, env.dev.guildid),
|
||||
{ body: commands }
|
||||
).then(() => {
|
||||
log(`Successfully reloaded ${commands.length} application (/) commands.`)
|
||||
log(`Successfully reloaded ${commands.length} application (/) commands.`, "info")
|
||||
process.exit(0)
|
||||
})
|
||||
} catch (error) {
|
||||
|
||||
@@ -13,7 +13,7 @@ await axios.get(url, {
|
||||
Authorization: `Bearer ${token}`
|
||||
}
|
||||
}).then(() => {
|
||||
log("Illegitimate bot updated")
|
||||
log("Illegitimate bot updated", "info")
|
||||
}).catch(err => {
|
||||
console.error("Error updating bot", err)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user