Added script to update bot

This commit is contained in:
2024-10-13 20:13:48 +02:00
parent 449efbe288
commit 520928d4aa
2 changed files with 21 additions and 0 deletions

View File

@@ -8,3 +8,6 @@ DEVTOKEN=
CLIENTID=
DEVID=
GUILDID=
# watchtower
WATCHTOWERTOKEN=
WATCHTOWERURL=

18
scripts/updatebot.ts Normal file
View File

@@ -0,0 +1,18 @@
import axios from "axios"
const url = process.env.WATCHTOWERURL
const token = process.env.WATCHTOWERTOKEN
if (!url || !token) {
throw new Error("Missing WATCHTOWERURL or WATCHTOWERTOKEN")
}
await axios.get(url, {
headers: {
Authorization: `Bearer ${token}`
}
}).then(() => {
console.log("Illegitimate bot updated")
}).catch(err => {
console.error("Error updating bot", err)
})