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

Arbitary mentions #6

Open
samhh opened this issue Jun 5, 2023 · 4 comments
Open

Arbitary mentions #6

samhh opened this issue Jun 5, 2023 · 4 comments
Assignees

Comments

@samhh
Copy link
Contributor

samhh commented Jun 5, 2023

We support dynamically mapping channel names to IDs. Could we do the same for user and/or group mentions?:

// We could potentially reverse engineer user group IDs from friendly names

@samhh samhh mentioned this issue Jun 6, 2023
@samhh
Copy link
Contributor Author

samhh commented Sep 15, 2023

This'd make the project more immediately useful to consumers beyond Unsplash. (NB our hosted instance can't be used by anyone else as it's tied to our Slack token.)

@samhh
Copy link
Contributor Author

samhh commented Sep 15, 2023

Yep, we could: https://api.slack.com/methods/usergroups.list

It'd be mostly a copy/paste of how we handle channel names, meaning we'd inherit #5.

@samhh
Copy link
Contributor Author

samhh commented Sep 15, 2023

Example response:

{
    "ok": true,
    "usergroups": [
        {
            "id": "SAWPVDSUW",
            "name": "Web Team",
            "handle": "web-team"
        }
    ]
}

id is what we currently use in to_user_group_id. handle is what we'd want to expose in cc. We could also support pinging specific users but I don't think that's necessary.

So our call sites would need to change from -d cc=web to -d cc=web-team. Or we could change the handles I guess, the suffix is redundant.

@samhh samhh self-assigned this Feb 16, 2024
@samhh
Copy link
Contributor Author

samhh commented Feb 16, 2024

Suggested plan:

  1. Support arbitrary team mentions. Fall back to the current hardcoded ones.
  2. Support arbitrary user mentions, trying team mentions first.
  3. After a little time, separately remove the hardcoded team mentions. (v2? Deprecation?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant