5 Commits

Author SHA1 Message Date
Klemek 84682c015e Merge pull request #3 from Klemek/dev
release v1.3
2019-11-27 11:15:09 +01:00
Klemek 798e9a89ba Update bot.py 2019-11-27 11:14:20 +01:00
Klemek 153566cf4c Removed rerun of client
Error was in discord lib, handled with requirements
2019-11-27 11:13:54 +01:00
Klemek 63a200aed2 Update README.md 2019-11-27 11:12:39 +01:00
Klemek 18032a4683 Updated requirements.txt 2019-11-27 11:11:44 +01:00
3 changed files with 5 additions and 21 deletions
+1
View File
@@ -46,6 +46,7 @@ python3 bot.py
## Changelog
* **v1.3**: revert to v1.1 and update requirements
* **v1.2**: don't quit on occasional exception
* **v1.1**:
* coma separator for big numbers
+2 -19
View File
@@ -1,5 +1,4 @@
import os
import traceback
import discord
from datetime import datetime
from dotenv import load_dotenv
@@ -9,7 +8,7 @@ import emotes
import help
from utils import debug
VERSION = "1.2"
VERSION = "1.3"
t0 = datetime.now()
# Loading token
@@ -90,20 +89,4 @@ async def on_message(message):
print(f"Current PID: {os.getpid()}")
# Launch client and rerun on errors
while True:
try:
client.run(token)
break # clean kill
except Exception as e:
t = datetime.now()
print(f"Exception raised at {t:%Y-%m-%d %H:%M} : {repr(e)}")
fileName = f"error_{t:%Y-%m-%d_%H-%M-%S}.txt"
if os.path.exists(fileName):
print("Two many errors, killing")
break
with open(fileName, 'w') as f:
f.write(f"Discord Analyst v{VERSION} started at {t0:%Y-%m-%d %H:%M}\r\n"
f"Exception raised at {t:%Y-%m-%d %H:%M}\r\n"
f"\r\n"
f"{traceback.format_exc()}")
client.run(token)
+2 -2
View File
@@ -1,2 +1,2 @@
discord
python-dotenv
discord.py
python-dotenv