check if LibreTranslate is running, add README

This commit is contained in:
Syping 2024-02-22 03:00:38 +01:00
parent f24b50ceae
commit 0c3e973a09
2 changed files with 20 additions and 1 deletions

16
README.md Normal file
View File

@ -0,0 +1,16 @@
## dtranslatebot
Open Source Discord Translation Bot
- Translate incoming channel messages to a Webhook
- Support configuration through slashcommands and JSON
- Cross-Platform
#### Database Location
``/root/dtranslatebot/db``
#### How To Run
```bash
docker run -d --name=dtranslatebot-ltd docker.io/syping/dtranslatebot-ltd $DISCORD_BOT_TOKEN
```
GitHub: [dtranslatebot](https://github.com/Syping/dtranslatebot), [dtranslatebot-container](https://github.com/Syping/dtranslatebot-container)

View File

@ -1,8 +1,8 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import json
import requests
import os
import requests
import subprocess
import sys
import time
@ -33,6 +33,9 @@ def main():
while True:
try:
if lt.poll():
print("[Error] LibreTranslate is not running")
return lt.returncode
r = requests.get("http://127.0.0.1:5000/languages", timeout=5)
if r.status_code == 200:
break;