Pid 51 -54 error

i have a simple code telegram bot

import logging
import os
from flask import Flask
from telegram.ext import Updater, CommandHandler

app = Flask(name)

def start(update, context):
context.bot.send_message(chat_id=update.effective_chat.id, text=“Merhaba!”)

def hello(update, context):
context.bot.send_message(chat_id=update.effective_chat.id, text=“Selam!”)

def main():
token = ‘YOUR_TELEGRAM_BOT_TOKEN’
updater = Updater(token=token, use_context=True)
dispatcher = updater.dispatcher
start_handler = CommandHandler(‘start’, start)
dispatcher.add_handler(start_handler)
hello_handler = CommandHandler(‘hello’, hello)
dispatcher.add_handler(hello_handler)

port = int(os.environ.get("PORT", 5000))
app.run(host='0.0.0.0', port=port)

if name == ‘main’:
logging.basicConfig(level=logging.INFO)
main()

i am getting these errors
Pid51
Ve
Pid54

Hi,

Bots are best deployed to us using a Background Worker - these run persistently in the background and don’t expose any web server.

If you try and run a bot via a Web Service, the deployment will probably fail, typically about 10 minutes after you’ve deployed it, and sometimes there are scenarios where 2 may be running for a period of time, this is down to our zero-downtime feature and not something that can be disabled.

If this doesn’t answer your question, just let us know, and we’ll try and help where we can. Providing a more complete set of logs would also be useful for troubleshooting. But a good first step would be to ensure you’re running this as a private service.

Best,

Matt

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.