Discord.py: on_group_join and on_group_remove events never triggered.

Created on 5 Apr 2017  路  2Comments  路  Source: Rapptz/discord.py

I am trying to create a bot that deletes channels that are empty.
I know my bot is handling events properly because on_ready and on_message are called at their appropriate times.

I had some other lines describing how to handle channel and user, but they were never called. I the print statements, and they were never even reached, causing me to believe that the bot is not able to recognize when users move around in the voice channels.
for on_group_join:

@client.event
async def on_group_join(channel, user):
    print("JOIN")
    if channel == client.get_channel('296225399543693314'):
        print("A User Joined The Creation Channel.")
        """ do stuff """
    return

for on_group_removal:

@client.event
async def on_group_remove(channel):
    await print("LEAVE")
    if channel.member_count() == 0:
        await client.delete_channel(channel)
    return

Neither of these are being called, any time a user switches around a channel.
No error is logged either, so nothing is going wrong from what I can tell. According to the documentation, I should be going about this correctly, so I am thinking it may be a bug with discord.py.

Most helpful comment

Bots don't use groups. I think you may be confused on what a group is, the event you're looking for is on_voice_state_update

All 2 comments

Bots don't use groups. I think you may be confused on what a group is, the event you're looking for is on_voice_state_update

Thank you, I misread the API. This makes more sense.

Was this page helpful?
0 / 5 - 0 ratings