Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用python持续检查传入我的电报机器人的消息?_Python_Python 3.x_Chatbot_Telegram Bot_Python Telegram Bot - Fatal编程技术网

如何使用python持续检查传入我的电报机器人的消息?

如何使用python持续检查传入我的电报机器人的消息?,python,python-3.x,chatbot,telegram-bot,python-telegram-bot,Python,Python 3.x,Chatbot,Telegram Bot,Python Telegram Bot,我正在试验电报机器人和python。我的问题是如何让python程序持续检查发送到电报机器人的消息 例如: while checkForIncomingMessages: print(latestMessage) if latestMessage == "ifconfig": # execute ifconfig command on laptop 提前谢谢 telegrambot的github页面上有一些示例bot

我正在试验电报机器人和python。我的问题是如何让python程序持续检查发送到电报机器人的消息

例如:

while checkForIncomingMessages:
    print(latestMessage)
    if latestMessage == "ifconfig":
       # execute ifconfig command on laptop

提前谢谢

telegrambot的github页面上有一些示例bot