Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
361 views
in Technique[技术] by (71.8m points)

python-3.x - 有没有办法用Discord.py创建申请表?(Is there a way to create application form with Discord.py?)

I want to create application form using Discord.py, for example the user send '$register' then he get questions one by one (What is your first name?, what is your last name?).

(我想使用Discord.py创建申请表,例如,用户发送“ $ register”,然后他一个接一个地询问问题(您的名字是什么,您的名字是什么?)。)

I can handle this when there is only one user using this code

(当只有一个用户使用此代码时,我可以处理此问题)

members_list = []
@client.event
async def on_message(message):
    if message.content.startswith('$register'):
        if message.author not in members_list:
            members_list.append(message.author)
            await message.channel.send('What is your first name ?')

        def check(m):
            return m.author in members_list

        msg1 = await client.wait_for('message', check=check)
        await message.channel.send('Hello {}!, what is your last name'.format(msg1.content))

        msg2 = await client.wait_for('message', check=check)
        await message.channel.send('{}, your application has been aproved!'.format(msg1.content))

But when there are a lot of users, when another user answer the seconde question, it's count like he also answer the other users question.

(但是,在有很多用户的情况下,当另一个用户回答第二个问题时,就像他也回答另一个用户问题一样。)

can anyone help ?

(有人可以帮忙吗?)

  ask by B. Okba translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...