Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Slack Node): Add support for getting the profile of a user #7829

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/nodes-base/nodes/Slack/V2/SlackV2.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,11 @@ export class SlackV2 implements INodeType {
qs.user = this.getNodeParameter('user', i, undefined, { extractValue: true }) as string;
responseData = await slackApiRequest.call(this, 'GET', '/users.getPresence', {}, qs);
}
if (operation === 'getProfile') {
qs.user = this.getNodeParameter('user', i, undefined, { extractValue: true }) as string;
responseData = await slackApiRequest.call(this, 'GET', '/users.profile.get', {}, qs);
responseData = responseData.profile;
}
if (operation === 'updateProfile') {
const options = this.getNodeParameter('options', i);
const timezone = this.getTimezone();
Expand Down
8 changes: 7 additions & 1 deletion packages/nodes-base/nodes/Slack/V2/UserDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ export const userOperations: INodeProperties[] = [
description: 'Get a list of many users',
action: 'Get many users',
},
{
name: "Get User's Profile",
value: 'getProfile',
description: "Get a user's",
action: "Get a user's profile",
},
{
name: "Get User's Status",
value: 'getPresence',
Expand Down Expand Up @@ -54,7 +60,7 @@ export const userFields: INodeProperties[] = [
description: 'The ID of the user to get information about',
displayOptions: {
show: {
operation: ['info'],
operation: ['info', 'getProfile'],
resource: ['user'],
},
},
Expand Down
Loading