Upgrade dependencies

Added tests, revised logging

Removed dependency on env file

Try reformatting unit file

Comments clarification

Added readme

Added readme
This commit is contained in:
HugeFrog24
2024-10-22 20:07:06 +02:00
parent c8af457af1
commit d8d0da4704
22 changed files with 420 additions and 156 deletions

View File

@@ -0,0 +1,35 @@
[Unit]
# A concise description of the service
Description=Telegram Bot Service
# Postpone starting until network is available
After=network.target
[Service]
# The user that runs the bot
User=tibik
# The directory where the bot is located
WorkingDirectory=/home/tibik/go-telegram-bot
# The command to start the bot
ExecStart=/home/tibik/go-telegram-bot/telegram-bot
# Restart if crashed
Restart=always
# Delay between restarts to avoid resource exhaustion
RestartSec=5
# Capture stdout (INFO logs)
StandardOutput=journal
# Capture stderr (ERROR logs)
StandardError=journal
# Identifier for journalctl filtering
SyslogIdentifier=telegram-bot
[Install]
# The bot will start automatically at system boot
WantedBy=multi-user.target
# NOTE:
# New line comments: good
# Inline comments: no good, they mess up the service file
# View logs: journalctl -u telegram-bot
# Follow logs: journalctl -u telegram-bot -f
# View errors: journalctl -u telegram-bot -p err