Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor and improve `information` cog #654

Open
SebastiaanZ opened this issue Nov 8, 2019 · 4 comments

Comments

@SebastiaanZ
Copy link
Member

@SebastiaanZ SebastiaanZ commented Nov 8, 2019

In the past couple of months, a number of enhancements have been suggested for the commands in the information cog. I decided to make a list of those suggestions (from memory, so please comment the things I've inevitably forgotten) and want to take a stab at implementing those enhancements. In addition, there's also a small bug in the !roles command that needs to be fixed, since it's unusable right now.

Enhancements

  1. If the !user command targets a non-moderator in a moderation channel, make the infraction history directly accessible using a reaction. Currently, we almost always combine !user <user> with !infr search <user> and this change would make the infraction history directly accessible from the !user embed while taking up less vertical space.

  2. If the !user command targets a moderator in a moderation channel, instead of showing a breakdown of their infraction history, show a breakdown of the infractions they've issued. This is mostly for a bit of fun, but I want to make those "actor" infractions accessible with a reaction just like in point 1. That way, you can read back the infractions you've issued recently more easily if you don't remember the exact details.

  3. Create a single entry point for the !roles command. Currently, there are two commands, !role and !roles, that look almost identical but do widely different things: One will list all the current roles we have (!roles, currently broken) and one will provide a detailed embed for specific roles provided as arguments to the command (!role <role> [<role> ...]).

    My plan is to create one command, !role (with alias !roles to keep the API the same), that lists all the roles if no roles were provided as arguments and returns detailed views of roles if roles were provided as arguments. This is fully backwards compatible with the old commands, but you don't have to remember the difference between !role and !roles) See #532

  4. Add additional information to the !server command when issued in a moderation channel. We often look up information like how many members are stuck in checkpoint or how many users are currently being watched. I want to add that information to the !server command by default if it was issued in a moderation channel.

  5. Make the !user command work for users that are currently not a member of the guild. I've noticed that we often try to request the !user command on users that are currently not a member of our guild (e.g., when a ban expires). Given that it now gives a nice overview of their infraction history and is going to allow quick access to their infractions (see point 1), it would be useful to make it work for non-members as well. Obviously, we will not have member-specific data, but we can still get general information from the Discord API and historical infractions from our API.

Bug fixes

  1. The !roles command is currently broken. It tries to list all the roles we currently have on our guild in an embed, but, since we have a lot of roles, the embed message is reject by Discord for being too large. A simple solution is to add pagination with a high max_size argument. This will make sure that the listing will be displayed on one page if it fits, but is paginated if it doesn't.

Suggestions & unit tests

I know the commands have been discussed in the past, so if there's anything that I've missed, please comment on this issue so I can add it to the list. I will also be writing unit tests for this module (I'm already assigned to that issue).

@scragly

This comment has been minimized.

Copy link
Member

@scragly scragly commented Nov 8, 2019

#532 Is a relevant issue that I've already started work on.

@SebastiaanZ

This comment has been minimized.

Copy link
Member Author

@SebastiaanZ SebastiaanZ commented Nov 8, 2019

Ah, okay, I missed that in my issue search. I'll just leave the !role commands alone for now.

@scragly

This comment has been minimized.

Copy link
Member

@scragly scragly commented Nov 15, 2019

I'm moving spirit of the suggestion from #176 to over here for consideration as it falls under the scope of this issue:

Having some form of indication in !user output to indicate how recently an infraction was given if they have one.

The original suggestion calls for a emoji to be placed next to the name, however I personally think it would be better to just have a line stating how long ago the last infraction was above the outputted groups.

@SebastiaanZ

This comment has been minimized.

Copy link
Member Author

@SebastiaanZ SebastiaanZ commented Nov 15, 2019

Yes, sounds like an excellent addition. I've already done most of the stuff outlined in the issue above, but more suggestions are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.