mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
🐛 Fix slack as_user (#708)
* Ignore as_user only when it is false * Update as_user description
This commit is contained in:
parent
5d6c7657cb
commit
fe56c8778d
|
@ -91,7 +91,7 @@ export const messageFields = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description: 'Post the message as authenticated user instead of bot.',
|
description: 'Post the message as authenticated user instead of bot. Works only with user token.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'User Name',
|
displayName: 'User Name',
|
||||||
|
@ -486,6 +486,26 @@ export const messageFields = [
|
||||||
},
|
},
|
||||||
description: `Timestamp of the message to be updated.`,
|
description: `Timestamp of the message to be updated.`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: 'As User',
|
||||||
|
name: 'as_user',
|
||||||
|
type: 'boolean',
|
||||||
|
default: false,
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
authentication: [
|
||||||
|
'accessToken',
|
||||||
|
],
|
||||||
|
operation: [
|
||||||
|
'update'
|
||||||
|
],
|
||||||
|
resource: [
|
||||||
|
'message',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
description: 'Pass true to update the message as the authed user. Works only with user token.',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Update Fields',
|
displayName: 'Update Fields',
|
||||||
name: 'updateFields',
|
name: 'updateFields',
|
||||||
|
|
|
@ -452,12 +452,9 @@ export class Slack implements INodeType {
|
||||||
}
|
}
|
||||||
if (body.as_user === false) {
|
if (body.as_user === false) {
|
||||||
body.username = this.getNodeParameter('username', i) as string;
|
body.username = this.getNodeParameter('username', i) as string;
|
||||||
|
delete body.as_user;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore body.as_user as it's deprecated
|
|
||||||
|
|
||||||
delete body.as_user;
|
|
||||||
|
|
||||||
if (!jsonParameters) {
|
if (!jsonParameters) {
|
||||||
const attachments = this.getNodeParameter('attachments', i, []) as unknown as Attachment[];
|
const attachments = this.getNodeParameter('attachments', i, []) as unknown as Attachment[];
|
||||||
const blocksUi = (this.getNodeParameter('blocksUi', i, []) as IDataObject).blocksValues as IDataObject[];
|
const blocksUi = (this.getNodeParameter('blocksUi', i, []) as IDataObject).blocksValues as IDataObject[];
|
||||||
|
|
Loading…
Reference in a new issue