Python 以特定的方式通知;logchannel";如果有人加入特定的语音频道

Python 以特定的方式通知;logchannel";如果有人加入特定的语音频道,python,discord,discord.py,Python,Discord,Discord.py,请帮帮我 我试了很多,但没用 @bot.event async def on_voice_state_update(member, before, after): notifchannel = 702241043810353332 channel = before.channel or after.channel if channel.id == 677216062013440030: if before.channel is None and after

请帮帮我 我试了很多,但没用

@bot.event
async def on_voice_state_update(member, before, after):
    notifchannel = 702241043810353332
    channel = before.channel or after.channel
    if channel.id == 677216062013440030:
        if before.channel is None and after.channel is not None:
            await notifchannel.send("...")
    

您需要通过获取通道对象

notifchannel = member.guild.get_channel(702241043810353332)

不要调用channel-id上的函数
send()

你能清楚地解释你的问题吗?“行不通”这太模糊了,我们无法帮助你,请添加你得到的任何错误,你当前的结果是什么,预期的结果是什么,看一看或者简单地说:
等待bot.get\u channel(ChannelID)