Added script to update bot
This commit is contained in:
18
scripts/updatebot.ts
Normal file
18
scripts/updatebot.ts
Normal 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)
|
||||
})
|
||||
Reference in New Issue
Block a user