Spaces:
Sleeping
Sleeping
Update main.py
Browse files19 unmodified lines2021222324252627282930313219 unmodified lines@app.on_event("startup")async def on_startup():try:response = await client.get(os.getenv('telegramUrlBot') + '/setWebhook?url=https://matteoscript-TelegramBotSimple.hf.space/OLD')response = await client.get(os.getenv('telegramUrlBot') + '/setWebhook?url=https://matteoscript-TelegramBotSimple.hf.space/')response.raise_for_status()print("Webhook set successfully")except httpx.HTTPError as e:print(f"Error setting webhook: {e}")@app.post("/")async def RispondiMessaggio(data: dict):19 unmodified lines2021222324252627282919 unmodified lines@app.on_event("startup")async def on_startup():print('start up')response = client.get(os.getenv('telegramUrlBot') + '/setWebhook?url=https://matteoscript-TelegramBotSimple.hf.space/OLD')response = client.get(os.getenv('telegramUrlBot') + '/setWebhook?url=https://matteoscript-TelegramBotSimple.hf.space/')print('webhook settato')@app.post("/")async def RispondiMessaggio(data: dict):
main.py+4-7