n8n-nodes-discord-dnd 0.1.60 → 0.1.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,125 +1,4 @@
1
- import { User, Attachment, MessageReference, Poll, MessageCall } from "discord.js";
2
1
  export interface ITriggerParameters {
3
2
  triggerType: string;
4
3
  event: string;
5
4
  }
6
- export interface n8nMessage {
7
- id: string;
8
- content: string;
9
- channelId: string;
10
- guildId: string | null;
11
- createdTimestamp: number;
12
- type: number;
13
- system: boolean;
14
- isDirectMessage: boolean;
15
- author: User;
16
- pinned: boolean;
17
- tts: boolean;
18
- nonce: string | number | null;
19
- embeds: Array<{
20
- title?: string;
21
- description?: string;
22
- url?: string;
23
- timestamp?: string;
24
- color?: number;
25
- fields?: Array<{
26
- name: string;
27
- value: string;
28
- inline?: boolean;
29
- }>;
30
- author?: {
31
- name?: string;
32
- url?: string;
33
- iconURL?: string;
34
- } | null;
35
- footer?: {
36
- text: string;
37
- iconURL?: string;
38
- } | null;
39
- image?: {
40
- url: string;
41
- } | null;
42
- thumbnail?: {
43
- url: string;
44
- } | null;
45
- video?: {
46
- url: string;
47
- } | null;
48
- }>;
49
- components?: Array<{
50
- type: number;
51
- components: Array<{
52
- type: number;
53
- customId?: string;
54
- label?: string;
55
- style?: number;
56
- url?: string;
57
- disabled?: boolean;
58
- }>;
59
- }>;
60
- attachments?: Array<Partial<Attachment>>;
61
- stickers?: any[];
62
- position?: number | null;
63
- roleSubscriptionData?: any;
64
- editedTimestamp: number | null;
65
- mentions: {
66
- everyone: boolean;
67
- users: Array<{
68
- id: string;
69
- username: string;
70
- discriminator: string;
71
- globalName: string | null;
72
- avatar: string | null;
73
- }>;
74
- roles: Array<{
75
- id: string;
76
- name: string;
77
- color: number;
78
- }>;
79
- crosspostedChannels: Array<{
80
- id: string;
81
- guildId: string;
82
- type: number;
83
- }>;
84
- repliedUser: {
85
- id: string;
86
- username: string;
87
- discriminator: string;
88
- globalName: string | null;
89
- avatar: string | null;
90
- } | null;
91
- repliedMessage: {
92
- id: string;
93
- channelId: string;
94
- guildId?: string;
95
- content: string | null;
96
- } | null;
97
- members: Array<{
98
- id: string;
99
- nickname: string | null;
100
- }>;
101
- channels: Array<{
102
- id: string;
103
- name: string;
104
- type: number;
105
- }>;
106
- };
107
- webhookId?: string | null;
108
- applicationId?: string | null;
109
- activity?: any;
110
- flags?: string[];
111
- reference?: MessageReference | null;
112
- interaction?: {
113
- id: string;
114
- type: number;
115
- userId?: string;
116
- } | null;
117
- poll?: Poll | null;
118
- messageSnapshots?: Array<{
119
- message: {
120
- id: string;
121
- content: string;
122
- };
123
- }>;
124
- call?: MessageCall | null;
125
- }
@@ -5,5 +5,4 @@ export declare class DiscordEventHandler {
5
5
  private readonly triggerInstance;
6
6
  constructor(client: Client, triggerInstance: ITriggerFunctions);
7
7
  setupEventHandler(event: string): void;
8
- private setupStatusLogging;
9
8
  }
@@ -8,11 +8,8 @@ class DiscordEventHandler {
8
8
  this.triggerInstance = triggerInstance;
9
9
  }
10
10
  setupEventHandler(event) {
11
- // Log bot status
12
- this.setupStatusLogging();
13
11
  // Handle main events
14
12
  this.client.on(event, async (...args) => {
15
- var _a;
16
13
  const data = {};
17
14
  // Helper to enrich user/member info with roles
18
15
  const enrichMember = async (memberOrUser, guildId) => {
@@ -27,8 +24,6 @@ class DiscordEventHandler {
27
24
  roles: (member === null || member === void 0 ? void 0 : member.roles.cache.map((role) => ({
28
25
  id: role.id,
29
26
  name: role.name,
30
- color: role.color,
31
- position: role.position,
32
27
  }))) || [],
33
28
  };
34
29
  };
@@ -46,12 +41,6 @@ class DiscordEventHandler {
46
41
  else {
47
42
  data.user = message.author;
48
43
  }
49
- if (message.reference && ((_a = messageData.mentions) === null || _a === void 0 ? void 0 : _a.repliedMessage)) {
50
- const referencedContent = await (0, MessageTransformer_1.fetchReferencedMessage)(message);
51
- if (referencedContent) {
52
- messageData.mentions.repliedMessage.content = referencedContent;
53
- }
54
- }
55
44
  break;
56
45
  case "guildMemberAdd":
57
46
  case "guildMemberRemove":
@@ -98,17 +87,6 @@ class DiscordEventHandler {
98
87
  ]);
99
88
  });
100
89
  }
101
- setupStatusLogging() {
102
- this.client.on("ready", () => {
103
- console.log("Bot đã sẵn sàng! Đang chờ tin nhắn...");
104
- });
105
- this.client.on("debug", (info) => {
106
- console.log("Debug Discord.js:", info);
107
- });
108
- this.client.on("error", (error) => {
109
- console.error("Lỗi Discord.js:", error);
110
- });
111
- }
112
90
  }
113
91
  exports.DiscordEventHandler = DiscordEventHandler;
114
92
  //# sourceMappingURL=DiscordEventHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DiscordEventHandler.js","sourceRoot":"","sources":["../../src/handlers/DiscordEventHandler.ts"],"names":[],"mappings":";;;AAEA,2EAG4C;AAE5C,MAAa,mBAAmB;IAC9B,YACmB,MAAc,EACd,eAAkC;QADlC,WAAM,GAAN,MAAM,CAAQ;QACd,oBAAe,GAAf,eAAe,CAAmB;IAClD,CAAC;IAEJ,iBAAiB,CAAC,KAAa;QAC7B,iBAAiB;QACjB,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAE1B,qBAAqB;QACrB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,IAAW,EAAE,EAAE;;YAC7C,MAAM,IAAI,GAAgB,EAAE,CAAC;YAE7B,+CAA+C;YAC/C,MAAM,YAAY,GAAG,KAAK,EAAE,YAAiB,EAAE,OAAgB,EAAE,EAAE;gBACjE,IAAI,CAAC,YAAY;oBAAE,OAAO,IAAI,CAAC;gBAE/B,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;gBACrE,MAAM,MAAM,GAAG,KAAK;oBAClB,CAAC,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,CA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,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;oCACtD,IAAI,MAAM,EAAE;wCACV,YAAY,GAAG,MAAM,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;wCACtD,MAAM;qCACP;iCACF;gCAAC,MAAM;oCACN,qCAAqC;iCACtC;6BACF;4BAED,IAAI,CAAC,IAAI,GAAG,YAAY,IAAI,QAAQ,CAAC;yBACtC;qBACF;aACJ;YAED,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;gBACxB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC;aACrD,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA9FD,kDA8FC"}
@@ -1,9 +1,3 @@
1
1
  import { Message } from "discord.js";
2
- import { n8nMessage } from "../Interfaces/types";
3
- /**
4
- * Fetches the referenced message and returns its content
5
- * @param message The message that contains a reference to another message
6
- * @returns The referenced message content or null if no reference exists
7
- */
8
2
  export declare function fetchReferencedMessage(message: Message): Promise<string | null>;
9
- export declare function messageToJson(message: Message): n8nMessage;
3
+ export declare function messageToJson(message: Message): Promise<any>;
@@ -1,11 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.messageToJson = exports.fetchReferencedMessage = void 0;
4
- /**
5
- * Fetches the referenced message and returns its content
6
- * @param message The message that contains a reference to another message
7
- * @returns The referenced message content or null if no reference exists
8
- */
9
4
  async function fetchReferencedMessage(message) {
10
5
  if (message.reference && message.reference.messageId) {
11
6
  try {
@@ -20,159 +15,12 @@ async function fetchReferencedMessage(message) {
20
15
  return null;
21
16
  }
22
17
  exports.fetchReferencedMessage = fetchReferencedMessage;
23
- function messageToJson(message) {
24
- const n8nMessage = {
18
+ async function messageToJson(message) {
19
+ console.log("reply", await message.fetchReference());
20
+ return {
25
21
  ...message,
26
- // id: message.id,
27
- // content: message.content,
28
- // channelId: message.channelId,
29
- // guildId: message.guildId,
30
- // createdTimestamp: message.createdTimestamp,
31
- // type: message.type,
32
- // system: message.system,
33
- // isDirectMessage: !message.guild,
34
- // author: message.author,
35
- // pinned: message.pinned,
36
- // tts: message.tts,
37
- // nonce: message.nonce,
38
- // embeds: message.embeds?.map((embed: any) => ({
39
- // title: embed.title,
40
- // description: embed.description,
41
- // url: embed.url,
42
- // timestamp: embed.timestamp,
43
- // color: embed.color,
44
- // fields: embed.fields?.map((field: any) => ({
45
- // name: field.name,
46
- // value: field.value,
47
- // inline: field.inline,
48
- // })),
49
- // author: embed.author
50
- // ? {
51
- // name: embed.author.name,
52
- // url: embed.author.url,
53
- // iconURL: embed.author.iconURL,
54
- // }
55
- // : null,
56
- // footer: embed.footer
57
- // ? {
58
- // text: embed.footer.text,
59
- // iconURL: embed.footer.iconURL,
60
- // }
61
- // : null,
62
- // image: embed.image ? { url: embed.image.url } : null,
63
- // thumbnail: embed.thumbnail ? { url: embed.thumbnail.url } : null,
64
- // video: embed.video ? { url: embed.video.url } : null,
65
- // })),
66
- // components: message.components?.map((component: any) => ({
67
- // type: component.type,
68
- // components: component.components?.map((comp: any) => ({
69
- // type: comp.type,
70
- // customId: comp.customId,
71
- // label: comp.label,
72
- // style: comp.style,
73
- // url: comp.url,
74
- // disabled: comp.disabled,
75
- // })),
76
- // })),
77
- // attachments: message.attachments?.map((attachment: any) => ({
78
- // contentType: attachment.contentType,
79
- // description: attachment.description,
80
- // duration: attachment.duration,
81
- // ephemeral: attachment.ephemeral,
82
- // flags: attachment.flags?.toArray(),
83
- // height: attachment.height,
84
- // id: attachment.id,
85
- // name: attachment.name,
86
- // proxyURL: attachment.proxyURL,
87
- // size: attachment.size,
88
- // spoiler: attachment.spoiler,
89
- // title: attachment.title,
90
- // url: attachment.url,
91
- // waveform: attachment.waveform,
92
- // width: attachment.width,
93
- // })),
94
- // stickers: message.stickers?.map((sticker: any) => ({
95
- // id: sticker.id,
96
- // name: sticker.name,
97
- // formatType: sticker.formatType,
98
- // })),
99
- // position: message.position,
100
- // roleSubscriptionData: message.roleSubscriptionData,
101
- // editedTimestamp: message.editedTimestamp,
102
- // mentions: {
103
- // everyone: message.mentions?.everyone,
104
- // users:
105
- // message.mentions?.users?.map((user: any) => ({
106
- // id: user.id,
107
- // username: user.username,
108
- // discriminator: user.discriminator,
109
- // globalName: user.globalName,
110
- // avatar: user.avatar,
111
- // })) || [],
112
- // roles:
113
- // message.mentions?.roles?.map((role: any) => ({
114
- // id: role.id,
115
- // name: role.name,
116
- // color: role.color,
117
- // })) || [],
118
- // crosspostedChannels:
119
- // message.mentions?.crosspostedChannels?.map((channel: any) => ({
120
- // id: channel.id,
121
- // guildId: channel.guildId,
122
- // type: channel.type,
123
- // })) || [],
124
- // repliedUser: message.mentions?.repliedUser
125
- // ? {
126
- // id: message.mentions.repliedUser.id,
127
- // username: message.mentions.repliedUser.username,
128
- // discriminator: message.mentions.repliedUser.discriminator,
129
- // globalName: message.mentions.repliedUser.globalName,
130
- // avatar: message.mentions.repliedUser.avatar,
131
- // }
132
- // : null,
133
- // repliedMessage:
134
- // message.reference && message.reference.messageId
135
- // ? {
136
- // id: message.reference.messageId,
137
- // channelId: message.reference.channelId,
138
- // guildId: message.reference.guildId,
139
- // content: null, // Will be populated if fetchReferencedMessage is called
140
- // }
141
- // : null,
142
- // members:
143
- // message.mentions?.members?.map((member: any) => ({
144
- // id: member.id,
145
- // nickname: member.nickname,
146
- // })) || [],
147
- // channels:
148
- // message.mentions?.channels?.map((channel: any) => ({
149
- // id: channel.id,
150
- // name: channel.name,
151
- // type: channel.type,
152
- // })) || [],
153
- // },
154
- // webhookId: message.webhookId,
155
- // applicationId: message.applicationId,
156
- // activity: message.activity,
157
- // flags: message.flags?.toArray(),
158
- // reference: message.reference,
159
- // interaction: message.interactionMetadata
160
- // ? {
161
- // id: message.interactionMetadata.id,
162
- // type: message.interactionMetadata.type,
163
- // userId: message.interactionMetadata.user?.id,
164
- // }
165
- // : null,
166
- // poll: message.poll,
167
- // messageSnapshots: message.messageSnapshots?.map((snapshot: any) => ({
168
- // message: {
169
- // id: snapshot.message.id,
170
- // content: snapshot.message.content,
171
- // },
172
- // })),
173
- // call: message.call,
22
+ repliedMessage: await fetchReferencedMessage(message),
174
23
  };
175
- return n8nMessage;
176
24
  }
177
25
  exports.messageToJson = messageToJson;
178
26
  //# sourceMappingURL=MessageTransformer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MessageTransformer.js","sourceRoot":"","sources":["../../src/transformers/MessageTransformer.ts"],"names":[],"mappings":";;;AAaA;;;;GAIG;AACI,KAAK,UAAU,sBAAsB,CAC1C,OAAgB;IAEhB,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,SAAS,EAAE;QACpD,IAAI;YACF,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,cAAc,EAAE,CAAC;YACzD,OAAO,iBAAiB,CAAC,OAAO,CAAC;SAClC;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;YAC3D,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAbD,wDAaC;AAED,SAAgB,aAAa,CAAC,OAAgB;IAC5C,MAAM,UAAU,GAAQ;QACtB,GAAG,OAAO;QACV,kBAAkB;QAClB,4BAA4B;QAC5B,gCAAgC;QAChC,4BAA4B;QAC5B,8CAA8C;QAC9C,sBAAsB;QACtB,0BAA0B;QAC1B,mCAAmC;QACnC,0BAA0B;QAC1B,0BAA0B;QAC1B,oBAAoB;QACpB,wBAAwB;QACxB,iDAAiD;QACjD,wBAAwB;QACxB,oCAAoC;QACpC,oBAAoB;QACpB,gCAAgC;QAChC,wBAAwB;QACxB,iDAAiD;QACjD,wBAAwB;QACxB,0BAA0B;QAC1B,4BAA4B;QAC5B,SAAS;QACT,yBAAyB;QACzB,UA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,gDAAgD;QAChD,oFAAoF;QACpF,YAAY;QACZ,gBAAgB;QAChB,aAAa;QACb,yDAAyD;QACzD,uBAAuB;QACvB,mCAAmC;QACnC,iBAAiB;QACjB,cAAc;QACd,2DAA2D;QAC3D,wBAAwB;QACxB,4BAA4B;QAC5B,4BAA4B;QAC5B,iBAAiB;QACjB,KAAK;QACL,gCAAgC;QAChC,wCAAwC;QACxC,8BAA8B;QAC9B,mCAAmC;QACnC,gCAAgC;QAChC,2CAA2C;QAC3C,QAAQ;QACR,4CAA4C;QAC5C,gDAAgD;QAChD,sDAAsD;QACtD,QAAQ;QACR,YAAY;QACZ,sBAAsB;QAEtB,wEAAwE;QACxE,eAAe;QACf,+BAA+B;QAC/B,yCAAyC;QACzC,OAAO;QACP,OAAO;QACP,sBAAsB;KACvB,CAAC;IACF,OAAO,UAAU,CAAC;AACpB,CAAC;AA1JD,sCA0JC"}
1
+ {"version":3,"file":"MessageTransformer.js","sourceRoot":"","sources":["../../src/transformers/MessageTransformer.ts"],"names":[],"mappings":";;;AAEO,KAAK,UAAU,sBAAsB,CAC1C,OAAgB;IAEhB,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,SAAS,EAAE;QACpD,IAAI;YACF,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,cAAc,EAAE,CAAC;YACzD,OAAO,iBAAiB,CAAC,OAAO,CAAC;SAClC;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;YAC3D,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAbD,wDAaC;AAEM,KAAK,UAAU,aAAa,CAAC,OAAgB;IAClD,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IACrD,OAAO;QACL,GAAG,OAAO;QACV,cAAc,EAAE,MAAM,sBAAsB,CAAC,OAAO,CAAC;KACtD,CAAC;AACJ,CAAC;AAND,sCAMC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-discord-dnd",
3
- "version": "0.1.60",
3
+ "version": "0.1.62",
4
4
  "description": "n8n node to create triggers for Discord events",
5
5
  "keywords": [
6
6
  "n8n",