joytou commited on
Commit
e3c9205
·
1 Parent(s): 97136b4

Try fixed: TypeError: 'str' object is not callable

Browse files
Files changed (1) hide show
  1. discord_bot.py +1 -1
discord_bot.py CHANGED
@@ -141,7 +141,7 @@ async def on_message(message):
141
  # 如果规则指定了函数,则调用对应的函数
142
  if "function" in rule:
143
  function_name = rule["function"]
144
- result = eval(f"await {function_name()}")
145
  await message.channel.send(result)
146
  # 否则发送预定义的响应消息
147
  elif "response" in rule:
 
141
  # 如果规则指定了函数,则调用对应的函数
142
  if "function" in rule:
143
  function_name = rule["function"]
144
+ result = eval(f"await {function_name}()")
145
  await message.channel.send(result)
146
  # 否则发送预定义的响应消息
147
  elif "response" in rule: