diff --git a/src/modules/onReady.ts b/src/modules/onReady.ts index 7a2506d..207be73 100644 --- a/src/modules/onReady.ts +++ b/src/modules/onReady.ts @@ -5,7 +5,7 @@ import { Client } from "discord.js"; module.exports = { on_ready: async () => { console.log("A jedeš!"); - if (!process.argv[2] || process.argv[2] !== "0") return; + if (process.argv.length > 2) return; const client: Client = module.exports.client; const admin = client.users.cache.get("221561136028450816"); if (!admin) return; diff --git a/start.sh b/start.sh index 629f04c..65727d4 100644 --- a/start.sh +++ b/start.sh @@ -1,13 +1,15 @@ while true do cas=`date +"%s"` - if node . $? + if node . $neco then echo stahuju update git stash git pull + unset $neco else echo exit code byl $? + neco=neco novejcas=`date +"%s"` if (($cas+86400<$novejcas)) then