wantedly/slack-mention-converter

Name: slack-mention-converter

Owner: Wantedly, Inc.

Description: Convert login name or account name to Slack mention format.

Created: 2016-04-12 04:55:28.0

Updated: 2016-12-11 08:45:20.0

Pushed: 2017-01-26 10:14:00.0

Homepage:

Size: 7032

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

slack-mention-converter

Build Status

DEPRECATED

This project is no longer actively maintained by Wantedly, Inc. Newly developed developers-account-mapper covers almost all features on this project. Please consider using this.

Summary

Convert login name or account name to Slack mention format.

ack-mention-converter to-slack-mention dtan4
2XXXXXX|dai>
Description

Convert login name or account name to slack mention format. Mappings of login_name and account_name are stored at Amazon DynamoDB.

The most simple example usage is

ack-mention-converter register your_login_name your_slack_name
 your_login_name:@your_slack_name added.
ack-mention-converter to-slack-mention your_login_name
2XXXXXX|your_slack_name>
Usage
AWS configuration

2 DynamoDB tables named SlackNames and SlackIDs must be created.

SlackNames table

|Key|Type| | |—|—-|—| |LoginName|String|Primary key| |SlackName|String||

SlackIDs table

|Key|Type| | |—|—-|—| |SlackName|String|Primary key| |SlackID|String||

In addition, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_REGION must be set at your shell. This IAM user/role must be allowed to read/write the DynamoDB tables above.

Command usage
e: slack-mention-converter [--version] [--help] <command> [<args>]

lable commands are:
list                List mapping of <login_name> and <slack_name>
register            Register LoginName and SlackName mapping
slack-name-list     List up slack users id and name mapping
to-slack-mention    Get slack mention format from login name
to-slack-name       Get slack name from login name
version             Print slack-mention-converter version and quit
Use by Docker
Build
ke docker-build
Run
er run --rm \
 SLACK_API_TOKEN=<slack token get by https://api.slack.com/docs/oauth-test-tokens>  \
 AWS_ACCESS_KEY_ID=yourawsaccesskeyid \
 AWS_SECRET_ACCESS_KEY=yourawssecretaccesskey \
 AWS_REGION=ap-northeast-1 \
ay.io/wantedly/slack-mention-converter \
ommand>
Install

To install, use go get and make:

 get -d github.com/wantedly/slack-mention-converter
ke
ke install
Contribution
  1. Fork (https://github.com/wantedly/slack-mention-converter/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create a new Pull Request
Author

wantedly

License

MIT License


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.