diff --git a/packages/nodes-base/nodes/Slack/FileDescription.ts b/packages/nodes-base/nodes/Slack/FileDescription.ts index e33b9e356e..73c73682b6 100644 --- a/packages/nodes-base/nodes/Slack/FileDescription.ts +++ b/packages/nodes-base/nodes/Slack/FileDescription.ts @@ -239,14 +239,14 @@ export const fileFields = [ description: 'Show truncated file info for files hidden due to being too old, and the team who owns the file being over the file limit.', }, { - displayName: 'TS From', + displayName: 'Timestamp From', name: 'tsFrom', type: 'string', default: '', description: 'Filter files created after this timestamp (inclusive).', }, { - displayName: 'TS To', + displayName: 'Timestamp To', name: 'tsTo', type: 'string', default: '', diff --git a/packages/nodes-base/nodes/Slack/MessageDescription.ts b/packages/nodes-base/nodes/Slack/MessageDescription.ts index 99bb83bc8e..16977b6e28 100644 --- a/packages/nodes-base/nodes/Slack/MessageDescription.ts +++ b/packages/nodes-base/nodes/Slack/MessageDescription.ts @@ -15,6 +15,11 @@ export const messageOperations = [ }, }, options: [ + { + name: 'Get Permalink', + value: 'getPermalink', + description: 'Get Permanent Link of a message', + }, { name: 'Post', value: 'post', @@ -30,11 +35,6 @@ export const messageOperations = [ value: 'update', description: 'Updates a message.', }, - { - name: 'Get Permalink', - value: 'getPermalink', - description: 'Get Permanent Link of a message', - }, ], default: 'post', description: 'The operation to perform.', @@ -43,6 +43,49 @@ export const messageOperations = [ export const messageFields = [ + /* ----------------------------------------------------------------------- */ + /* message:getPermalink + /* ----------------------------------------------------------------------- */ + { + displayName: 'Channel', + name: 'channelId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getChannels', + }, + required: true, + default: '', + displayOptions: { + show: { + resource: [ + 'message', + ], + operation: [ + 'getPermalink', + ], + }, + }, + description: 'Channel containing the message.', + }, + { + displayName: 'Timestamp', + name: 'timestamp', + type: 'string', + required: true, + default: '', + displayOptions: { + show: { + resource: [ + 'message', + ], + operation: [ + 'getPermalink', + ], + }, + }, + description: `Timestamp of the message to get permanent link.`, + }, + /* -------------------------------------------------------------------------- */ /* message:post/postEphemeral */ /* -------------------------------------------------------------------------- */ @@ -1637,46 +1680,4 @@ export const messageFields = [ ], }, - /* ----------------------------------------------------------------------- */ - /* message:getPermaLink - /* ----------------------------------------------------------------------- */ - { - displayName: 'Channel', - name: 'channelId', - type: 'options', - typeOptions: { - loadOptionsMethod: 'getChannels', - }, - required: true, - default: '', - displayOptions: { - show: { - resource: [ - 'message', - ], - operation: [ - 'getPermalink', - ], - }, - }, - description: 'Channel containing the message to be updated.', - }, - { - displayName: 'TS', - name: 'messageTs', - type: 'string', - required: true, - default: '', - displayOptions: { - show: { - resource: [ - 'message', - ], - operation: [ - 'getPermalink', - ], - }, - }, - description: `Timestamp of the message to get permanent link.`, - }, ] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Slack/Slack.node.ts b/packages/nodes-base/nodes/Slack/Slack.node.ts index 54ef13c096..75d597b3fe 100644 --- a/packages/nodes-base/nodes/Slack/Slack.node.ts +++ b/packages/nodes-base/nodes/Slack/Slack.node.ts @@ -798,8 +798,11 @@ export class Slack implements INodeType { //https://api.slack.com/methods/chat.getPermalink if (operation === 'getPermalink') { const channel = this.getNodeParameter('channelId', i) as string; - const ts = this.getNodeParameter('messageTs', i) as string; - const qs = { channel, message_ts: ts }; + const timestamp = this.getNodeParameter('timestamp', i) as string; + const qs = { + channel, + message_ts: timestamp, + }; responseData = await slackApiRequest.call(this, 'GET', '/chat.getPermalink', {}, qs); } }