我正在尝试让该机器人获取具有特定内容条件的消息。然后,我希望该机器人向我发送用户名/ 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