Closed RamblingCookieMonster closed 4 years ago
@RamblingCookieMonster I'm gonna have to read up on this a bit. All the different names is making my head hurt 🤕
Is this what's causing my freshly-installed bot to throw "User [xxxxxx] not found", "Could not resolve user [xxxxx]", and "Unable to resolve ID for admin [xxxxxx]"?
Could be @1DontEx1st. Right now, PoshBot uses the nickname
to map users to their IDs.
You can validate it @1DontEx1st - get your token, and run something like this:
Get-SlackUser -Token $Token |
select name, displayname |
where {$_.name -notlike $_.displayname -and $_.displayname} |
sort name
Anyone coming up there will be mismatched. PoshBot uses the name
, Slack is now oriented around displayname
which occasionally differs from name
(I don't know the specific details in what causes the divergence when someone signs up for or is provisioned an account). So you @ the displayname
, but if name
doesn't match, PoshBot doesn't know who you're talking about.
In the interim, you could have folks on your team change their name
, or just use the name
you find with that PSSlack output.
Cheers!
Thanks for the quick response! I had tried the display name, the full name, and the 9-character encoded (?) name, obviously with zero luck. It turns out the name is the same as our AD name, so it's simple for me to deal with, but that wasn't exposed anywhere on Slack's site (at least nowhere I looked). Thanks again, Get-SlackUser worked perfectly!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I found the actual user name...rather than running commands, you can go to https://*YourSlackSpace*.slack.com/account/settings#username
The name poshbot needs is in the username field
Back in 2017, Slack changed the way names were handled, making PSSlack's
name
somewhat useless. It might be worth moving todisplayname
.In a number of functions, I map a Slack @ name (discoverable by users by simply typing) to another identity system via some sort of map. It would be helpful to keep the names exposed by poshbot consistent with the names you can @ mention.
I could see two potential solutions:
name
withdisplayname
- this may break RBAC and any folks already relying on username (when different than displayname)displayname
,mentionname
or some other field to aPerson
that maps back to the Slackdisplayname
The latter seems less disruptive. In both cases, exposing this via
$global:PoshBotContext
would be useful.Cheers!