第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

正在等待消息,但機(jī)器人沒(méi)有響應(yīng)

正在等待消息,但機(jī)器人沒(méi)有響應(yīng)

PHP
縹緲止盈 2023-11-09 16:54:08
@client.command()@has_permissions(administrator=True)async def nuke(ctx, channel_name):    channel_id = int(''.join(i for i in channel_name if i.isdigit()))    existing_channel = client.get_channel(channel_id)    await ctx.send("Please confirm nuke: type yes or no")    def check(m):        return m.content == 'yes'    msg = await client.wait_for('message', check=check)    if existing_channel is not None:        await existing_channel.clone(reason="Has been nuked")        await existing_channel.delete()    else:        await ctx.send(f'No channel named **{channel_name}** was found')    def check(s):        return s.content == 'no'    msg = await client.wait_for('message', check=check)    await ctx.send("Nuke has been canceled")我遇到的問(wèn)題:一旦你說(shuō)不,機(jī)器人應(yīng)該取消命令,但它不會(huì)取消命令。如果您在說(shuō)“不”后立即說(shuō)“是”,機(jī)器人無(wú)論如何都會(huì)繼續(xù)克隆并刪除頻道。也沒(méi)有錯(cuò)誤消息。如果您需要任何其他信息,請(qǐng)告訴我。
查看完整描述

1 回答

?
幕布斯6054654

TA貢獻(xiàn)1876條經(jīng)驗(yàn) 獲得超7個(gè)贊

該行不會(huì)暫停執(zhí)行直到滿足msg = await client.wait_for('message', check=check)條件嗎?m.content == 'yes'這應(yīng)該效果更好:


@client.command()

@has_permissions(administrator=True)

async def nuke(ctx, channel_name):

    channel_id = int(''.join(i for i in channel_name if i.isdigit()))

    existing_channel = client.get_channel(channel_id)

    await ctx.send("Please confirm nuke: type yes or no")


    def check(m):

        return m.content == 'yes' or m.content == 'no'


    msg = await client.wait_for('message', check=check)


    if msg.content == 'yes':

        if existing_channel is not None:

            await existing_channel.clone(reason="Has been nuked")

            await existing_channel.delete()

        else:

            await ctx.send(f'No channel named **{channel_name}** was found')

    elif msg.content == 'no':

        await ctx.send("Nuke has been canceled")


查看完整回答
反對(duì) 回復(fù) 2023-11-09
  • 1 回答
  • 0 關(guān)注
  • 138 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)