我不明白为什么它会给出这个错误!它吃了我的头
@client.event
async def on_message(message):
# Make sure bot doesn't get stuck in an infinite loop
if message.author == client.user:
return
# Get data about the user
username = str(message.author)
user_message = str(message.content)
channel = str(message.channel)
# Debug printing
print(f"{username} dice: '{user_message}' ({channel})")
# If the user message contains a '?' in front of the text, it becomes a private message
if user_message[0] == '?':
user_message = user_message[1:] # [1:] Removes the '?'
await send_message(message, user_message, is_private=True)
else:
await send_message(message, user_message, is_private=False)
它在那里做的唯一事情就是调用一个名为“send_message”的模块
x一个一个一个一个x一个一个二个x
400错误请求(错误代码:50006):无法发送空消息
1条答案
按热度按时间elcex8rz1#
您应该使用检查来确保
handle_response
函数返回字符串(如果消息不是tell me something bana,则不会返回字符串):