mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-09 07:56:12 +02:00
build: attempt to restore Netlify build preview
This commit is contained in:
@@ -6,16 +6,13 @@ const Discord = require("discord.js")
|
||||
const fs = require("fs")
|
||||
const { Readable } = require("stream")
|
||||
|
||||
function execute() {
|
||||
const client = new Discord.Client()
|
||||
|
||||
const { BOT_TOKEN } = process.env
|
||||
const TPH = "244230771232079873"
|
||||
const DESTINATION = "./users.json"
|
||||
|
||||
if (!BOT_TOKEN) {
|
||||
throw Error("Missing BOT_TOKEN environment variable")
|
||||
}
|
||||
|
||||
const writeS = (content, dest) => {
|
||||
const source = new Readable()
|
||||
source.push(JSON.stringify(content))
|
||||
@@ -44,3 +41,10 @@ client.once("ready", async () => {
|
||||
|
||||
console.log("Attempting to log in...")
|
||||
client.login(BOT_TOKEN)
|
||||
}
|
||||
|
||||
if (process.env.BOT_TOKEN) {
|
||||
execute()
|
||||
} else {
|
||||
console.log("BOT_TOKEN missing, skipping.")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user