Spaces:
Paused
Paused
Download Telegram_Job_Bot/fix_main.py from telegramjobupload/README: direct link, hf CLI and curl.
- Browser
- Download file 796 Bytes
-
https://huggingface.co/spaces/telegramjobupload/README/resolve/main/Telegram_Job_Bot/fix_main.py
- Command line
-
hf download hf://spaces/telegramjobupload/README/Telegram_Job_Bot/fix_main.py
-
curl -L -o fix_main.py https://huggingface.co/spaces/telegramjobupload/README/resolve/main/Telegram_Job_Bot/fix_main.py
796 Bytes
| import re | |
| try: | |
| with open('main.py', 'r', encoding='utf-8') as f: | |
| content = f.read() | |
| old_pattern = re.compile(r'if bot and chat_id:\n\s+try: bot\.send_message\(chat_id.*?except: pass', re.DOTALL) | |
| new_code = '''if bot and chat_id: | |
| try: bot.send_message(chat_id, \"🚀 Instahyre Campaign Launched!\\n\\nThe stealth engine has started in the background. It will automatically apply to 20 Fresher Software Engineer roles. Please wait 5-10 minutes for the final report.\") | |
| except Exception as e: print(f\"[Telegram Error] {e}\")''' | |
| content = old_pattern.sub(new_code, content) | |
| with open('main.py', 'w', encoding='utf-8') as f: | |
| f.write(content) | |
| print("Successfully patched main.py") | |
| except Exception as e: | |
| print("Error:", e) | |