#!/usr/bin/env python3 """ Test Telegram integration in HF Spaces environment """ import os from services.telegram import send_telegram # Simulate HF Spaces environment os.environ['SPACE_ID'] = 'test-space-id' os.environ['HF_SPACE_HOST'] = 'test.hf.space' def test_hf_telegram(): print("๐Ÿงช Testing Telegram in HF Spaces environment...") test_message = "๐Ÿงช HF Spaces Test Message - This should not actually send" try: send_telegram(test_message) print("โœ… HF Spaces telegram handling works - no network errors!") return True except Exception as e: print(f"โŒ Error: {e}") return False if __name__ == "__main__": success = test_hf_telegram() if success: print("\n๐ŸŽ‰ HF Spaces telegram integration is working correctly!") print("The bot will run without network errors in HF Spaces.") else: print("\nโŒ HF Spaces telegram integration needs fixing.")