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

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

Discord.py - 檢查多個(gè)公會(huì) ID

Discord.py - 檢查多個(gè)公會(huì) ID

慕運(yùn)維8079593 2023-10-31 14:03:37
好吧,我正在嘗試創(chuàng)建一個(gè)僅適用于特定公會(huì)的命令。這是代碼。如果我添加多個(gè)公會(huì) ID,那么每個(gè)公會(huì)都可以使用此命令。async def is_guild(ctx):    return ctx.guild.id == someguildidhere, someguildidhere@client.command()@commands.check(is_guild)async def checkispremium(ctx):    await ctx.send("Guild owns lifetime premium.")@checkispremium.errorasync def checkispremium(ctx, error):    if isinstance(error, commands.CheckFailure):        await ctx.send("Guild doesn't owns premium ")然而,當(dāng)我只添加一個(gè)公會(huì) ID 時(shí),一切都會(huì)正常。只有特定公會(huì)才能使用該命令,其他公會(huì)會(huì)出錯(cuò)。async def is_guild(ctx):    return ctx.guild.id == someguildidhere@client.command()@commands.check(is_guild)async def checkispremium(ctx):    await ctx.send("Guild owns lifetime premium.")@checkispremium.errorasync def checkispremium(ctx, error):    if isinstance(error, commands.CheckFailure):        await ctx.send("Guild doesn't owns premium")任何人都知道我如何擁有多個(gè)公會(huì) ID,我嘗試查看不和諧重寫文檔,但看起來什么也沒有。
查看完整描述

1 回答

?
梵蒂岡之花

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

使用

async def is_guild(ctx):
    return ctx.guild.id in [someguildidhere, someguildidhere, ...]


查看完整回答
反對(duì) 回復(fù) 2023-10-31
  • 1 回答
  • 0 關(guān)注
  • 105 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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