2023-01-27 03:22:44 -08:00
|
|
|
import type { INodeProperties } from 'n8n-workflow';
|
2020-11-03 14:01:38 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const directMessageOperations: INodeProperties[] = [
|
2020-11-03 14:01:38 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-11-03 14:01:38 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['directMessage'],
|
2020-11-03 14:01:38 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
2023-06-28 03:19:25 -07:00
|
|
|
description: 'Send a direct message to a user',
|
|
|
|
action: 'Create Direct Message',
|
2020-11-03 14:01:38 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'create',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-11-03 14:01:38 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const directMessageFields: INodeProperties[] = [
|
2020-11-03 14:11:20 -08:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* directMessage:create */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-11-03 14:01:38 -08:00
|
|
|
{
|
2023-06-28 03:19:25 -07:00
|
|
|
displayName: 'User',
|
|
|
|
name: 'user',
|
|
|
|
type: 'resourceLocator',
|
|
|
|
default: { mode: 'username', value: '' },
|
2020-11-03 14:01:38 -08:00
|
|
|
required: true,
|
2023-06-28 03:19:25 -07:00
|
|
|
description: 'The user you want to send the message to',
|
2020-11-03 14:01:38 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['create'],
|
|
|
|
resource: ['directMessage'],
|
2020-11-03 14:01:38 -08:00
|
|
|
},
|
|
|
|
},
|
2023-06-28 03:19:25 -07:00
|
|
|
modes: [
|
|
|
|
{
|
|
|
|
displayName: 'By Username',
|
|
|
|
name: 'username',
|
|
|
|
type: 'string',
|
|
|
|
validation: [],
|
|
|
|
placeholder: 'e.g. n8n',
|
|
|
|
url: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'By ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
validation: [],
|
|
|
|
placeholder: 'e.g. 1068479892537384960',
|
|
|
|
url: '',
|
|
|
|
},
|
|
|
|
],
|
2020-11-03 14:01:38 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Text',
|
|
|
|
name: 'text',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
2023-06-28 03:19:25 -07:00
|
|
|
typeOptions: {
|
|
|
|
rows: 2,
|
|
|
|
},
|
2020-11-03 14:01:38 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['create'],
|
|
|
|
resource: ['directMessage'],
|
2020-11-03 14:01:38 -08:00
|
|
|
},
|
|
|
|
},
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
2023-06-28 03:19:25 -07:00
|
|
|
'The text of the direct message. URL encoding is required. Max length of 10,000 characters.',
|
2020-11-03 14:01:38 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['create'],
|
|
|
|
resource: ['directMessage'],
|
2020-11-03 14:01:38 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
2023-06-28 03:19:25 -07:00
|
|
|
displayName: 'Attachment ID',
|
|
|
|
name: 'attachments',
|
2020-11-03 14:01:38 -08:00
|
|
|
type: 'string',
|
2023-06-28 03:19:25 -07:00
|
|
|
default: '',
|
|
|
|
placeholder: '1664279886239010824',
|
|
|
|
description: 'The attachment ID to associate with the message',
|
2020-11-03 14:01:38 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|