From 74297067d8c3ae17adaeeedb224197b2bfeb70ae Mon Sep 17 00:00:00 2001 From: Jannover5000r Date: Fri, 14 Nov 2025 08:44:40 +0100 Subject: [PATCH] Accounts.json will now be saved in the accounts directory --- .gitignore | 2 +- Botrun/BotStart.go | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 5544504..a2887b3 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ teachers.json login.json timetable*.json timetableFilled*.json -accounts.json +accounts/ login_*.json AGENTS.md untislogger diff --git a/Botrun/BotStart.go b/Botrun/BotStart.go index dc4b9ab..6338df3 100644 --- a/Botrun/BotStart.go +++ b/Botrun/BotStart.go @@ -39,7 +39,7 @@ type UserState struct { var ( userStates = make(map[string]*UserState) // userID -> state stateMutex sync.Mutex // protect userStates - accountsFile = "accounts.json" + accountsFile = "accounts/accounts.json" ) var encryptionKey []byte diff --git a/README.md b/README.md index fb7ca71..96cd7fe 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ # This is a discord application intended for self hosting. You will need to add an application in the [disord developer website](https://discord.com/developers/applications) for this bot mainly with the read messages and write messages privelege as well as send privat messages for the account handling. If you give it administrator permissions you dont have to worry further but this could present you with a security risk if my github account gets compromised and a malicious update to the script gets pushed which you than use since the bot got access to your whole server -# I also recommend to use a tool like [coolify](https://coolify.io/) to host the bot. Make sure to add the Env's and add **accounts.json** to persistant storage +# I also recommend to use a tool like [coolify](https://coolify.io/) to host the bot. Make sure to add the Env's and add the **accounts/** folder to persistent storage ### This bot is self hosted and will run correctly when doing "go run . " in the root folder of the project. **Before usage add the .env file with the Credentials as mentioned above.** When you run the Program for the first time, all important files will be created automatically and the bot is ready to go. The user added via the fields UNTIS_USER and UNTIS_PASSWORD in the .env will be the one where the Webhook is sourced from and the other users will be send a DM after adding their account with the command. Add the Discord Webhook via the DISCORD_WEBHOOK_URL point in the .env and will send the messages for the timetable in there