Python Telegram Bot Mehrere BotsPython

Python-Programme
Anonymous
 Python Telegram Bot Mehrere Bots

Post by Anonymous »

Ich habe mehrere Bots, die das Python -Telegramm -Bot -Modul verwenden. Jeder Bot hat Code wie: < /p>

Code: Select all

from telegram.ext import Updater, CommandHandler

def start(update, context):
update.message.reply_text("Command List:\n/start - Display this message")

def main():
updater = Updater(token='XXXXXXX:XXXXXXX-XXXXXXXXXXX', use_context=True)
updater.dispatcher.add_handler(CommandHandler('start', start)) # One example of a bot command
# ... Several CommandHandler and ConversationHandler functions ...
updater.start_polling()
updater.idle()

if __name__ == '__main__':
main()
Ich habe diese Dokumentation zum Ausführen mehrerer Asyncio Frameworks gefunden, aber kein bestimmtes Beispiel finden, das mehrere Instanzen von Python Telegram Bot erstellt. Die Bots, die ich auf vollständig getrennten Kanälen ausgeführt habe, und haben unterschiedliche Befehle/Funktionen/Token. Wie hätte ich ein Skript für mehrere Bots?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post