( userId: string, token: string )
| 235 | }; |
| 236 | |
| 237 | export const getSlackUser = async ( |
| 238 | userId: string, |
| 239 | token: string |
| 240 | ): Promise<UserInfo> => { |
| 241 | const url = 'https://slack.com/api/users.info?'; |
| 242 | |
| 243 | const response = await request |
| 244 | .get(url + 'user=' + userId) |
| 245 | .set('Authorization', 'Bearer ' + token); |
| 246 | |
| 247 | const responseBody = response.body as UserInfoResponseBody; |
| 248 | return responseBody.user; |
| 249 | }; |
| 250 | |
| 251 | export const getSlackBot = async ( |
| 252 | botId: string, |
no test coverage detected