Added script to update bot
This commit is contained in:
@@ -8,3 +8,6 @@ DEVTOKEN=
|
|||||||
CLIENTID=
|
CLIENTID=
|
||||||
DEVID=
|
DEVID=
|
||||||
GUILDID=
|
GUILDID=
|
||||||
|
# watchtower
|
||||||
|
WATCHTOWERTOKEN=
|
||||||
|
WATCHTOWERURL=
|
||||||
|
|||||||
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