0
votes

Hello I'm trying to code a bot with discord.py to notify my discord server when I'm in stream, but I don't know how to do it. Can anyone help me?

Thanks

@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!")
1
stackoverflow.com/help/how-to-ask has a great guide on how to ask questions. What code have you tried? Let us see what you want.Paul Brennan
the discord.py documentation has what you're looking for discord.Member.activityjjoy
@PaulBrennan this is my code but It dont workDipo3
@jjoy I don't understand what I have to do with that can you help meDipo3
Instead of using on_voice_state_update, you can use on_member_update.MrSpaar

1 Answers

0
votes

This might work:

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")

I hope this may be of help.