Conflict: terminated by other getUpdates request; make sure that only one bot instance is running

We Are Going To Discuss About Conflict: terminated by other getUpdates request; make sure that only one bot instance is running. So lets Start this Python Article.

Conflict: terminated by other getUpdates request; make sure that only one bot instance is running

  1. How to solve Conflict: terminated by other getUpdates request; make sure that only one bot instance is running

    This happens when 2 different clients send getUpdates method to Telegram servers for one bot token.
    You should make sure you're not running your script more than once at the same time, or your bot token is not used somewhere else.
    If you're certain that your script is executing alone and there are no other instances, then revoke your bot token from https://t.me/botfather and get a new token.

  2. Conflict: terminated by other getUpdates request; make sure that only one bot instance is running

    This happens when 2 different clients send getUpdates method to Telegram servers for one bot token.
    You should make sure you're not running your script more than once at the same time, or your bot token is not used somewhere else.
    If you're certain that your script is executing alone and there are no other instances, then revoke your bot token from https://t.me/botfather and get a new token.

Solution 1

This happens when 2 different clients send getUpdates method to Telegram servers for one bot token.

You should make sure you’re not running your script more than once at the same time, or your bot token is not used somewhere else.

If you’re certain that your script is executing alone and there are no other instances, then revoke your bot token from https://t.me/botfather and get a new token.

Original Author Ali Padida Of This Content

Solution 2

I fix this issue arranging code like this :

from telegram.ext import CommandHandler, Updater
from logging import basicConfig, getLogger, INFO

basicConfig(level=INFO)
log = getLogger()

def start(update, context):
    update.message.reply_text(
        "start this bot",
        parse_mode="markdown")

def help(update, context):
    update.message.reply_text(
        "help for this bot",
        parse_mode="markdown")

def main():
    updater = Updater(token=BOT_TOKEN, use_context=True)
    dispatcher = updater.dispatcher

    start_handler = CommandHandler("start", start)
    help_handler = CommandHandler("help", help)

    dispatcher.add_handler(start_handler)
    dispatcher.add_handler(help_handler)
    updater.start_polling()

if __name__ == '__main__':
    main()

If you are using flask, do not set debug mode to true also on your development server, first call main function then call flask server like this:-

app = Flask(__name__)

if __name__ == '__main__':
    main()
    app.run()

Original Author jak bin Of This Content

Solution 3

Stop the bot, close your IDE, make sure that all python processes were ended in the task manager, and try again.
That has helped me.

Original Author SashaTsios Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment