Minor improvements to Slack-Node

This commit is contained in:
Jan Oberhauser 2021-01-25 14:56:59 +01:00
parent 025272953e
commit 2c834ef9c4
2 changed files with 9 additions and 9 deletions

View file

@ -15,6 +15,11 @@ export const messageOperations = [
}, },
}, },
options: [ options: [
{
name: 'Delete',
value: 'delete',
description: 'Deletes a message',
},
{ {
name: 'Get Permalink', name: 'Get Permalink',
value: 'getPermalink', value: 'getPermalink',
@ -33,12 +38,7 @@ export const messageOperations = [
{ {
name: 'Update', name: 'Update',
value: 'update', value: 'update',
description: 'Updates a message.', description: 'Updates a message',
},
{
name: 'Delete',
value: 'delete',
description: 'Deletes a message.',
}, },
], ],
default: 'post', default: 'post',
@ -1711,7 +1711,7 @@ export const messageFields = [
}, },
{ {
displayName: 'Timestamp', displayName: 'Timestamp',
name: 'ts', name: 'timestamp',
type: 'string', type: 'string',
required: true, required: true,
default: '', default: '',

View file

@ -798,10 +798,10 @@ export class Slack implements INodeType {
//https://api.slack.com/methods/chat.delete //https://api.slack.com/methods/chat.delete
if (operation === 'delete') { if (operation === 'delete') {
const channel = this.getNodeParameter('channelId', i) as string; const channel = this.getNodeParameter('channelId', i) as string;
const ts = this.getNodeParameter('ts', i) as string; const timestamp = this.getNodeParameter('timestamp', i) as string;
const body: IDataObject = { const body: IDataObject = {
channel, channel,
ts, ts: timestamp,
}; };
// Add all the other options to the request // Add all the other options to the request
responseData = await slackApiRequest.call(this, 'POST', '/chat.delete', body, qs); responseData = await slackApiRequest.call(this, 'POST', '/chat.delete', body, qs);