From 1017fb648b1114106abe596663d26aa23fe12805 Mon Sep 17 00:00:00 2001 From: salmonik Date: Fri, 20 Feb 2026 18:35:36 +0100 Subject: fix settings file nagging --- cogs/vclogs.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'cogs/vclogs.py') diff --git a/cogs/vclogs.py b/cogs/vclogs.py index bc317a4..0d8ca3b 100644 --- a/cogs/vclogs.py +++ b/cogs/vclogs.py @@ -25,8 +25,8 @@ class VcLogs(commands.Cog): @staticmethod def settings_check(): - if not os.path.exists(settings_file): - with open(settings_file, 'w') as f: + if not os.path.exists(VcLogs.settings_file): + with open(VcLogs.settings_file, 'w') as f: json.dump({'volume': '5'}, f, indent=4) logger.info("settings.json created") @@ -67,8 +67,8 @@ class VcLogs(commands.Cog): tts = gTTS(text=text, lang='pl') tts.save(tts_file) - if os.path.exists(settings_file): - async with aiofiles.open(settings_file) as f: + if os.path.exists(VcLogs.settings_file): + async with aiofiles.open(VcLogs.settings_file) as f: data = json.load(f) volume = data['volume'] else: @@ -95,11 +95,11 @@ class VcLogs(commands.Cog): ) async def volume(self, ctx: discord.ApplicationContext, volume: int): try: - if not os.path.exists(settings_file): - async with aiofiles.open(settings_file, 'w') as f: + if not os.path.exists(VcLogs.settings_file): + async with aiofiles.open(VcLogs.settings_file, 'w') as f: json.dump({'volume': '5'}, f, indent=4) logger.info("settings.json created") - async with aiofiles.open(settings_file, 'w') as f: + async with aiofiles.open(VcLogs.settings_file, 'w') as f: json.dump({"volume": volume}, f, indent=4) await ctx.followup.send(f"Volume has been set to: {volume}") logger.info(f"Volume changed to: {volume}") -- cgit v1.2.3