|
import telebot |
|
from fastapi import FastAPI, Request |
|
import uvicorn |
|
|
|
|
|
TOKEN = "6655373829:AAGduLdLyNx7zUtxH73Sp3Z1vHKS35tV9WU" |
|
WEBHOOK_URL = "https://astraos-testing.hf.space/webhook" |
|
|
|
bot = telebot.TeleBot(TOKEN, parse_mode="HTML") |
|
|
|
|
|
@bot.message_handler(commands=['start']) |
|
def handle_start(message): |
|
bot.reply_to(message, "Hello! This is a webhook-only Telebot running with FastAPI.") |
|
|
|
@bot.message_handler(func=lambda message: True) |
|
def echo_all(message): |
|
bot.reply_to(message, f"You said: {message.text}") |
|
|
|
if __name__ == '__main__': |
|
|
|
|
|
|
|
bot.run_webhooks( |
|
listen='127.0.0.1', |
|
port=443, |
|
url_path='webhook', |
|
webhook_url=WEBHOOK_URL, |
|
certificate=None, |
|
certificate_key=None, |
|
max_connections=40, |
|
allowed_updates=None, |
|
ip_address=None, |
|
drop_pending_updates=False, |
|
timeout=20, |
|
secret_token=None, |
|
secret_token_length=20 |
|
) |
|
|