So I'm attempting to write a raiding bot for my raiding discord using the discord.py library in python. This scripts is supposed to be forming a list of members in the voice channel for raiding. For some reason, this script is not working. Whenever memids is printed, it just prints an empty list.
If anyone is familiar with discord.py and could tell me why this isn't working, please do. It's really troubling me and I have tried everything in my knowledge to fix it.
#find raiding
voice_channel = discord.utils.get(ctx.message.server.channels, id = '440014722587426816')
#finds the members
members = voice_channel.voice_members
memids = []
for member in members:
memids.append(member.id)
print(memids)
Enable Developer mode in Discord (User Settings -> Accessibility) then right click the server icon and click Copy ID, then type this line of code after async def: guild = client. get_guild(paste the copied ID here) Also you don't need len(guild. member_count) it will return number of digits of member count.
Unfortunately, Discord doesn't allow its users to be in 2 voice channels at once. You are only allowed to join 1 voice channel at a time. If you try to join a second server, you'll be asked to disconnect from the first voice channel you joined before you can connect with the second one.
Just do # and then start typing the channel name.
Also, one great feature in Discord's voice calls is how many people can participate. As mentioned, you can talk with up to 100 users at the same time.
If you know the id of the channel you can do it this way. Works for me :D
channel = client.get_channel(1234567890) #gets the channel you want to get the list from
members = channel.members #finds members connected to the channel
memids = [] #(list)
for member in members:
memids.append(member.id)
print(memids) #print info
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With