Forums

"Webhook is already deleted"

Hi everyone! Can you help me? i have a tg bot on aiogram, so when i deploy it in pythonanywhere, i have this message from telegram api :

{"ok":true,"result":true,"description":"Webhook is already deleted"}

but in bash console, i have message :

INFO:aiogram:Bot: ProstorSMS [@ProstorSMSHelpBot] WARNING:aiogram:Updates were skipped successfully. Это бот ПросторСМС ======== Running on http://0.0.0.0:3128 ======== (Press CTRL+C to quit)

And bot doesnt working :( Help pls, when i have a mistake and what i need to do?

code:

from aiogram.utils import executor from create_bot import dp, bot from hendlers import other, client, documents, bank_pay, specials, card_pay, new_client, manager_connect from aiogram.dispatcher import Dispatcher import config, os NAME_APP = os.getenv('artemjkaa') WEBHOOK_HOST = f'https://{NAME_APP}.pythonanywhere.com' WEBHOOK_PATH = F'/webhook/{config.TOKEN}' WEBHOOK_URL = f'{WEBHOOK_HOST}{WEBHOOK_PATH}'

async def on_startup(dp): await bot.set_webhook(WEBHOOK_URL, drop_pending_updates=True) print('Это бот ПросторСМС')

async def on_shutdown(dp): await bot.delete_webhook()

client.regiser_handlers_other(dp) other.regiser_handlers_other(dp) documents.regiser_handlers_other(dp) bank_pay.regiser_handlers_other(dp) specials.regiser_handlers_other(dp) card_pay.regiser_handlers_other(dp) new_client.regiser_handlers_other(dp) manager_connect.regiser_handlers_other(dp) if name == 'main': executor.start_webhook( dispatcher=dp, webhook_path=WEBHOOK_PATH, on_startup=on_startup, on_shutdown=on_shutdown, skip_updates=True, host = "0.0.0.0", port = os.getenv("PORT", default=3128))

You are not able to run a code visible to the outside word in the console. The only way to do it on PythonAnywhere is a web app. But the bot like that would not work there as web apps have to be wsgi apps.