Enhance the !server command.#1166
Conversation
Rather than do two passes over the channels, a single loop is used to collect all the channel counts into a single dictionary. The get_channel_type_counts method now returns a dictionary of channel to count, allowing the caller liberty to format the values.
Includes useful information like the number of nominated/watched members, number of unverified members, defcon status etc. Will not show up if the command is ran outside of a moderation channel.
|
The roles count feels a bit out of place under the member counts, maybe the description "header" would be more fitting for it? |
That's a good idea, and it would make some code a tad bit clearer.
By @python-discord/core-developers I'll be removing the |
|
Maybe we should also add a count for the missing roles: core devs, event team, python community and partners ? |
|
Does the statuses look good with a big number on all 4? even on mobile? |
thomaspet
left a comment
There was a problem hiding this comment.
Looks good to me, if we need the presence? I believe thats up for debate
| channel.overwrites_for(guild.get_role(staff_role)).read_messages is True | ||
| and channel.overwrites_for(guild.default_role).read_messages is False |
There was a problem hiding this comment.
Not against verbosity, but just making sure it was intended, and not be
| channel.overwrites_for(guild.get_role(staff_role)).read_messages is True | |
| and channel.overwrites_for(guild.default_role).read_messages is False | |
| channel.overwrites_for(guild.get_role(staff_role)).read_messages | |
| and not channel.overwrites_for(guild.default_role).read_messages |
There was a problem hiding this comment.
overwrites_for returns a PermissionOverwrite object.
Unlike a regular Permissions, the default value of a permission is equivalent to None and not False. Setting a value to False is explicitly denying that permission, while setting a value to True is explicitly allowing that permission.
An implicit check would also count the default permission as a deny, hence we explicitly check for True or False. I'm not resolving this yet since I think this could be clarified a bit more in the comment.
|
This PR will have conflicts with #1196 and should probably wait until we start using d.py 1.5; some of the presence tracking will no longer be possible. |
|
Updating: The master branch now runs off of discord.py 1.5.1, and #1196 has been merged. |
We do not have the Developers role anymore, so there's no such thing as verified/unverified members.
Xithrius
left a comment
There was a problem hiding this comment.
The code looks good to me, and I'm really into this new embed.
But should we have defcon days as None instead of -?
I'm fine with either, |
|
I see. It does look fine to me as of now. If the staff doesn't like it for some reason, it can always be changed. |
The
!servercommand is now more compact, and has more information.In a regular channel
In a moderation channel
For contrast, the old embed:

I have no idea what I'm doing with the test.