Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 84682c015e | |||
| 798e9a89ba | |||
| 153566cf4c | |||
| 63a200aed2 | |||
| 18032a4683 |
@@ -46,6 +46,7 @@ python3 bot.py
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
* **v1.3**: revert to v1.1 and update requirements
|
||||||
* **v1.2**: don't quit on occasional exception
|
* **v1.2**: don't quit on occasional exception
|
||||||
* **v1.1**:
|
* **v1.1**:
|
||||||
* coma separator for big numbers
|
* coma separator for big numbers
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import os
|
import os
|
||||||
import traceback
|
|
||||||
import discord
|
import discord
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
@@ -9,7 +8,7 @@ import emotes
|
|||||||
import help
|
import help
|
||||||
from utils import debug
|
from utils import debug
|
||||||
|
|
||||||
VERSION = "1.2"
|
VERSION = "1.3"
|
||||||
t0 = datetime.now()
|
t0 = datetime.now()
|
||||||
|
|
||||||
# Loading token
|
# Loading token
|
||||||
@@ -90,20 +89,4 @@ async def on_message(message):
|
|||||||
|
|
||||||
print(f"Current PID: {os.getpid()}")
|
print(f"Current PID: {os.getpid()}")
|
||||||
|
|
||||||
# Launch client and rerun on errors
|
client.run(token)
|
||||||
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()}")
|
|
||||||
|
|||||||
+2
-2
@@ -1,2 +1,2 @@
|
|||||||
discord
|
discord.py
|
||||||
python-dotenv
|
python-dotenv
|
||||||
|
|||||||
Reference in New Issue
Block a user