【发布时间】:2021-05-03 18:01:01
【问题描述】:
您好,我正在使用 Visual Studio/python 并尝试制作一个不和谐的机器人。无论我做什么,我都会遇到这个错误。 Ignoring exception in on_message/Traceback (most recent call last):
该程序在 Visual Studio 中运行我的功能,并伴有错误,但它没有出现在我写消息的不和谐聊天中。
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('$hello'):
await message.channel.send('write a message:')
msg = await client.wait_for("message")
parameter = msg.content
await message.channel.send(defname(parameter)) ```
EDIT: ookay the problem was in my FUNCTION, which was ending on print(), instead of return ""
【问题讨论】:
-
PLEASE DO NOT POST TEXT AS IMAGES。将文本复制并粘贴到您的问题中,并使用代码格式化工具正确格式化。图像不可搜索,也无法通过屏幕阅读器为有视力障碍的人解读。使用edit 链接修改您的问题。
-
可以发完整码吗?
-
FIXED 问题出在我的 FUNCTION 中,它以 print() 结束,而不是 return ""
标签: python discord.py