繁体   English   中英

Twitch discord.py 机器人

[英]Twitch discord.py bot

您好,当我在 stream 中时,我正在尝试使用discord.py编写一个机器人来通知我的 discord 服务器,但我不知道该怎么做。 谁能帮我?

谢谢

@bot.event
async def on_voice_state_update(member, prev, cur):
    if prev.channel and cur.channel:  
         if prev.self_stream != cur.self_stream:
            print("User's self-stream updated!")

这可能有效:

YourID = #Enter your id here

@bot.event
async def on_voice_state_update(member, prev, cur):
    if cur.self_stream and bool(cur.channel) and member.id == YourID:
        print ("User's self stream updated")

我希望这可能会有所帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM