{"id":13746640,"url":"https://github.com/cycomachead/hubot-group-alias","last_synced_at":"2025-08-22T00:39:45.617Z","repository":{"id":57150693,"uuid":"21397889","full_name":"cycomachead/hubot-group-alias","owner":"cycomachead","description":"@mentions for groups using Hubot","archived":false,"fork":false,"pushed_at":"2022-01-19T04:52:24.000Z","size":50,"stargazers_count":14,"open_issues_count":7,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-22T18:31:29.516Z","etag":null,"topics":["hubot","hubot-scripts"],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cycomachead.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-01T18:16:54.000Z","updated_at":"2019-12-27T01:58:52.000Z","dependencies_parsed_at":"2022-08-31T23:50:35.616Z","dependency_job_id":null,"html_url":"https://github.com/cycomachead/hubot-group-alias","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycomachead%2Fhubot-group-alias","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycomachead%2Fhubot-group-alias/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycomachead%2Fhubot-group-alias/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycomachead%2Fhubot-group-alias/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cycomachead","download_url":"https://codeload.github.com/cycomachead/hubot-group-alias/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239120223,"owners_count":19584980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hubot","hubot-scripts"],"created_at":"2024-08-03T06:00:57.539Z","updated_at":"2025-02-16T17:38:40.438Z","avatar_url":"https://github.com/cycomachead.png","language":"CoffeeScript","funding_links":[],"categories":["CoffeeScript"],"sub_categories":[],"readme":"# Hubot Group Alias\n\nGroup Alias is a simple [Hubot][hubot] package which allows you to define new **\"@mentions\"** which are automatically expanded. For example, you could define `@dev`, `@design` to send a message to all members of your teams. Using `hubot-auth`, you can also dynamically define groups!\n\n## Setup\n1. All this package to your `package.json`. Do this by running this command:\n\n\t```sh\n\tnpm install --save hubot-group-alias\n\t```\n2. Add \"hubot-group-alias\" to `external-scripts.json`:\n\n\t```json\n\t[\n\t\"...\",\n\t\"hubot-group-alias\",\n\t\"...\"\n\t]\n\t```\n3. Set the `HUBOT_GROUP_ALIAS` variable.\n\n\t\theroku config:add HUBOT_GROUP_ALIAS=...\n\t\n\t* (Read below for configuration instructions.)\n4. _Optional_: set `HUBOT_GROUP_ALIAS_NAME_PROP`\n\t* This is the property of the `User` object that contains the short or @ name for each user. The problem is this field is non-standard and defined by each user.\n\t* This field is likely __required__ if you want sender's usernames to be filtered from the messages sent, or you're using `hubot-auth`. This is because both those features rely on matching this property for expanding the message.\n\t* This property first checks `User.mention_name` then `User.name`\n\t* Here are some examples:\n\t\t* HipChat: `HUBOT_GROUP_ALIAS_NAME_PROP=\"mention_name\"`\n\t\t\t* See the [HipChat adapter source][hc-source] to find `mention_name`\n\t\t* Slack: I [_think_][slack-source] this should be just `User.name`, but I'm not sure, because I don't use Slack.\n\n[hc-source]: https://github.com/hipchat/hubot-hipchat/blob/c2846981dd533860352187c7369e4feb792a9062/src/connector.coffee#L411\n[slack-source]: https://github.com/slackhq/hubot-slack/blob/master/src/slack.coffee#L180\n\n###   `HUBOT_GROUP_ALIAS` Format\nThe format for configuration is easy:\n\n    alias1=user1,user2;alias2=user1\n\nThat is:\n\n* Separate different aliases by `;`.\n* Define an alias with `=`.\n* Separate users by `,`.\n* Users (and aliases) should __not__ have `@`.\n* Aliases are case *insensitive*.\n\n**Note**: *When set in a shell environment, you may want to put `''` around your alias definition so that any `;` don't try to break the command.*\n\n### Dynamic Configuration\nGroup Alias supports dynamically defining groups using the [hubot-auth][auth] package. All \"roles\" that are created by `hubot-auth` will be treated able to be expanded into @mention messages. To do this, simple set:\n\n\tHUBOT_GROUP_ALIAS='DYNAMIC'\n\nand make sure `hubot-auth` is installed.\n\n##### Notes\n* The only supported modes are dynamic or pre-defined. There is currently no \"hybrid\" mode. (I would welcome a PR if anyone wants this!)\n* Currently dynamic mode is _not_ case sensitive because `hubot-auth` roles act the same way.\n* You should probably set `HUBOT_GROUP_ALIAS_NAME_PROP` because otherwise, `hubot-auth` may use a different User name from the @ name. (Please see the section above for more details)\n\n[auth]: https://github.com/hubot-scripts/hubot-auth\n\n## Autocomplete Abilities\nBy default, most chat apps don't support autocomplete for bots. :(\n\nHowever, Group Alias includes the ability to use custom emoji in order to allow apps autocomplete. This should work with most chat clients, though please file an issue if there is a different emoji syntax I've missed. To use this feature, all you need to do is add the emoji to your particular chatroom, with the same name as the alias.\n\nThe script matches the following forms of the alias `dev`:\n\n* @dev\n* (dev)\n* :dev:\n* ::dev::\n\n## Usage\nFor example:\n\nIf you set the configuration as:  `dev=Alice,Bob,Eve`\n\nAnd the message sent is:\n\n`PO\u003e Hey @dev, there's a standup in 5 min.`\n\nThen this message will be sent by Hubot:\n\n`Hubot\u003e Hey @Alice @Bob @Eve, there's a standup in 5 min.`\n\n**Note** that as of version _1.6.0_ users' names are filtered from the messages they send.\n\nIn the above example, the following would happen if @Alice sent a message:\n```\nAlice\u003e Hey @dev, there's a standup in 5 min.`\nHubot\u003e Hey @Bob @Eve, there's a standup in 5 min.`\n```\n\n[hubot]: https://github.com/github/hubot/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcycomachead%2Fhubot-group-alias","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcycomachead%2Fhubot-group-alias","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcycomachead%2Fhubot-group-alias/lists"}