How can a Discord bot automatically relocate a user to the AFK channel when they deafen?

Seeking help for a Discord bot that shifts users to the AFK channel if they deafen:

def assess_audio(client_member):
    if client_member.deafen_status:
        transfer_to_afk(client_member, afk_channel_id)

Appreciate any guidance!

hey, you should listen to the voice state update event instead. this way, when a user toggels deafen status, you can trigger a channel move. might be worth double checking discord docs for potential delays in the state update