Skip to content
Advertisement

how i can count members in python i need full code

i want to count members in discord but how using async await message.channel.send(f"""# of Members: {id.member_count}""") i try

JavaScript

i know this is copy code my code is

JavaScript

Advertisement

Answer

To get the amount of members from a guild can be retrieved with member_count, with this you also need to properly define guild or just simply using ctx.guild.member_count

This is an example in your command, I would also recommend to use a command instead of an on_message event to use as a command, there’s just loss of benefits using that way.

JavaScript

Even if you still wanted to get the guild count with an on_message, it can be done this way,

JavaScript

You have also used bot and client you should only be using one but i’d assume your code works

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement