关于接受DM和DMing另一个us的不一致python bot错误

2024-05-14 21:50:24 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试让bot获取具有特定内容标准的消息。然后我希望bot用用户名/ID和他们留下的消息给我。你知道吗

@client.event
async def on_message(message):
    if input.startswith('.direct'):
        content = re.sub(r'^\W*\w+\W*', '', message.content)
    elif message.content.startswith('!msg'):
        print (message.content)
        user = discord.utils.get(client.get_all_members(), id='505409899271028746')
    await client.send_message(message.author, "We appreciate your inquiry! As of right now, it doesn't match any questions that I have the ability to answer, so I've sent a message towards my creator to provide support.")
    await client.send_message(user, client.get_user_info(id) + content)
    await client.process_commands(message)
                               Edited version 10/29/2018 - 2:47 pm EST

我知道用户可以直接给我发DM,但这是一个步骤,可以自动回答选定的问题,然后转发DM给我,如果它不能回答他们。但我有办法才能做到。 http://prntscr.com/lbqy6y


Tags: toclientsendid消息内容message标准

热门问题