fun getBot()

in src/main/kotlin/jetbrains/buildServer/notification/slackNotifier/slack/AggregatedSlackApi.kt [92:103]


    fun getBot(token: String): AggregatedBot {
        return myBotCache.getOrPut(token) {
            val bot = slackApi.authTest(token)
            val botInfo = slackApi.botsInfo(token, bot.botId)
            val userInfo = slackApi.usersInfo(token, botInfo.bot.userId)
            val teamId = userInfo.user?.teamId
            val team = teamId?.let {
                slackApi.teamInfo(token, it)
            }
            AggregatedBot(id = bot.botId, teamId = teamId, teamDomain = team?.team?.domain)
        }
    }