diff --git a/packages/nodes-base/nodes/Discord/descriptions/MessageDescription.ts b/packages/nodes-base/nodes/Discord/descriptions/MessageDescription.ts new file mode 100644 index 0000000000..17d451e846 --- /dev/null +++ b/packages/nodes-base/nodes/Discord/descriptions/MessageDescription.ts @@ -0,0 +1,91 @@ +import { + INodeProperties, +} from 'n8n-workflow'; + +export const messageOperations = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'message', + ], + }, + }, + options: [ + { + name: 'Create', + value: 'create', + description: 'Create a message', + }, + ], + default: 'create', + description: 'The operation to perform.', + }, +] as INodeProperties[]; + +export const messageFields = [ + + /* -------------------------------------------------------------------------- */ + /* message:create */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Content', + name: 'content', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'message', + ], + operation: [ + 'create', + ], + }, + }, + }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + displayOptions: { + show: { + resource: [ + 'message', + ], + operation: [ + 'create', + ], + }, + }, + default: {}, + options: [ + { + displayName: 'Username', + name: 'username', + type: 'string', + default: '', + description: '', + }, + { + displayName: 'Avatar URL', + name: 'avatar_url', + type: 'string', + default: '', + description: '', + }, + { + displayName: 'TTS', + name: 'tts', + type: 'boolean', + default: false, + description: '', + }, + ], + }, +] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Discord/descriptions/UserDescription.ts b/packages/nodes-base/nodes/Discord/descriptions/UserDescription.ts new file mode 100644 index 0000000000..fd866756cb --- /dev/null +++ b/packages/nodes-base/nodes/Discord/descriptions/UserDescription.ts @@ -0,0 +1,45 @@ +import { + INodeProperties, +} from 'n8n-workflow'; + +export const userOperations = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'user', + ], + }, + }, + options: [ + { + name: 'Get Current User', + value: 'getCurrentUser', + description: 'Returns the user object of the requester\'s account.', + }, + { + name: 'Get Current User Guilds', + value: 'getCurrentUserGuilds', + description: 'Returns a list of partial guild objects the current user is a member of.', + }, + { + name: 'Get User Connections', + value: 'getUserConnections', + description: 'Returns a list of connection objects.', + }, + ], + default: 'getCurrentUser', + description: 'The operation to perform.', + }, +] as INodeProperties[]; + +export const userFields = [ + + /* -------------------------------------------------------------------------- */ + /* user:getUser */ + /* -------------------------------------------------------------------------- */ + +] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Discord/descriptions/index.ts b/packages/nodes-base/nodes/Discord/descriptions/index.ts new file mode 100644 index 0000000000..5dd0c1763a --- /dev/null +++ b/packages/nodes-base/nodes/Discord/descriptions/index.ts @@ -0,0 +1,2 @@ +export * from './MessageDescription'; +export * from './UserDescription';