Make API source dynamic based on configured URL

This commit is contained in:
agessaman
2025-09-07 15:10:55 -07:00
parent 20d59c2452
commit 39c7aedc05
+9 -2
View File
@@ -203,8 +203,15 @@ class PrefixCommand(BaseCommand):
# No additional info needed for database responses
pass
else:
# Add API source info
response += f"\nSource: map.w0z.is"
# Add API source info - extract domain from API URL
try:
from urllib.parse import urlparse
parsed_url = urlparse(self.api_url)
domain = parsed_url.netloc
response += f"\nSource: {domain}"
except Exception:
# Fallback if URL parsing fails
response += f"\nSource: API"
return response