From 67123115d2896a482930b619239458f5ad467d2b Mon Sep 17 00:00:00 2001 From: sakura_x64 Date: Thu, 9 Jun 2022 18:52:12 +0200 Subject: [PATCH] comments --- load.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/load.py b/load.py index b80e8fa..876af49 100644 --- a/load.py +++ b/load.py @@ -699,6 +699,8 @@ def display_data(title, data, tick_mode): Discord.focus() #ttk.Button(ContainerFrame, text="Copy to Clipboard", command=partial(copy_to_clipboard, ContainerFrame, Discord)).pack(side=tk.LEFT, padx=5, pady=5) + + #check if generate_discord_text() returns empty string before displaying post button if is_webhook_valid() and generate_discord_text(data) != "": ttk.Button(ContainerFrame, text="Post to Discord", command=partial(post_to_discord, ContainerFrame, Discord, tick_mode)).pack(side=tk.RIGHT, padx=5, pady=5) theme.update(ContainerFrame) @@ -872,6 +874,7 @@ def generate_discord_text(data): discord_text += f"```css\n{data[i][0]['System']}\n{system_discord_text}```" if system_discord_text != "" else "" + #check if discord text is empty before adding cia text if discord_text != "": discord_text += "\nGenerated by CIA-BGS-Tally."