Spaces:
Sleeping
Sleeping
Update bot.py
Browse files
bot.py
CHANGED
|
@@ -3,7 +3,7 @@ from pathlib import Path
|
|
| 3 |
|
| 4 |
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup, Bot
|
| 5 |
from telegram.ext import Application, CommandHandler, MessageHandler, filters, ContextTypes
|
| 6 |
-
from telegram.
|
| 7 |
|
| 8 |
from motor.motor_asyncio import AsyncIOMotorClient
|
| 9 |
from config import BOT_TOKEN, ADMIN_ID, MONGO_URI, DB_NAME
|
|
@@ -181,11 +181,11 @@ async def main():
|
|
| 181 |
await init_stats()
|
| 182 |
|
| 183 |
# --- Telegram Bot with proxy ---
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
|
| 188 |
-
|
| 189 |
|
| 190 |
# --- Handlers ---
|
| 191 |
app.add_handler(CommandHandler("start", start))
|
|
|
|
| 3 |
|
| 4 |
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup, Bot
|
| 5 |
from telegram.ext import Application, CommandHandler, MessageHandler, filters, ContextTypes
|
| 6 |
+
from telegram.request import Request # <-- updated import
|
| 7 |
|
| 8 |
from motor.motor_asyncio import AsyncIOMotorClient
|
| 9 |
from config import BOT_TOKEN, ADMIN_ID, MONGO_URI, DB_NAME
|
|
|
|
| 181 |
await init_stats()
|
| 182 |
|
| 183 |
# --- Telegram Bot with proxy ---
|
| 184 |
+
# Use your Vercel JS proxy
|
| 185 |
+
PROXY_URL = "https://jerryproxy.vercel.app/api/proxy?url="
|
| 186 |
+
request = Request(proxy_url=PROXY_URL)
|
| 187 |
|
| 188 |
+
app = Application.builder().token(BOT_TOKEN).request(request).build()
|
| 189 |
|
| 190 |
# --- Handlers ---
|
| 191 |
app.add_handler(CommandHandler("start", start))
|