我用 python 和 telepot 库制作了一个电报机器人。机器人必须从消息中接收文件作为输入。问题是我把它设置为接收文本,我不知道如何改变它。
错误在这里“ comando=msg['text']
”
bot=telepot.Bot('19evterbyetrnuretnurt6tB-U') #bot token
print(bot.getMe()) #print info bot
def rispondi(msg): #definition of reply
chat_id=msg['chat']['id'] #chat_id = chat code
comando=msg['text'] #input from the chat (set on text)
comando 是输入。设置在文本上,我需要更改文件和文本。谢谢。