Skip to content

Commit 9c6893e

Browse files
authored
feat(web-api): support Slackbot availability in team.info (#2803)
1 parent 6f6fbd1 commit 9c6893e

4 files changed

Lines changed: 20 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@slack/web-api": minor
3+
---
4+
5+
Add the optional `include_slackbot_availability` argument and `team.slackbot_availability` response field to `team.info`.

‎packages/web-api/src/types/request/team.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ export type TeamInfoArguments = OptionalArgument<
6868
* This also expects the domain to belong to a team and not the enterprise itself.
6969
*/
7070
domain?: string; // available only for Enterprise Grid
71+
/**
72+
* @description Include advisory Slackbot availability for the caller's own workspace or organization.
73+
* Defaults to false. Requires the existing `team:read` scope.
74+
* @see {@link https://docs.slack.dev/reference/methods/team.info `team.info` API reference}.
75+
*/
76+
include_slackbot_availability?: boolean;
7177
/** @description Team to get info about; if omitted, will return information about the current team. */
7278
team?: string;
7379
}

‎packages/web-api/src/types/response/TeamInfoResponse.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export interface Team {
3333
locale?: string;
3434
name?: string;
3535
pay_prod_cur?: string;
36+
slackbot_availability?: string;
3637
sso_provider?: SsoProvider;
3738
url?: string;
3839
}

‎packages/web-api/test/types/methods/team.test-d.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { expectAssignable, expectError } from 'tsd';
1+
import { expectAssignable, expectError, expectType } from 'tsd';
22

33
import { WebClient } from '../../../src/WebClient';
44

@@ -39,9 +39,16 @@ expectAssignable<Parameters<typeof web.team.externalTeams.list>>([{}]); // all o
3939

4040
// team.info
4141
// -- sad path
42+
expectError(web.team.info({ include_slackbot_availability: 'true' }));
4243
// -- happy path
4344
expectAssignable<Parameters<typeof web.team.info>>([{}]); // all optional arguments
4445
expectAssignable<Parameters<typeof web.team.info>>([]); // no arg is fine
46+
expectAssignable<Parameters<typeof web.team.info>>([{ include_slackbot_availability: true }]);
47+
expectAssignable<Parameters<typeof web.team.info>>([{ team: 'T1234', include_slackbot_availability: false }]);
48+
expectAssignable<Parameters<typeof web.team.info>>([{ domain: 'example', include_slackbot_availability: true }]);
49+
web.team.info({ include_slackbot_availability: true }).then((response) => {
50+
expectType<string | undefined>(response.team?.slackbot_availability);
51+
});
4552

4653
// team.integrationLogs
4754
// -- sad path

0 commit comments

Comments
 (0)