Update app.py
Browse files
app.py
CHANGED
|
@@ -233,14 +233,25 @@ async def notify_boss_messages(bot: Bot):
|
|
| 233 |
|
| 234 |
|
| 235 |
async def main():
|
|
|
|
|
|
|
|
|
|
| 236 |
if not Config.BOT_TOKEN:
|
| 237 |
raise RuntimeError("BOT_TOKEN is missing")
|
| 238 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
scheduler.set_bot(bot)
|
| 240 |
await scheduler.start()
|
| 241 |
asyncio.create_task(notify_boss_messages(bot))
|
| 242 |
await dp.start_polling(bot)
|
| 243 |
|
| 244 |
-
|
| 245 |
if __name__ == "__main__":
|
| 246 |
asyncio.run(main())
|
|
|
|
| 233 |
|
| 234 |
|
| 235 |
async def main():
|
| 236 |
+
from aiogram.client.session.aiohttp import AiohttpSession
|
| 237 |
+
from aiogram.client.telegram import TelegramAPIServer
|
| 238 |
+
|
| 239 |
if not Config.BOT_TOKEN:
|
| 240 |
raise RuntimeError("BOT_TOKEN is missing")
|
| 241 |
+
|
| 242 |
+
# ⚡️ THE BRUKGUARDIAN PROXY HIJACK ⚡️
|
| 243 |
+
# This grabs your Cloudflare Worker URL from agent1.py and smashes the DNS block!
|
| 244 |
+
custom_session = AiohttpSession(
|
| 245 |
+
api=TelegramAPIServer.from_base(Config.PROXY_TARGET)
|
| 246 |
+
)
|
| 247 |
+
|
| 248 |
+
# Initialize the bot using our custom, unblockable session
|
| 249 |
+
bot = Bot(token=Config.BOT_TOKEN, session=custom_session)
|
| 250 |
+
|
| 251 |
scheduler.set_bot(bot)
|
| 252 |
await scheduler.start()
|
| 253 |
asyncio.create_task(notify_boss_messages(bot))
|
| 254 |
await dp.start_polling(bot)
|
| 255 |
|
|
|
|
| 256 |
if __name__ == "__main__":
|
| 257 |
asyncio.run(main())
|