Compare commits

..

2 Commits

Author SHA1 Message Date
e421bd1de9
log complete update 2023-04-07 10:13:55 +10:00
132096b427
fix move command 2023-04-07 10:13:54 +10:00

5
bot.py
View File

@ -4,8 +4,8 @@ from discord.utils import setup_logging
import argparse import argparse
import discord import discord
import logging import logging
import os
import re import re
import shutil
import subprocess as sp import subprocess as sp
discord.utils.setup_logging() discord.utils.setup_logging()
@ -32,7 +32,8 @@ def _update_db():
for line in f: for line in f:
games.append(line.strip()) games.append(line.strip())
sp.run(["./index.py", "-o", _DB] + games) sp.run(["./index.py", "-o", _DB] + games)
os.rename(_DB, _DB_DEST) shutil.move(_DB, _DB_DEST)
_log.info("updated db")
except: except:
_log.exception(f"failed updating db") _log.exception(f"failed updating db")