diff --git a/app.py b/app.py index 0ad51cd..cb265f6 100644 --- a/app.py +++ b/app.py @@ -88,10 +88,9 @@ def check_urls(urls: List[str]): if not url: continue + print(f'Opening {url}') webbrowser.open(url) - print(f'Opened {url}') - def check_price(message: str) -> bool: prices = { @@ -142,11 +141,15 @@ def on_message(resp): if channel_id in MONITORED_CHANNELS: # search for urls in message text - urls.append(URL_REGEX.findall(content)) + urls.extend(URL_REGEX.findall(content)) # search for urls in embeds for e in embeds: - urls.append(URL_REGEX.findall(e['value'])) + for f in [x['value'] for x in e['fields']]: + urls.extend(URL_REGEX.findall(f)) + + if not urls: + print(m) if (urls): check_urls(urls)