diff --git a/sausage_bot/cogs/scrape_fcb_news.py b/sausage_bot/cogs/scrape_fcb_news.py index 038174d..1e9f3c1 100755 --- a/sausage_bot/cogs/scrape_fcb_news.py +++ b/sausage_bot/cogs/scrape_fcb_news.py @@ -72,7 +72,7 @@ async def barca_posting_stop( ) # Tasks - @tasks.loop(minutes=int(config.env('FCB_LOOP', default=5))) + @tasks.loop(minutes=config.env.int('FCB_LOOP', default=5)) async def post_fcb_news(): ''' Post news from https://www.fcbarcelona.com to specific team channels diff --git a/sausage_bot/util/file_io.py b/sausage_bot/util/file_io.py index aefce6e..dac7c5d 100755 --- a/sausage_bot/util/file_io.py +++ b/sausage_bot/util/file_io.py @@ -100,7 +100,7 @@ def file_exist(filename): False ''' try: - os.stat(filename, follow_symlinks=True) + os.stat(str(filename), follow_symlinks=True) return True except FileNotFoundError: return False diff --git a/sausage_bot/util/log/log.py b/sausage_bot/util/log/log.py index 95fb896..08fafa5 100755 --- a/sausage_bot/util/log/log.py +++ b/sausage_bot/util/log/log.py @@ -105,12 +105,12 @@ def log_function( print(log_out) if extra_info: log_out = '[ {} ] '.format(extra_info) - log_out += '[ {} ] '.format(function_name['line']) - log_out += '[ {} ] '.format(function_name['name']) - log_out += str(log_in) - else: + log_out += '[ {} ] '.format(function_name['line']) + log_out += '[ {} ] '.format(function_name['name']) + log_out += str(log_in) + if args.log_file: dt = pendulum.now(config.TIMEZONE) - _dt_rev = dt.format('YYYY-MM-DD HH.mm.ss') + _dt_rev = dt.format('YYYY-MM-DD') _logfilename = envs.LOG_DIR / f'{_dt_rev}.log' write_log = open(_logfilename, 'a+', encoding="utf-8") write_log.write(log_out)