Skip to content Skip to sidebar Skip to footer

Get The Number Of Boosts In A Server Discord.py

I am trying to make a server info command and I want it to display the server name, boost count, boost members and some other stuff as well. Only problem is I have looked at the do

Solution 1:

Guild Name - guild_object.name

Boost count - guild_object.premium_subscription_count

Boosters, the people who boosted the server - guild_object.premium_subscribers

If your doing this in a command as I assume, use ctx.guild instead of guild_object. For anything further, you can re-read the docs as all of the above information is in it under the discord.Guild

Solution 2:

Try this:

@client.command()asyncdefboostcount(ctx):
    embed = discord.Embed(title = f'{ctx.guild.name}\'s Boost Count', description = f'{str(ctx.guild.premium_subscription_count)}')
    await ctx.send(embed = embed)

Post a Comment for "Get The Number Of Boosts In A Server Discord.py"