How to deploy a telegram bot written in Python to .

I am a telegram bot developer at python. Telegram bots work on long polling and webhook. Long polling is used a lot.

I was using procfile to run long polling projects on heroku


worker: python

Python file:

import logging

from aiogram import Bot, Dispatcher, executor, types


# Configure logging

# Initialize bot and dispatcher
bot = Bot(token=API_TOKEN)
dp = Dispatcher(bot)

@dp.message_handler(commands=['start', 'help'])
async def send_welcome(message: types.Message):
    This handler will be called when user sends `/start` or `/help` command
    await message.reply("Hi!\nI'm EchoBot!\nPowered by aiogram.")

async def echo(message: types.Message):
    # echo message
    await message.answer(message.text)

if __name__ == '__main__':
    executor.start_polling(dp, skip_updates=True)

How do I start long polling projects in ???

1 Like