Skip to content

Commit

Permalink
Show joined user accout type.
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiwara committed Jan 5, 2016
1 parent 212c18f commit 6202de5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,17 @@ Loop:
case *slack.ChannelUnarchiveEvent:
notifyMsg = fmt.Sprintf("<@%s> が <#%s> をアーカイブ解除しました", ev.User, ev.Channel)
case *slack.TeamJoinEvent:
notifyMsg = fmt.Sprintf("<@%s> がチームにjoinしました", ev.User.ID)
accoutType := ""
if ev.User.IsBot {
accoutType = "bot"
} else if ev.User.IsRestricted {
accoutType = "restricted"
} else if ev.User.IsUltraRestricted {
accoutType = "guest"
} else {
accoutType = "normal"
}
notifyMsg = fmt.Sprintf("<@%s> がチームにjoinしました (%s)", ev.User.ID, accoutType)
case *slack.BotAddedEvent:
notifyMsg = fmt.Sprintf("bot %s が追加されました https://%s.slack.com/services/%s", ev.Bot.Name, domain, ev.Bot.ID)
case *slack.ConnectedEvent:
Expand Down

0 comments on commit 6202de5

Please sign in to comment.