diff --git a/config.py b/config.py index 00b0fe1..81fb28f 100644 --- a/config.py +++ b/config.py @@ -18,4 +18,5 @@ def get_settings(): "debug": os.getenv("DEBUG", "False") == "True", "token": os.getenv("TOKEN", ""), "time_based_merge": os.getenv("TIME_BASED_MERGE", "False").strip() in ["True", "true"], + "show_bridge_link": os.getenv("SHOW_BRIDGE_LINK", "False").strip() in ["True", "true"], } diff --git a/post_parser.py b/post_parser.py index 275d9e1..116aff5 100644 --- a/post_parser.py +++ b/post_parser.py @@ -509,13 +509,19 @@ class PostParser: channel_identifier = self.get_channel_username(message) if channel_identifier: links = [] + base_url = Config['pyrogram_bridge_url'] + if channel_identifier.startswith('-100'): # For channels with only ID channel_id = channel_identifier[4:] # Remove '-100' prefix for web links links.append(f'Open in Telegram') links.append(f'Open in Web') + if Config['show_bridge_link']: + links.append(f'Open in Bridge') else: # For channels with username links.append(f'Open in Telegram') links.append(f'Open in Web') + if Config['show_bridge_link']: + links.append(f'Open in Bridge') second_line_parts.extend(links) if second_line_parts: