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.
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.
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