discord.py不能同时使用命令和on_message

时间:2018-07-18 14:04:25

标签: python-3.x discord.py

我创建的python discord机器人无法与带有前缀>的命令一起使用,例如

@client.command(name="say",description="Say the string follow by the 
command",brief="Say command")
async def say(msg):
    await client.say(msg)

当我有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 client.send_message(message.channel, msg)

机器人会回复hello,但不会回复>say

有没有办法使两者同时工作?

0 个答案:

没有答案