Spaces:
Paused
Paused
Download Telegram_Job_Bot/fix_markdown.py from telegramjobupload/README: direct link, hf CLI and curl.
- Browser
- Download file 957 Bytes
-
https://huggingface.co/spaces/telegramjobupload/README/resolve/main/Telegram_Job_Bot/fix_markdown.py
- Command line
-
hf download hf://spaces/telegramjobupload/README/Telegram_Job_Bot/fix_markdown.py
-
curl -L -o fix_markdown.py https://huggingface.co/spaces/telegramjobupload/README/resolve/main/Telegram_Job_Bot/fix_markdown.py
957 Bytes
| import re | |
| try: | |
| with open('main.py', 'r', encoding='utf-8') as f: | |
| content = f.read() | |
| old1 = 'bot.send_message(chat_id, f"{status_icon} *Instahyre Campaign Finished*\\n\\n{msg}", parse_mode="Markdown")' | |
| new1 = 'try: bot.send_message(chat_id, f"{status_icon} Instahyre Campaign Finished\\n\\n{msg}")\n except Exception as e: print("Telegram Error:", e)' | |
| content = content.replace(old1, new1) | |
| old2 = 'bot.send_message(chat_id, f"❌ *Instahyre Engine Crashed*\\n\\n{err_str}", parse_mode="Markdown")' | |
| new2 = 'try: bot.send_message(chat_id, f"❌ Instahyre Engine Crashed\\n\\n{err_str}")\n except Exception as e: print("Telegram Error:", e)' | |
| content = content.replace(old2, new2) | |
| with open('main.py', 'w', encoding='utf-8') as f: | |
| f.write(content) | |
| print("Successfully removed markdown parse_mode from final reports") | |
| except Exception as e: | |
| print("Error:", e) | |