[英]TypeError: 'dict' object is not callable python3
我只是用 python3 制作 discord 機器人
if message.content.startswith('!meal'):
with open('menu.json', encoding='utf-8') as json_file:
data = json.load(json_file)
channel = message.channel
await channel.send('this is meal info!')
await channel.send(data())
但是當我使用這個命令時出現錯誤
~/pythonruby/discord bot/main.py", line 30, in on_message
await channel.send(data())
TypeError: 'dict' object is not callable
這個錯誤..我試着讓數據來聽寫..
您始終可以像這樣將字典作為字符串發送
await channel.send(str(data))
但是......這可能不是數據的最友好表示。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.