Spaces:
Sleeping
Sleeping
Update main.py
Browse files19 unmodified lines202122232425262728292324252627282919 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}") 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