Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/315.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何复制用户的文本?_Python_Python 3.x_Discord.py - Fatal编程技术网

Python 如何复制用户的文本?

Python 如何复制用户的文本?,python,python-3.x,discord.py,Python,Python 3.x,Discord.py,我有这个密码。它应该做的是询问用户的姓名和电子邮件,然后制作一个名为输入姓名和数字600的文本文档,其中包含电子邮件地址。但它不起作用。我已经尝试了许多不同的教程和措辞方式,但它不接受变量 await message.author.send('We need some information first.\nWhat is your name?') Name = await message.content await message.author.send('What is the Email

我有这个密码。它应该做的是询问用户的姓名和电子邮件,然后制作一个名为输入姓名和数字600的文本文档,其中包含电子邮件地址。但它不起作用。我已经尝试了许多不同的教程和措辞方式,但它不接受变量

await message.author.send('We need some information first.\nWhat is your name?')
Name = await message.content
await message.author.send('What is the Email you used for your PayPal account?')
Email = await message.content
with open(Name + '600.txt', "w") as f:
    f.write(Email())
Eror:


您不能在message.content中使用wait,所以它只是message.content

请格式化代码“但它不起作用。”--请详细说明,并解释您为找到解决方案所做的工作。这不起作用。已经试过了。
Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\ArtyF\AppData\Roaming\Python\Python39\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\ArtyF\AppData\Roaming\Microsoft\Windows\Network Shortcuts\HWMonitor\discord bot\bot.py", line 34, in on_message
    Name = await message.content
TypeError: object str can't be used in 'await' expression