first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
import type { MessageProperties } from '../../Interfaces';
|
||||
|
||||
export const messagePostEphemeralDescription: MessageProperties = [
|
||||
{
|
||||
displayName: 'User Name or ID',
|
||||
name: 'userId',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getUsers',
|
||||
},
|
||||
options: [],
|
||||
default: '',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['postEphemeral'],
|
||||
resource: ['message'],
|
||||
},
|
||||
},
|
||||
description:
|
||||
'ID of the user to send the ephemeral message to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Channel Name or ID',
|
||||
name: 'channelId',
|
||||
type: 'options',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getChannels',
|
||||
},
|
||||
default: '',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['postEphemeral'],
|
||||
resource: ['message'],
|
||||
},
|
||||
},
|
||||
description:
|
||||
'ID of the channel to send the ephemeral message in. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Message',
|
||||
name: 'message',
|
||||
type: 'string',
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['postEphemeral'],
|
||||
resource: ['message'],
|
||||
},
|
||||
},
|
||||
description: 'Text to send in the ephemeral message',
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,24 @@
|
||||
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
|
||||
|
||||
import { apiRequest } from '../../../transport';
|
||||
|
||||
export async function postEphemeral(
|
||||
this: IExecuteFunctions,
|
||||
index: number,
|
||||
): Promise<INodeExecutionData[]> {
|
||||
const qs = {} as IDataObject;
|
||||
const requestMethod = 'POST';
|
||||
const endpoint = 'posts/ephemeral';
|
||||
|
||||
const body = {
|
||||
user_id: this.getNodeParameter('userId', index),
|
||||
post: {
|
||||
channel_id: this.getNodeParameter('channelId', index),
|
||||
message: this.getNodeParameter('message', index),
|
||||
},
|
||||
} as IDataObject;
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
return this.helpers.returnJsonArray(responseData as IDataObject[]);
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import { messagePostEphemeralDescription as description } from './description';
|
||||
import { postEphemeral as execute } from './execute';
|
||||
|
||||
export { description, execute };
|
||||
Reference in New Issue
Block a user