Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ discord.js library to interact with Discord and fetches server stats via the XML

## Running the Bot

### Option 1: Run Inside a Docker Container
### Option 1: Run Inside a Docker Container (Recommended)

1. Navigate to the root directory of the cloned repository.
2. Build and start the container:
Expand Down
18 changes: 17 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,20 @@ services:
container_name: ls25bot
restart: always
volumes:
- ./config.json:/app/config.json
- ./config.json:/app/config.json

restart:
image: docker:cli
restart: unless-stopped
container_name: ls25bot-restart
volumes:
- /var/run/docker.sock:/var/run/docker.sock
entrypoint: [ "/bin/sh","-c" ]
command:
- |
echo "Restarting ls25bot container is running"
while true; do
sleep 7200 # Each 2 hours
echo "Restarting ls25bot container at $(date)"
docker restart ls25bot
done
2 changes: 1 addition & 1 deletion source/Main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ discordClient.login(appConfig.discord.botToken).then(() => {
/**
* Start the DiscordService and restart it if an error occurred
*/
function startDiscordService(): void {
async function startDiscordService(): Promise<void> {
try {
new DiscordService(discordClient);
} catch (exception) {
Expand Down