Merge branch 'dev' into 'main'
Dev See merge request illegitimate/illegitimate-bot!302
This commit is contained in:
@@ -9,6 +9,7 @@ scripts
|
||||
.dockerignore
|
||||
.env
|
||||
.env.example
|
||||
.envrc
|
||||
.gitignore
|
||||
.gitlab-ci.yml
|
||||
.node-version
|
||||
|
||||
@@ -8,3 +8,6 @@ DEVTOKEN=
|
||||
CLIENTID=
|
||||
DEVID=
|
||||
GUILDID=
|
||||
# watchtower
|
||||
WATCHTOWERTOKEN=
|
||||
WATCHTOWERURL=
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
"db:studio": "drizzle-kit studio",
|
||||
"db:start": "docker compose -f dev-db.yml up -d",
|
||||
"db:stop": "docker compose -f dev-db.yml down",
|
||||
"bot:update": "tsx scripts/update-bot.ts",
|
||||
"push:prod": "tsx scripts/deploy-commands.ts",
|
||||
"push:dev": "tsx scripts/dev-deploy.ts",
|
||||
"delete:dev": "tsx scripts/delete-commands.ts"
|
||||
|
||||
18
scripts/update-bot.ts
Normal file
18
scripts/update-bot.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