From bef0c5e3b6cf0d5fd54bf6bb0bf07edb9b69281b Mon Sep 17 00:00:00 2001 From: snipe_blaze <72265661+notsniped@users.noreply.github.com> Date: Thu, 8 Jun 2023 22:55:33 +0530 Subject: [PATCH 1/7] Edit license details at startup to be more suitable --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index fd327dfd..f109247b 100644 --- a/main.py +++ b/main.py @@ -81,9 +81,9 @@ def save(): async def on_ready(): print(""" Isobot Copyright (C) 2022 PyBotDevs/NKA -This program comes with ABSOLUTELY NO WARRANTY; for details run `/w'. +This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it -under certain conditions; run `/c' for details. +under certain conditions. __________________________________________________""") time.sleep(2) print(f'Logged in as {client.user.name}.') From 3221ec6671c0f7d1bb283873628ea71508b9f586 Mon Sep 17 00:00:00 2001 From: snipe_blaze <72265661+notsniped@users.noreply.github.com> Date: Thu, 8 Jun 2023 22:56:11 +0530 Subject: [PATCH 2/7] Reduce set delay between license display and startup info --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index f109247b..0a2f314a 100644 --- a/main.py +++ b/main.py @@ -85,9 +85,9 @@ async def on_ready(): This is free software, and you are welcome to redistribute it under certain conditions. __________________________________________________""") - time.sleep(2) print(f'Logged in as {client.user.name}.') print('Ready to accept commands.') + time.sleep(1) await client.change_presence(activity=discord.Activity(type=discord.ActivityType.playing, name="GitHub"), status=discord.Status.idle) print(f'[main/LOG] {colors.green}Status set to IDLE. Rich presence set.{colors.end}') print("[main/FLASK] Starting pinger service...") From a4ba8aba8f53f1cf6034d95be42a3fd831529e42 Mon Sep 17 00:00:00 2001 From: snipe_blaze <72265661+notsniped@users.noreply.github.com> Date: Thu, 8 Jun 2023 22:57:01 +0530 Subject: [PATCH 3/7] Move print statements from multi-line to single line --- main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.py b/main.py index 0a2f314a..7768b1b6 100644 --- a/main.py +++ b/main.py @@ -85,9 +85,8 @@ async def on_ready(): This is free software, and you are welcome to redistribute it under certain conditions. __________________________________________________""") - print(f'Logged in as {client.user.name}.') - print('Ready to accept commands.') time.sleep(1) + print(f'[main/Client] Logged in as {client.user.name}.\n[main/Client] Ready to accept commands.') await client.change_presence(activity=discord.Activity(type=discord.ActivityType.playing, name="GitHub"), status=discord.Status.idle) print(f'[main/LOG] {colors.green}Status set to IDLE. Rich presence set.{colors.end}') print("[main/FLASK] Starting pinger service...") From 255ca6661e259ef00c2c8b3109b3de00acf4a980 Mon Sep 17 00:00:00 2001 From: snipe_blaze <72265661+notsniped@users.noreply.github.com> Date: Thu, 8 Jun 2023 22:57:45 +0530 Subject: [PATCH 4/7] Change logging attribute style from capitals to normal --- main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 7768b1b6..f9938372 100644 --- a/main.py +++ b/main.py @@ -88,8 +88,8 @@ async def on_ready(): time.sleep(1) print(f'[main/Client] Logged in as {client.user.name}.\n[main/Client] Ready to accept commands.') await client.change_presence(activity=discord.Activity(type=discord.ActivityType.playing, name="GitHub"), status=discord.Status.idle) - print(f'[main/LOG] {colors.green}Status set to IDLE. Rich presence set.{colors.end}') - print("[main/FLASK] Starting pinger service...") + print(f'[main/Log] {colors.green}Status set to IDLE. Rich presence set.{colors.end}') + print("[main/Flask] Starting pinger service...") utils.ping.host() time.sleep(5) @@ -303,10 +303,10 @@ async def reload(ctx: ApplicationContext, cog: str): else: print(f"[main/Cogs] {colors.yellow}{cog_errors}/{len(active_cogs)} cogs failed to load.{colors.end}") print("--------------------") if api.auth.get_mode(): - print(f"[main/CLIENT] Starting client in {colors.cyan}Replit mode{colors.end}...") + print(f"[main/Client] Starting client in {colors.cyan}Replit mode{colors.end}...") client.run(os.getenv("TOKEN")) else: - print(f"[main/CLIENT] Starting client in {colors.orange}local mode{colors.end}...") + print(f"[main/Client] Starting client in {colors.orange}local mode{colors.end}...") client.run(api.auth.get_token()) From 212b391451031445e8cbf28afd6fdccf664ce505 Mon Sep 17 00:00:00 2001 From: snipe_blaze <72265661+notsniped@users.noreply.github.com> Date: Thu, 8 Jun 2023 22:58:22 +0530 Subject: [PATCH 5/7] Remove trailing whitespace --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index f9938372..d78b806e 100644 --- a/main.py +++ b/main.py @@ -101,7 +101,7 @@ async def on_message(ctx): new_userdat(ctx.author.id) if str(ctx.author.id) not in items: items[str(ctx.author.id)] = {} if str(ctx.author.id) not in levels: levels[str(ctx.author.id)] = {"xp": 0, "level": 0} - if str(ctx.guild.id) not in automod_config: + if str(ctx.guild.id) not in automod_config: automod_config[str(ctx.guild.id)] = { "swear_filter": { "enabled": False, From b38e77d6c47d821cdc36bdd478381558ac713405 Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Thu, 8 Jun 2023 23:32:33 +0530 Subject: [PATCH 6/7] Remove disabled class instances for isobank --- main.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/main.py b/main.py index d78b806e..48e849da 100644 --- a/main.py +++ b/main.py @@ -63,8 +63,6 @@ def save(): #Framework Module Loader colors = framework.isobot.colors.Colors() currency = framework.isobot.currency.CurrencyAPI("database/currency.json", "logs/currency.log") -# isobank = framework.isobank.manager.IsoBankManager(f"{wdir}/database/isobank/accounts.json", f"{wdir}/database/isobank/auth.json") -# isobankauth = framework.isobank.authorize.IsobankAuth(f"{wdir}/database/isobank/auth.json", f"{wdir}/database/isobank/accounts.json") # Theme Loader #with open("themes/halloween.theme.json", 'r', encoding="utf-8") as f: From 0477e171d41c34518a5d31d9e4d0563cb65cdc49 Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Thu, 8 Jun 2023 23:34:30 +0530 Subject: [PATCH 7/7] Add bool setting to toggle `load themes` --- main.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index 48e849da..4714b6af 100644 --- a/main.py +++ b/main.py @@ -65,14 +65,18 @@ def save(): currency = framework.isobot.currency.CurrencyAPI("database/currency.json", "logs/currency.log") # Theme Loader -#with open("themes/halloween.theme.json", 'r', encoding="utf-8") as f: -# theme = json.load(f) -# try: -# color_loaded = theme["theme"]["embed_color"] -# color = int(color_loaded, 16) -# except KeyError: -# print(f"{colors.red}The theme file being loaded might be broken. Rolling back to default configuration...{colors.end}") -# color = discord.Color.random() +themes = False # True: enables themes; False: disables themes; + +if themes: + with open("themes/halloween.theme.json", 'r', encoding="utf-8") as f: + theme = json.load(f) + try: + color_loaded = theme["theme"]["embed_color"] + color = int(color_loaded, 16) + except KeyError: + print(f"{colors.red}The theme file being loaded might be broken. Rolling back to default configuration...{colors.end}") + color = discord.Color.random() +else: color = discord.Color.random() #Events @client.event