【发布时间】:2021-06-04 12:19:25
【问题描述】:
我基本上是在尝试制作一个应用程序/问卷调查不和谐机器人。触发后,机器人应该通过 dm 通知用户并询问用户是否要继续。用户回复“继续”,机器人从第一个问题开始,等待用户的回复。 Bot 然后接受响应并存储它并继续下一个问题,它循环直到它完成最后一个问题。我被困在机器人发送第一个问题的部分,当我回答时我没有得到任何回应。任何帮助将不胜感激。
PS。我对 python 和 discord py 还很陌生
@bot.command()
async def apply(ctx):
Name = ''
Age = ''
user = ctx.author
name = ctx.author.display_name
q = ['What is your full real name?',
'What is your age?']
i = 0
#embed
message = 'Thank you ' + name + \
' for taking interest in Narcos City Police Department. You will be asked a series of question which you are required to answer to the fullest of your ability. Please reply with *proceed* to start your application.'
embedmsg =discord.Embed(title = 'NARCOS CITY POLICE DEPARTMENT', color = Police)
embedmsg.set_thumbnail(url = thumbnail)
embedmsg.add_field(name = 'Human Resources:', value = message)
#initial bot response
dmchannel = await ctx.author.send(embed=embedmsg)
#check
def check(m):
return m.author == ctx.author and m.channel == ctx.author.dm_channel
msg = await bot.wait_for('message', check=check)
if msg.content == 'proceed':
async def askq(q):
await ctx.author.send(q)
msg
return msg.content
Name = await askq(q[0])
Age = await askq(q[1])
【问题讨论】:
标签: python discord discord.py