discord.py如何临时阻止执行以从用户处获取新指令

discord.py如何临时阻止执行以从用户处获取新指令,discord.py,Discord.py,嗨,我正在为我的discord服务器的新成员创建一个初始教程,我只停留在一点上: 我希望它在教程执行期间暂时冻结,让用户选择选项,但我不知道如何操作,我想它可能来自asyncio库,但我不知道。 我发送完整的代码: @client.event 异步def on_消息(消息): 如果message.content==“开始”: #鲁利 accademico_in_preparazione=get(guild.roles,id=int(“746178678274261043”)) mappercel

嗨,我正在为我的discord服务器的新成员创建一个初始教程,我只停留在一点上: 我希望它在教程执行期间暂时冻结,让用户选择选项,但我不知道如何操作,我想它可能来自asyncio库,但我不知道。 我发送完整的代码:

@client.event
异步def on_消息(消息):
如果message.content==“开始”:
#鲁利
accademico_in_preparazione=get(guild.roles,id=int(“746178678274261043”))
mappercell=get(guild.roles,id=int(“746187955315540059”))
mapperpc=get(guild.roles,id=int(“746187952987701250”))
accademico=get(guild.roles,id=int(“6909644416644251750”))
#卡纳利
regolamento=client.get_通道(727304286215733249)
annunci=客户端获取_通道(67510174411574789)
programmazione=client.get_通道(724936407835213914)
generaleacc=客户端获取_通道(69787269050187328)
corsibase=client.get_通道(675103006953570324)
guida=client.get_通道(724680601482952714)
regolamentolmii=client.get_通道(646026232420368395)
costituzione=client.get_频道(643547822284865556)
generale=client.get_通道(640563710104043530)
#运河专用公用设施设计图
通道=客户端获取通道(746145103403286618)
如果ctx.channel.id==channel.id:
等待ctx.channel.set_权限(accademico_in_preparazione,read_messages=True,send_messages=False)
等待消息。频道。发送(“Salve nuovo accademico benvenuto nell'accademia del LMII!”)
等待异步睡眠(5)
wait message.channel.send(“Prima di lasciarti la libertáti spiego alcune cose importanti”)
等待异步睡眠(5)
等待消息。频道。发送(“Essendo un accademico sei limitato rispetto ad altri membri,il tuo compitoèquello di completerar i corsi perficiente un membro del LMII!”)
等待异步睡眠(7.5)
等待消息。频道。发送(“不可能的,不可能的?”)
等待异步睡眠(5)
等待消息。频道。发送(“Ci teniamo che i nostri membri ufficiali siano giádei bravi mapper che abbiano delle basi solite,ti consiglio vivamente di guardar questi segunti canali:”)
等待异步睡眠(7.5)
wait message.channel.send(f“{regolamento.notice}:Il regolamento della nostra accademia!”)
等待异步睡眠(2)
等待消息.channel.send(f“{annunci.mentation}:gli annunci dell'accademia,potresti ricevere(在caso hai i i messaggi privati aperti中)dei messaggi privati dal bot che sono degli annunci importanti del server中)
等待异步睡眠(8)
wait message.channel.send(f“{programmazione.notice}:qui c'il programma dell'academia,dacci un occchiata!”)
等待异步睡眠(5)
wait message.channel.send(f“{generalacc.notice}:在tutto riguardante l'accademia sfruttalo per ogni evenienza的港口附近的运河上的鸽子)
等待异步睡眠(6)
wait message.channel.send(f“{corsibase.notice}:qui ci sono le informazioni sui corsi che interestsano a te!”)
等待异步睡眠(5)
wait message.channel.send(f“{guida.notice}:qui per altre informazioni dettagliate sull'academia!”)
等待asyncio.sleep(1)
等待消息。通道。发送(f“\n”)
等待异步睡眠(5)
等待消息。频道。发送(f“Essendo accademico hai accessi limitati ma puoi加入宁静的区域地图,并在公共区域的主要水道上,提及dove puoi parlare di Tuto e fare buone Conoscentze!”)
等待异步睡眠(10)
等待消息。频道。发送(f“attentizione ci sono da rispettare anche il{regolamentolmii.提及}e la{costituzione.提及}che sono molto importanti!”)
等待asyncio.sleep(1)
等待消息。通道。发送(f“\n”)
等待异步睡眠(6)
等待消息。频道。发送(f“Ora dovrai rispounder semplicente and una domanda per poi pot finalmente accepter a tutti i canali!”)
等待异步睡眠(10)
等待消息。频道。发送(f“Sei un mapper da**telefono**o da**PC**?”)
等待异步睡眠(5)
等待ctx.channel.set_权限(message.author,send_messages=True)
????
等待ctx.channel.set_权限(message.author,overwrite=None)
如果message.content==“PC”:
等待消息。频道。发送(“Quindi sei un mapper da pc!”)
等待消息。作者。添加角色(mapperpc)
等待消息。频道。发送(“Ora tutti sapranno che sei un mapper da PC,在卡索坎比创意中心,在莫多手册中,我是柬埔寨的一名教师!”)
等待异步睡眠(6)
等待消息。频道。发送(“Ora sei pronto!Se vuoi sapere di piùsul bot digita**lmiihelp**\n\n bot programmato da:Peppewarrior Italy”)
等待异步睡眠(7)
等待消息。作者。删除角色(accademico_in_preparazione)
wait message.authro.add_角色(accademico)
等待异步睡眠(5)
等待消息.通道.清除(限制=100)
等待ctx.channel.set_权限(accademico_in_preparazione,read_messages=True)
elif message.content==“telefono”:
等待消息。频道。发送(“Quindi sei un mapper da telefono!”)
等待消息。作者。添加角色(mappercell)
等待消息。频道。发送(“Ora tutti sapranno che sei”是电信地图绘制者,在卡索坎比创意中心,一个优质的安米尼斯特拉托
@client.event
async def on_message(message):
    if message.content.startswith('$greet'):
        channel = message.channel
        await channel.send('Say hello!')

        def check(m):
            return m.content == 'hello' and m.channel == channel

        msg = await client.wait_for('message', check=check)
        await channel.send('Hello {.author}!'.format(msg))
await ctx.send("Choose an option:\n1. Option 1 details here\n2. Option 2 details here\n3. Option 3 details here")
option = await client.wait_for('message', check=lambda message: message.author == ctx.author and message.content != "")
option = option.content;

if (option == "1"):
    # Do something if user chooses 1
elif (option == "2"):
    # Do something if user chooses 2
elif (option == "3"):
    # Do something if user chooses 3