簡體   English   中英

類型錯誤:“成員”object 不可調用 discord.py

[英]TypeError: 'Member' object is not callable discord.py

代碼

global Vc
    global Tune
    try:
        Vc = await stage.connect()
        Member = guild.me(config["bot_id"])
        await member.edit(suppress=False)
    except CommandInvokeError:
        pass
    while True:
        while Vc.is_playing():
            await asyncio.sleep(1)
        else:
            Tune = get_info.write_song()
            Vc.play(discord.FFmpegPCMAudio(f"songs/{Tune}"))
            audiofile = eyed3.load(f"songs/{Tune}")
            title = audiofile.tag.title
            await bot.change_presence(activity=discord.Game(name=f"{title}"))
            Vc.source = discord.PCMVolumeTransformer(Vc.source, volume=config["volume"])
            if "suppress=False" in str(stage.voice_states):
                pass
            else:
                await member.edit(suppress=False)

錯誤

文件“main.py”,第 95 行,在 on_ready Member = guild.me(config["bot_id"]) TypeError: 'Member' object is not callable

使用guild.me而不是guild.get_member(config["bot_id"]) 好多了。 您還可以在編輯之前檢查if member is not None: :。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM