【发布时间】:2019-02-20 23:19:49
【问题描述】:
如果 client.wait_for_message 达到超时,我正在尝试发送消息。在这种情况下,它是 30 秒。我使用了 TimeoutError 但它不会抛出任何错误或工作。
try:
msg = await client.wait_for_message(timeout= 30, author=message.author, check=check)
if msg:
await client.send_message(message.channel, "Nice job! {} solved the scramble! The word was {}!".format(message.author.mention, word))
except TimeoutError:
await client.send_message(message.channel, "Oops! Nobody solved it. The word was {}!".format(word))
【问题讨论】:
标签: python python-3.x discord discord.py