1 回答

TA貢獻1797條經驗 獲得超6個贊
覆蓋提供的默認值on_message會禁止運行任何額外的命令。要解決此問題,請client.process_commands(message)在on_message.
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('>hello'):
msg = 'Hello, {0.author.mention}!'.format(message)
await message.channel.send(msg)
await client.process_commands(message) # <----
@client.command(name="pomodoro")
async def _pomodoro(ctx):
await ctx.channel.send("Let's grab some tomatoes! For how many minutes?")
def check(msg):
return msg.author == ctx.author and msg.channel == ctx.channel and \
type(msg.content) == int
msg = await client.wait_for("message", check=check)
添加回答
舉報