-
Notifications
You must be signed in to change notification settings - Fork 9
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
add group membership to !user info #49
Comments
Hello!, I made a PR that i hope potentially solves this issue. As my previous PR is yet to be reviewed. Add User Group Membership Details to Fas Info CommandDescription: This pull request modifies the Changes:
Benefits:
Implementation: The following code snippet demonstrates the changes made to the async def _user_info(self, evt: MessageEvent, username: str | None) -> None:
await evt.mark_read()
try:
user = await get_fasuser(username or evt.sender, evt, self.plugin.fasjsonclient)
groups = await self.plugin.fasjsonclient.get_user_groups(user.get("username"))
except InfoGatherError as e:
await evt.respond(e.message)
return
respond_message = (
f"User: {user.get('username')},{NL}"
f"Name: {user.get('human_name')},{NL}"
f"Pronouns: {' or '.join(user.get('pronouns') or ['unset'])},{NL}"
f"Creation: {user.get('creation')},{NL}"
f"Timezone: {user.get('timezone')},{NL}"
f"Locale: {user.get('locale')},{NL}"
f"GPG Key IDs: {' and '.join(k for k in user['gpgkeyids'] or ['None'])}{NL}"
)
if groups:
respond_message += f"Groups : {', '.join(groups)}{NL}"
await evt.respond(respond_message) Implemented
Testing:
This pull request aims to improve the user experience of the Below are the screenshots of testcases passed |
IRC zodbot used to also output the groups that a user is a member of.
Here we should also list the groups a user is a member of (and perhaps sponsor of) when someone uses the !user info command.
The text was updated successfully, but these errors were encountered: