Skip to content

Instantly share code, notes, and snippets.

@nikukyugamer
Created November 22, 2019 05:28
Show Gist options
  • Save nikukyugamer/faef52082440d897f246084a8ee3b424 to your computer and use it in GitHub Desktop.
Save nikukyugamer/faef52082440d897f246084a8ee3b424 to your computer and use it in GitHub Desktop.
nlopes/slack を使って Slack からユーザ情報を取得する
package main
import (
"fmt"
"github.com/nlopes/slack"
)
func main() {
api := slack.New("xoxp-12345-12345-12345-abcdef-abcdef")
user, err := api.GetUserInfo("?1?1?1?11?")
if err != nil {
fmt.Printf("%s\n", err)
return
}
fmt.Printf("ID: %s, Fullname: %s, Email: %s\n", user.ID, user.Profile.RealName, user.Profile.Email)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment