@mahesvara/discord-mcpserver 1.1.2 → 1.1.3
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.
- package/dist/services/discord.d.ts +1 -1
- package/dist/tools/channel.js +1 -1
- package/dist/tools/emoji.js +2 -2
- package/dist/tools/event.js +1 -1
- package/dist/tools/guild.js +1 -1
- package/dist/tools/invite.js +1 -1
- package/dist/tools/member.js +1 -1
- package/dist/tools/message.js +1 -1
- package/dist/tools/moderation.js +3 -3
- package/dist/tools/role.js +1 -1
- package/dist/tools/webhook.js +1 -1
- package/package.json +1 -1
|
@@ -43,7 +43,7 @@ export declare function truncateIfNeeded(text: string, limit?: number): string;
|
|
|
43
43
|
/**
|
|
44
44
|
* Format response based on format preference
|
|
45
45
|
*/
|
|
46
|
-
export declare function formatResponse<T>(data: T, format: ResponseFormat, markdownFormatter: (item: T) => string): string;
|
|
46
|
+
export declare function formatResponse<T>(data: T | T[], format: ResponseFormat, markdownFormatter: (item: T) => string): string;
|
|
47
47
|
export declare function guildToMarkdown(guild: DiscordGuild): string;
|
|
48
48
|
export declare function channelToMarkdown(channel: DiscordChannel): string;
|
|
49
49
|
export declare function memberToMarkdown(member: DiscordMember): string;
|
package/dist/tools/channel.js
CHANGED
|
@@ -63,7 +63,7 @@ Returns:
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
const formatted = filteredChannels.map(c => formatChannel(c));
|
|
66
|
-
const text = formatResponse(formatted, params.response_format,
|
|
66
|
+
const text = formatResponse(formatted, params.response_format, channelToMarkdown);
|
|
67
67
|
return {
|
|
68
68
|
content: [{ type: "text", text: truncateIfNeeded(text) }],
|
|
69
69
|
};
|
package/dist/tools/emoji.js
CHANGED
|
@@ -41,7 +41,7 @@ Returns:
|
|
|
41
41
|
roles: emoji.roles.cache.map(r => r.name),
|
|
42
42
|
url: emoji.url,
|
|
43
43
|
}));
|
|
44
|
-
const result = formatResponse(emojis, params.response_format, (
|
|
44
|
+
const result = formatResponse(emojis, params.response_format, (e) => `${e.animated ? '(animated) ' : ''}**${e.name}** - ID: ${e.id}`);
|
|
45
45
|
return {
|
|
46
46
|
content: [{ type: "text", text: truncateIfNeeded(result) }],
|
|
47
47
|
};
|
|
@@ -185,7 +185,7 @@ Returns:
|
|
|
185
185
|
available: sticker.available,
|
|
186
186
|
url: sticker.url,
|
|
187
187
|
}));
|
|
188
|
-
const result = formatResponse(stickerList, params.response_format, (
|
|
188
|
+
const result = formatResponse(stickerList, params.response_format, (s) => `**${s.name}** (ID: ${s.id})\nDescription: ${s.description || 'None'}\nTags: ${s.tags || 'None'}`);
|
|
189
189
|
return {
|
|
190
190
|
content: [{ type: "text", text: truncateIfNeeded(result) }],
|
|
191
191
|
};
|
package/dist/tools/event.js
CHANGED
|
@@ -44,7 +44,7 @@ Returns:
|
|
|
44
44
|
userCount: event.userCount,
|
|
45
45
|
creator: event.creator?.username,
|
|
46
46
|
}));
|
|
47
|
-
const result = formatResponse(eventList, params.response_format, (
|
|
47
|
+
const result = formatResponse(eventList, params.response_format, (e) => `**${e.name}** (ID: ${e.id})\nStatus: ${e.status}\nStart: ${e.scheduledStartTime}\nLocation: ${e.location || e.channel || 'TBD'}\nAttending: ${e.userCount || 0}`);
|
|
48
48
|
return {
|
|
49
49
|
content: [{ type: "text", text: truncateIfNeeded(result) }],
|
|
50
50
|
};
|
package/dist/tools/guild.js
CHANGED
|
@@ -24,7 +24,7 @@ Returns:
|
|
|
24
24
|
try {
|
|
25
25
|
const client = await getClient();
|
|
26
26
|
const guilds = client.guilds.cache.map(formatGuild);
|
|
27
|
-
const text = formatResponse(guilds, params.response_format,
|
|
27
|
+
const text = formatResponse(guilds, params.response_format, guildToMarkdown);
|
|
28
28
|
return {
|
|
29
29
|
content: [{ type: "text", text: truncateIfNeeded(text) }],
|
|
30
30
|
};
|
package/dist/tools/invite.js
CHANGED
|
@@ -42,7 +42,7 @@ Returns:
|
|
|
42
42
|
createdAt: invite.createdAt?.toISOString(),
|
|
43
43
|
expiresAt: invite.expiresAt?.toISOString() || 'Never',
|
|
44
44
|
}));
|
|
45
|
-
const result = formatResponse(inviteList, params.response_format, (
|
|
45
|
+
const result = formatResponse(inviteList, params.response_format, (i) => `**${i.code}** - #${i.channel}\nUses: ${i.uses}/${i.maxUses} | Expires: ${i.expiresAt}\nCreated by: ${i.inviter}`);
|
|
46
46
|
return {
|
|
47
47
|
content: [{ type: "text", text: truncateIfNeeded(result) }],
|
|
48
48
|
};
|
package/dist/tools/member.js
CHANGED
|
@@ -38,7 +38,7 @@ Returns:
|
|
|
38
38
|
// Convert Collection to array
|
|
39
39
|
const membersArray = Array.from(membersResult.values());
|
|
40
40
|
const formatted = membersArray.map((m) => formatMember(m));
|
|
41
|
-
const text = formatResponse(formatted, params.response_format,
|
|
41
|
+
const text = formatResponse(formatted, params.response_format, memberToMarkdown);
|
|
42
42
|
return {
|
|
43
43
|
content: [{ type: "text", text: truncateIfNeeded(text) }],
|
|
44
44
|
};
|
package/dist/tools/message.js
CHANGED
|
@@ -82,7 +82,7 @@ Returns:
|
|
|
82
82
|
options.after = params.after;
|
|
83
83
|
const messages = await channel.messages.fetch(options);
|
|
84
84
|
const formatted = messages.map((m) => formatMessage(m));
|
|
85
|
-
const text = formatResponse(Array.from(formatted.values()), params.response_format,
|
|
85
|
+
const text = formatResponse(Array.from(formatted.values()), params.response_format, messageToMarkdown);
|
|
86
86
|
return {
|
|
87
87
|
content: [{ type: "text", text: truncateIfNeeded(text) }],
|
|
88
88
|
};
|
package/dist/tools/moderation.js
CHANGED
|
@@ -214,7 +214,7 @@ Returns:
|
|
|
214
214
|
username: ban.user.username,
|
|
215
215
|
reason: ban.reason || 'No reason provided',
|
|
216
216
|
}));
|
|
217
|
-
const result = formatResponse(banList, params.response_format, (
|
|
217
|
+
const result = formatResponse(banList, params.response_format, (b) => `**${b.username}** (${b.userId})\nReason: ${b.reason}`);
|
|
218
218
|
return {
|
|
219
219
|
content: [{ type: "text", text: truncateIfNeeded(result) }],
|
|
220
220
|
};
|
|
@@ -340,7 +340,7 @@ Returns:
|
|
|
340
340
|
new: c.new,
|
|
341
341
|
})),
|
|
342
342
|
}));
|
|
343
|
-
const result = formatResponse(entries, params.response_format, (
|
|
343
|
+
const result = formatResponse(entries, params.response_format, (e) => `**Action ${e.action}** by ${e.executor}\nTarget: ${e.target}\nReason: ${e.reason}\nTime: ${e.createdAt}`);
|
|
344
344
|
return {
|
|
345
345
|
content: [{ type: "text", text: truncateIfNeeded(result) }],
|
|
346
346
|
};
|
|
@@ -388,7 +388,7 @@ Returns:
|
|
|
388
388
|
triggerType: rule.triggerType,
|
|
389
389
|
actions: rule.actions.map(a => ({ type: a.type, metadata: a.metadata })),
|
|
390
390
|
}));
|
|
391
|
-
const text = formatResponse(ruleList, params.response_format, (
|
|
391
|
+
const text = formatResponse(ruleList, params.response_format, (r) => `**${r.name}** (${r.id})\nEnabled: ${r.enabled}\nTrigger: ${r.triggerType}\nActions: ${r.actions.map(a => a.type).join(', ')}`);
|
|
392
392
|
return {
|
|
393
393
|
content: [{ type: "text", text: truncateIfNeeded(text) }],
|
|
394
394
|
};
|
package/dist/tools/role.js
CHANGED
|
@@ -54,7 +54,7 @@ Returns:
|
|
|
54
54
|
.filter(r => r.name !== "@everyone")
|
|
55
55
|
.sort((a, b) => b.position - a.position)
|
|
56
56
|
.map(formatRole);
|
|
57
|
-
const text = formatResponse(Array.from(roles.values()), params.response_format,
|
|
57
|
+
const text = formatResponse(Array.from(roles.values()), params.response_format, roleToMarkdown);
|
|
58
58
|
return {
|
|
59
59
|
content: [{ type: "text", text: truncateIfNeeded(text) }],
|
|
60
60
|
};
|
package/dist/tools/webhook.js
CHANGED
|
@@ -57,7 +57,7 @@ Returns:
|
|
|
57
57
|
owner: wh.owner?.username || 'Unknown',
|
|
58
58
|
avatar: wh.avatarURL(),
|
|
59
59
|
}));
|
|
60
|
-
const result = formatResponse(webhookList, params.response_format, (
|
|
60
|
+
const result = formatResponse(webhookList, params.response_format, (w) => `**${w.name}** (ID: ${w.id})\nChannel: <#${w.channel}>\nOwner: ${w.owner}`);
|
|
61
61
|
return {
|
|
62
62
|
content: [{ type: "text", text: truncateIfNeeded(result) }],
|
|
63
63
|
};
|