@mahesvara/discord-mcpserver 1.0.7 → 1.0.9
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/index.js +7 -2835
- package/dist/schemas/channel.d.ts +158 -0
- package/dist/schemas/channel.js +128 -0
- package/dist/schemas/common.d.ts +23 -0
- package/dist/schemas/common.js +71 -0
- package/dist/schemas/community.d.ts +181 -0
- package/dist/schemas/community.js +60 -0
- package/dist/schemas/emoji.d.ts +59 -0
- package/dist/schemas/emoji.js +29 -0
- package/dist/schemas/event.d.ts +62 -0
- package/dist/schemas/event.js +33 -0
- package/dist/schemas/guild.d.ts +85 -0
- package/dist/schemas/guild.js +42 -0
- package/dist/schemas/index.d.ts +12 -855
- package/dist/schemas/index.js +13 -617
- package/dist/schemas/invite.d.ts +40 -0
- package/dist/schemas/invite.js +32 -0
- package/dist/schemas/member.d.ts +60 -0
- package/dist/schemas/member.js +33 -0
- package/dist/schemas/message.d.ts +121 -0
- package/dist/schemas/message.js +61 -0
- package/dist/schemas/moderation.d.ts +343 -0
- package/dist/schemas/moderation.js +152 -0
- package/dist/schemas/role.d.ts +126 -0
- package/dist/schemas/role.js +73 -0
- package/dist/schemas/webhook.d.ts +51 -0
- package/dist/schemas/webhook.js +33 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +6 -0
- package/dist/tools/channel.d.ts +2 -0
- package/dist/tools/channel.js +510 -0
- package/dist/tools/community.d.ts +2 -0
- package/dist/tools/community.js +259 -0
- package/dist/tools/emoji.d.ts +2 -0
- package/dist/tools/emoji.js +247 -0
- package/dist/tools/event.d.ts +2 -0
- package/dist/tools/event.js +170 -0
- package/dist/tools/guild.d.ts +2 -0
- package/dist/tools/guild.js +198 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +24 -0
- package/dist/tools/invite.d.ts +2 -0
- package/dist/tools/invite.js +143 -0
- package/dist/tools/member.d.ts +2 -0
- package/dist/tools/member.js +200 -0
- package/dist/tools/message.d.ts +2 -0
- package/dist/tools/message.js +386 -0
- package/dist/tools/moderation.d.ts +2 -0
- package/dist/tools/moderation.js +641 -0
- package/dist/tools/role.d.ts +2 -0
- package/dist/tools/role.js +420 -0
- package/dist/tools/webhook.d.ts +2 -0
- package/dist/tools/webhook.js +199 -0
- package/package.json +1 -1
package/dist/schemas/index.js
CHANGED
|
@@ -1,617 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
offset: z.number()
|
|
15
|
-
.int()
|
|
16
|
-
.min(0)
|
|
17
|
-
.default(0)
|
|
18
|
-
.describe("Number of results to skip for pagination")
|
|
19
|
-
});
|
|
20
|
-
export const ChannelIdSchema = z.string()
|
|
21
|
-
.min(17)
|
|
22
|
-
.max(20)
|
|
23
|
-
.regex(/^\d+$/, "Channel ID must be numeric")
|
|
24
|
-
.describe("Discord channel ID (snowflake)");
|
|
25
|
-
export const GuildIdSchema = z.string()
|
|
26
|
-
.min(17)
|
|
27
|
-
.max(20)
|
|
28
|
-
.regex(/^\d+$/, "Guild ID must be numeric")
|
|
29
|
-
.describe("Discord server/guild ID (snowflake)");
|
|
30
|
-
export const UserIdSchema = z.string()
|
|
31
|
-
.min(17)
|
|
32
|
-
.max(20)
|
|
33
|
-
.regex(/^\d+$/, "User ID must be numeric")
|
|
34
|
-
.describe("Discord user ID (snowflake)");
|
|
35
|
-
export const RoleIdSchema = z.string()
|
|
36
|
-
.min(17)
|
|
37
|
-
.max(20)
|
|
38
|
-
.regex(/^\d+$/, "Role ID must be numeric")
|
|
39
|
-
.describe("Discord role ID (snowflake)");
|
|
40
|
-
export const MessageIdSchema = z.string()
|
|
41
|
-
.min(17)
|
|
42
|
-
.max(20)
|
|
43
|
-
.regex(/^\d+$/, "Message ID must be numeric")
|
|
44
|
-
.describe("Discord message ID (snowflake)");
|
|
45
|
-
// Tool-specific schemas
|
|
46
|
-
export const ListGuildsSchema = z.object({
|
|
47
|
-
response_format: ResponseFormatSchema
|
|
48
|
-
}).strict();
|
|
49
|
-
export const GetGuildSchema = z.object({
|
|
50
|
-
guild_id: GuildIdSchema,
|
|
51
|
-
response_format: ResponseFormatSchema
|
|
52
|
-
}).strict();
|
|
53
|
-
export const LeaveGuildSchema = z.object({
|
|
54
|
-
guild_id: GuildIdSchema,
|
|
55
|
-
confirm: z.boolean()
|
|
56
|
-
.describe("Must be set to true to confirm leaving the server")
|
|
57
|
-
}).strict();
|
|
58
|
-
export const ListChannelsSchema = z.object({
|
|
59
|
-
guild_id: GuildIdSchema,
|
|
60
|
-
type: z.enum(["text", "voice", "category", "all"])
|
|
61
|
-
.default("all")
|
|
62
|
-
.describe("Filter by channel type"),
|
|
63
|
-
response_format: ResponseFormatSchema
|
|
64
|
-
}).strict();
|
|
65
|
-
export const GetChannelSchema = z.object({
|
|
66
|
-
channel_id: ChannelIdSchema,
|
|
67
|
-
response_format: ResponseFormatSchema
|
|
68
|
-
}).strict();
|
|
69
|
-
export const SendMessageSchema = z.object({
|
|
70
|
-
channel_id: ChannelIdSchema,
|
|
71
|
-
content: z.string()
|
|
72
|
-
.min(1)
|
|
73
|
-
.max(2000)
|
|
74
|
-
.describe("Message content (max 2000 characters)"),
|
|
75
|
-
reply_to: MessageIdSchema.optional()
|
|
76
|
-
.describe("Optional message ID to reply to")
|
|
77
|
-
}).strict();
|
|
78
|
-
export const GetMessagesSchema = z.object({
|
|
79
|
-
channel_id: ChannelIdSchema,
|
|
80
|
-
limit: z.number()
|
|
81
|
-
.int()
|
|
82
|
-
.min(1)
|
|
83
|
-
.max(100)
|
|
84
|
-
.default(20)
|
|
85
|
-
.describe("Number of messages to retrieve (1-100)"),
|
|
86
|
-
before: MessageIdSchema.optional()
|
|
87
|
-
.describe("Get messages before this message ID"),
|
|
88
|
-
after: MessageIdSchema.optional()
|
|
89
|
-
.describe("Get messages after this message ID"),
|
|
90
|
-
response_format: ResponseFormatSchema
|
|
91
|
-
}).strict();
|
|
92
|
-
export const DeleteMessageSchema = z.object({
|
|
93
|
-
channel_id: ChannelIdSchema,
|
|
94
|
-
message_id: MessageIdSchema
|
|
95
|
-
}).strict();
|
|
96
|
-
export const EditMessageSchema = z.object({
|
|
97
|
-
channel_id: ChannelIdSchema,
|
|
98
|
-
message_id: MessageIdSchema,
|
|
99
|
-
content: z.string()
|
|
100
|
-
.min(1)
|
|
101
|
-
.max(2000)
|
|
102
|
-
.describe("New message content (max 2000 characters)")
|
|
103
|
-
}).strict();
|
|
104
|
-
export const ListMembersSchema = z.object({
|
|
105
|
-
guild_id: GuildIdSchema,
|
|
106
|
-
limit: z.number()
|
|
107
|
-
.int()
|
|
108
|
-
.min(1)
|
|
109
|
-
.max(100)
|
|
110
|
-
.default(20)
|
|
111
|
-
.describe("Maximum number of members to return"),
|
|
112
|
-
after: UserIdSchema.optional()
|
|
113
|
-
.describe("Get members after this user ID (for pagination)"),
|
|
114
|
-
response_format: ResponseFormatSchema
|
|
115
|
-
}).strict();
|
|
116
|
-
export const GetMemberSchema = z.object({
|
|
117
|
-
guild_id: GuildIdSchema,
|
|
118
|
-
user_id: UserIdSchema,
|
|
119
|
-
response_format: ResponseFormatSchema
|
|
120
|
-
}).strict();
|
|
121
|
-
export const ListRolesSchema = z.object({
|
|
122
|
-
guild_id: GuildIdSchema,
|
|
123
|
-
response_format: ResponseFormatSchema
|
|
124
|
-
}).strict();
|
|
125
|
-
export const AddRoleSchema = z.object({
|
|
126
|
-
guild_id: GuildIdSchema,
|
|
127
|
-
user_id: UserIdSchema,
|
|
128
|
-
role_id: RoleIdSchema
|
|
129
|
-
}).strict();
|
|
130
|
-
export const RemoveRoleSchema = z.object({
|
|
131
|
-
guild_id: GuildIdSchema,
|
|
132
|
-
user_id: UserIdSchema,
|
|
133
|
-
role_id: RoleIdSchema
|
|
134
|
-
}).strict();
|
|
135
|
-
export const CreateChannelSchema = z.object({
|
|
136
|
-
guild_id: GuildIdSchema,
|
|
137
|
-
name: z.string()
|
|
138
|
-
.min(1)
|
|
139
|
-
.max(100)
|
|
140
|
-
.describe("Channel name"),
|
|
141
|
-
type: z.enum(["text", "voice", "category"])
|
|
142
|
-
.default("text")
|
|
143
|
-
.describe("Channel type: 'text', 'voice', or 'category'"),
|
|
144
|
-
topic: z.string()
|
|
145
|
-
.max(1024)
|
|
146
|
-
.optional()
|
|
147
|
-
.describe("Channel topic (text channels only)"),
|
|
148
|
-
parent_id: ChannelIdSchema.optional()
|
|
149
|
-
.describe("Category ID to create channel under (not for categories)"),
|
|
150
|
-
nsfw: z.boolean()
|
|
151
|
-
.optional()
|
|
152
|
-
.describe("Whether the channel is NSFW (text channels only)"),
|
|
153
|
-
bitrate: z.number()
|
|
154
|
-
.int()
|
|
155
|
-
.min(8000)
|
|
156
|
-
.max(384000)
|
|
157
|
-
.optional()
|
|
158
|
-
.describe("Bitrate for voice channels (8000-384000)"),
|
|
159
|
-
user_limit: z.number()
|
|
160
|
-
.int()
|
|
161
|
-
.min(0)
|
|
162
|
-
.max(99)
|
|
163
|
-
.optional()
|
|
164
|
-
.describe("User limit for voice channels (0 = unlimited)")
|
|
165
|
-
}).strict();
|
|
166
|
-
export const DeleteChannelSchema = z.object({
|
|
167
|
-
channel_id: ChannelIdSchema
|
|
168
|
-
}).strict();
|
|
169
|
-
export const EditChannelSchema = z.object({
|
|
170
|
-
channel_id: ChannelIdSchema,
|
|
171
|
-
name: z.string()
|
|
172
|
-
.min(1)
|
|
173
|
-
.max(100)
|
|
174
|
-
.optional()
|
|
175
|
-
.describe("New channel name"),
|
|
176
|
-
topic: z.string()
|
|
177
|
-
.max(1024)
|
|
178
|
-
.optional()
|
|
179
|
-
.describe("New channel topic"),
|
|
180
|
-
parent_id: ChannelIdSchema.optional()
|
|
181
|
-
.describe("Move channel to a different category (use 'none' to remove from category)"),
|
|
182
|
-
position: z.number()
|
|
183
|
-
.int()
|
|
184
|
-
.min(0)
|
|
185
|
-
.optional()
|
|
186
|
-
.describe("New position of the channel"),
|
|
187
|
-
nsfw: z.boolean()
|
|
188
|
-
.optional()
|
|
189
|
-
.describe("Whether the channel is NSFW"),
|
|
190
|
-
bitrate: z.number()
|
|
191
|
-
.int()
|
|
192
|
-
.min(8000)
|
|
193
|
-
.max(384000)
|
|
194
|
-
.optional()
|
|
195
|
-
.describe("Bitrate for voice channels"),
|
|
196
|
-
user_limit: z.number()
|
|
197
|
-
.int()
|
|
198
|
-
.min(0)
|
|
199
|
-
.max(99)
|
|
200
|
-
.optional()
|
|
201
|
-
.describe("User limit for voice channels")
|
|
202
|
-
}).strict();
|
|
203
|
-
// Permission override schema
|
|
204
|
-
export const PermissionOverwriteSchema = z.object({
|
|
205
|
-
id: z.string()
|
|
206
|
-
.min(17)
|
|
207
|
-
.max(20)
|
|
208
|
-
.regex(/^\d+$/)
|
|
209
|
-
.describe("Role or User ID to set permissions for"),
|
|
210
|
-
type: z.enum(["role", "member"])
|
|
211
|
-
.describe("Whether this is a role or member permission override"),
|
|
212
|
-
allow: z.array(z.string())
|
|
213
|
-
.optional()
|
|
214
|
-
.describe("Permissions to allow (e.g., ['ViewChannel', 'SendMessages'])"),
|
|
215
|
-
deny: z.array(z.string())
|
|
216
|
-
.optional()
|
|
217
|
-
.describe("Permissions to deny (e.g., ['SendMessages', 'AddReactions'])")
|
|
218
|
-
});
|
|
219
|
-
export const SetChannelPermissionsSchema = z.object({
|
|
220
|
-
channel_id: ChannelIdSchema,
|
|
221
|
-
target_id: z.string()
|
|
222
|
-
.min(17)
|
|
223
|
-
.max(20)
|
|
224
|
-
.regex(/^\d+$/)
|
|
225
|
-
.describe("Role or User ID to set permissions for"),
|
|
226
|
-
target_type: z.enum(["role", "member"])
|
|
227
|
-
.describe("Whether target is a role or member"),
|
|
228
|
-
allow: z.array(z.string())
|
|
229
|
-
.optional()
|
|
230
|
-
.describe("Permissions to allow (e.g., ['ViewChannel', 'SendMessages', 'ReadMessageHistory'])"),
|
|
231
|
-
deny: z.array(z.string())
|
|
232
|
-
.optional()
|
|
233
|
-
.describe("Permissions to deny (e.g., ['SendMessages', 'AddReactions'])")
|
|
234
|
-
}).strict();
|
|
235
|
-
export const RemoveChannelPermissionsSchema = z.object({
|
|
236
|
-
channel_id: ChannelIdSchema,
|
|
237
|
-
target_id: z.string()
|
|
238
|
-
.min(17)
|
|
239
|
-
.max(20)
|
|
240
|
-
.regex(/^\d+$/)
|
|
241
|
-
.describe("Role or User ID to remove permission overrides for")
|
|
242
|
-
}).strict();
|
|
243
|
-
export const GetChannelPermissionsSchema = z.object({
|
|
244
|
-
channel_id: ChannelIdSchema,
|
|
245
|
-
response_format: ResponseFormatSchema
|
|
246
|
-
}).strict();
|
|
247
|
-
export const SyncChannelPermissionsSchema = z.object({
|
|
248
|
-
channel_id: ChannelIdSchema
|
|
249
|
-
}).strict();
|
|
250
|
-
export const MoveMemberSchema = z.object({
|
|
251
|
-
guild_id: GuildIdSchema,
|
|
252
|
-
user_id: UserIdSchema,
|
|
253
|
-
channel_id: ChannelIdSchema.nullable()
|
|
254
|
-
.describe("Target voice channel ID, or null to disconnect the user")
|
|
255
|
-
}).strict();
|
|
256
|
-
export const KickMemberSchema = z.object({
|
|
257
|
-
guild_id: GuildIdSchema,
|
|
258
|
-
user_id: UserIdSchema,
|
|
259
|
-
reason: z.string()
|
|
260
|
-
.max(512)
|
|
261
|
-
.optional()
|
|
262
|
-
.describe("Reason for kick (visible in audit log)")
|
|
263
|
-
}).strict();
|
|
264
|
-
export const BanMemberSchema = z.object({
|
|
265
|
-
guild_id: GuildIdSchema,
|
|
266
|
-
user_id: UserIdSchema,
|
|
267
|
-
reason: z.string()
|
|
268
|
-
.max(512)
|
|
269
|
-
.optional()
|
|
270
|
-
.describe("Reason for ban (visible in audit log)"),
|
|
271
|
-
delete_message_days: z.number()
|
|
272
|
-
.int()
|
|
273
|
-
.min(0)
|
|
274
|
-
.max(7)
|
|
275
|
-
.default(0)
|
|
276
|
-
.describe("Number of days of messages to delete (0-7)")
|
|
277
|
-
}).strict();
|
|
278
|
-
export const UnbanMemberSchema = z.object({
|
|
279
|
-
guild_id: GuildIdSchema,
|
|
280
|
-
user_id: UserIdSchema
|
|
281
|
-
}).strict();
|
|
282
|
-
export const CreateRoleSchema = z.object({
|
|
283
|
-
guild_id: GuildIdSchema,
|
|
284
|
-
name: z.string()
|
|
285
|
-
.min(1)
|
|
286
|
-
.max(100)
|
|
287
|
-
.describe("Role name"),
|
|
288
|
-
color: z.number()
|
|
289
|
-
.int()
|
|
290
|
-
.min(0)
|
|
291
|
-
.max(16777215)
|
|
292
|
-
.optional()
|
|
293
|
-
.describe("Role color as decimal integer (e.g., 16711680 for red)"),
|
|
294
|
-
mentionable: z.boolean()
|
|
295
|
-
.default(false)
|
|
296
|
-
.describe("Whether the role can be mentioned"),
|
|
297
|
-
hoist: z.boolean()
|
|
298
|
-
.default(false)
|
|
299
|
-
.describe("Whether to display role members separately")
|
|
300
|
-
}).strict();
|
|
301
|
-
export const DeleteRoleSchema = z.object({
|
|
302
|
-
guild_id: GuildIdSchema,
|
|
303
|
-
role_id: RoleIdSchema
|
|
304
|
-
}).strict();
|
|
305
|
-
export const EditRoleSchema = z.object({
|
|
306
|
-
guild_id: GuildIdSchema,
|
|
307
|
-
role_id: RoleIdSchema,
|
|
308
|
-
name: z.string()
|
|
309
|
-
.min(1)
|
|
310
|
-
.max(100)
|
|
311
|
-
.optional()
|
|
312
|
-
.describe("New role name"),
|
|
313
|
-
color: z.number()
|
|
314
|
-
.int()
|
|
315
|
-
.min(0)
|
|
316
|
-
.max(16777215)
|
|
317
|
-
.optional()
|
|
318
|
-
.describe("Role color as decimal integer (e.g., 16711680 for red)"),
|
|
319
|
-
mentionable: z.boolean()
|
|
320
|
-
.optional()
|
|
321
|
-
.describe("Whether the role can be mentioned"),
|
|
322
|
-
hoist: z.boolean()
|
|
323
|
-
.optional()
|
|
324
|
-
.describe("Whether to display role members separately"),
|
|
325
|
-
permissions: z.array(z.string())
|
|
326
|
-
.optional()
|
|
327
|
-
.describe("Permissions to grant (replaces existing permissions). Use permission names like 'Administrator', 'ManageChannels', 'SendMessages', etc.")
|
|
328
|
-
}).strict();
|
|
329
|
-
export const SetRolePositionsSchema = z.object({
|
|
330
|
-
guild_id: GuildIdSchema,
|
|
331
|
-
positions: z.array(z.object({
|
|
332
|
-
role_id: RoleIdSchema,
|
|
333
|
-
position: z.number().int().min(0).describe("New position for the role (higher = more authority)")
|
|
334
|
-
})).min(1).describe("Array of role ID and position pairs to update")
|
|
335
|
-
}).strict();
|
|
336
|
-
export const SetNicknameSchema = z.object({
|
|
337
|
-
guild_id: GuildIdSchema,
|
|
338
|
-
user_id: UserIdSchema,
|
|
339
|
-
nickname: z.string()
|
|
340
|
-
.max(32)
|
|
341
|
-
.optional()
|
|
342
|
-
.describe("New nickname (empty/null to reset)")
|
|
343
|
-
}).strict();
|
|
344
|
-
export const AddReactionSchema = z.object({
|
|
345
|
-
channel_id: ChannelIdSchema,
|
|
346
|
-
message_id: MessageIdSchema,
|
|
347
|
-
emoji: z.string()
|
|
348
|
-
.min(1)
|
|
349
|
-
.describe("Emoji to react with (e.g., '👍' or custom emoji format)")
|
|
350
|
-
}).strict();
|
|
351
|
-
export const RemoveReactionSchema = z.object({
|
|
352
|
-
channel_id: ChannelIdSchema,
|
|
353
|
-
message_id: MessageIdSchema,
|
|
354
|
-
emoji: z.string()
|
|
355
|
-
.min(1)
|
|
356
|
-
.describe("Emoji to remove (e.g., '👍' or custom emoji format)")
|
|
357
|
-
}).strict();
|
|
358
|
-
export const PinMessageSchema = z.object({
|
|
359
|
-
channel_id: ChannelIdSchema,
|
|
360
|
-
message_id: MessageIdSchema
|
|
361
|
-
}).strict();
|
|
362
|
-
export const UnpinMessageSchema = z.object({
|
|
363
|
-
channel_id: ChannelIdSchema,
|
|
364
|
-
message_id: MessageIdSchema
|
|
365
|
-
}).strict();
|
|
366
|
-
export const GetPinnedMessagesSchema = z.object({
|
|
367
|
-
channel_id: ChannelIdSchema,
|
|
368
|
-
response_format: ResponseFormatSchema
|
|
369
|
-
}).strict();
|
|
370
|
-
// Guild Management Schemas
|
|
371
|
-
export const EditGuildSchema = z.object({
|
|
372
|
-
guild_id: GuildIdSchema,
|
|
373
|
-
name: z.string()
|
|
374
|
-
.min(2)
|
|
375
|
-
.max(100)
|
|
376
|
-
.optional()
|
|
377
|
-
.describe("New server name"),
|
|
378
|
-
description: z.string()
|
|
379
|
-
.max(120)
|
|
380
|
-
.optional()
|
|
381
|
-
.describe("Server description (Community servers only)"),
|
|
382
|
-
afk_channel_id: ChannelIdSchema.optional()
|
|
383
|
-
.describe("AFK voice channel ID"),
|
|
384
|
-
afk_timeout: z.number()
|
|
385
|
-
.int()
|
|
386
|
-
.optional()
|
|
387
|
-
.describe("AFK timeout in seconds (60, 300, 900, 1800, 3600)"),
|
|
388
|
-
system_channel_id: ChannelIdSchema.optional()
|
|
389
|
-
.describe("System message channel ID"),
|
|
390
|
-
rules_channel_id: ChannelIdSchema.optional()
|
|
391
|
-
.describe("Rules channel ID (Community servers only)"),
|
|
392
|
-
public_updates_channel_id: ChannelIdSchema.optional()
|
|
393
|
-
.describe("Public updates channel ID (Community servers only)"),
|
|
394
|
-
verification_level: z.number()
|
|
395
|
-
.int()
|
|
396
|
-
.min(0)
|
|
397
|
-
.max(4)
|
|
398
|
-
.optional()
|
|
399
|
-
.describe("Verification level (0=None, 1=Low, 2=Medium, 3=High, 4=Very High)"),
|
|
400
|
-
explicit_content_filter: z.number()
|
|
401
|
-
.int()
|
|
402
|
-
.min(0)
|
|
403
|
-
.max(2)
|
|
404
|
-
.optional()
|
|
405
|
-
.describe("Explicit content filter (0=Disabled, 1=Members without roles, 2=All members)"),
|
|
406
|
-
default_message_notifications: z.number()
|
|
407
|
-
.int()
|
|
408
|
-
.min(0)
|
|
409
|
-
.max(1)
|
|
410
|
-
.optional()
|
|
411
|
-
.describe("Default notification setting (0=All messages, 1=Only mentions)")
|
|
412
|
-
}).strict();
|
|
413
|
-
// Timeout/Mute Schema
|
|
414
|
-
export const TimeoutMemberSchema = z.object({
|
|
415
|
-
guild_id: GuildIdSchema,
|
|
416
|
-
user_id: UserIdSchema,
|
|
417
|
-
duration_minutes: z.number()
|
|
418
|
-
.int()
|
|
419
|
-
.min(0)
|
|
420
|
-
.max(40320) // Max 28 days
|
|
421
|
-
.describe("Timeout duration in minutes (0 to remove timeout, max 40320 = 28 days)"),
|
|
422
|
-
reason: z.string()
|
|
423
|
-
.max(512)
|
|
424
|
-
.optional()
|
|
425
|
-
.describe("Reason for timeout (visible in audit log)")
|
|
426
|
-
}).strict();
|
|
427
|
-
// Emoji Schemas
|
|
428
|
-
export const ListEmojisSchema = z.object({
|
|
429
|
-
guild_id: GuildIdSchema,
|
|
430
|
-
response_format: ResponseFormatSchema
|
|
431
|
-
}).strict();
|
|
432
|
-
export const CreateEmojiSchema = z.object({
|
|
433
|
-
guild_id: GuildIdSchema,
|
|
434
|
-
name: z.string()
|
|
435
|
-
.min(2)
|
|
436
|
-
.max(32)
|
|
437
|
-
.regex(/^[a-zA-Z0-9_]+$/, "Emoji name must be alphanumeric with underscores only")
|
|
438
|
-
.describe("Emoji name (2-32 characters, alphanumeric and underscores)"),
|
|
439
|
-
image_url: z.string()
|
|
440
|
-
.url()
|
|
441
|
-
.describe("URL of the image to use for the emoji (PNG, JPG, GIF under 256KB)"),
|
|
442
|
-
roles: z.array(RoleIdSchema)
|
|
443
|
-
.optional()
|
|
444
|
-
.describe("Roles that can use this emoji (empty = everyone)")
|
|
445
|
-
}).strict();
|
|
446
|
-
export const DeleteEmojiSchema = z.object({
|
|
447
|
-
guild_id: GuildIdSchema,
|
|
448
|
-
emoji_id: z.string()
|
|
449
|
-
.min(17)
|
|
450
|
-
.max(20)
|
|
451
|
-
.regex(/^\d+$/, "Emoji ID must be numeric")
|
|
452
|
-
.describe("Discord emoji ID")
|
|
453
|
-
}).strict();
|
|
454
|
-
// Invite Schemas
|
|
455
|
-
export const ListInvitesSchema = z.object({
|
|
456
|
-
guild_id: GuildIdSchema,
|
|
457
|
-
response_format: ResponseFormatSchema
|
|
458
|
-
}).strict();
|
|
459
|
-
export const CreateInviteSchema = z.object({
|
|
460
|
-
channel_id: ChannelIdSchema,
|
|
461
|
-
max_age: z.number()
|
|
462
|
-
.int()
|
|
463
|
-
.min(0)
|
|
464
|
-
.max(604800)
|
|
465
|
-
.default(86400)
|
|
466
|
-
.describe("Invite duration in seconds (0 = never expires, max 604800 = 7 days)"),
|
|
467
|
-
max_uses: z.number()
|
|
468
|
-
.int()
|
|
469
|
-
.min(0)
|
|
470
|
-
.max(100)
|
|
471
|
-
.default(0)
|
|
472
|
-
.describe("Max number of uses (0 = unlimited)"),
|
|
473
|
-
temporary: z.boolean()
|
|
474
|
-
.default(false)
|
|
475
|
-
.describe("Whether members invited get kicked when they disconnect"),
|
|
476
|
-
unique: z.boolean()
|
|
477
|
-
.default(false)
|
|
478
|
-
.describe("Whether to create a new unique invite or reuse an existing one")
|
|
479
|
-
}).strict();
|
|
480
|
-
export const DeleteInviteSchema = z.object({
|
|
481
|
-
invite_code: z.string()
|
|
482
|
-
.min(1)
|
|
483
|
-
.describe("Invite code to delete")
|
|
484
|
-
}).strict();
|
|
485
|
-
// Webhook Schemas
|
|
486
|
-
export const ListWebhooksSchema = z.object({
|
|
487
|
-
guild_id: GuildIdSchema.optional()
|
|
488
|
-
.describe("Guild ID to list all webhooks in the server"),
|
|
489
|
-
channel_id: ChannelIdSchema.optional()
|
|
490
|
-
.describe("Channel ID to list webhooks for a specific channel"),
|
|
491
|
-
response_format: ResponseFormatSchema
|
|
492
|
-
}).strict();
|
|
493
|
-
export const CreateWebhookSchema = z.object({
|
|
494
|
-
channel_id: ChannelIdSchema,
|
|
495
|
-
name: z.string()
|
|
496
|
-
.min(1)
|
|
497
|
-
.max(80)
|
|
498
|
-
.describe("Webhook name"),
|
|
499
|
-
avatar_url: z.string()
|
|
500
|
-
.url()
|
|
501
|
-
.optional()
|
|
502
|
-
.describe("URL for webhook avatar image")
|
|
503
|
-
}).strict();
|
|
504
|
-
export const DeleteWebhookSchema = z.object({
|
|
505
|
-
webhook_id: z.string()
|
|
506
|
-
.min(17)
|
|
507
|
-
.max(20)
|
|
508
|
-
.regex(/^\d+$/, "Webhook ID must be numeric")
|
|
509
|
-
.describe("Discord webhook ID")
|
|
510
|
-
}).strict();
|
|
511
|
-
export const EditWebhookSchema = z.object({
|
|
512
|
-
webhook_id: z.string()
|
|
513
|
-
.min(17)
|
|
514
|
-
.max(20)
|
|
515
|
-
.regex(/^\d+$/, "Webhook ID must be numeric")
|
|
516
|
-
.describe("Discord webhook ID"),
|
|
517
|
-
name: z.string()
|
|
518
|
-
.min(1)
|
|
519
|
-
.max(80)
|
|
520
|
-
.optional()
|
|
521
|
-
.describe("New webhook name"),
|
|
522
|
-
channel_id: ChannelIdSchema.optional()
|
|
523
|
-
.describe("Move webhook to a different channel")
|
|
524
|
-
}).strict();
|
|
525
|
-
// Audit Log Schema
|
|
526
|
-
export const GetAuditLogSchema = z.object({
|
|
527
|
-
guild_id: GuildIdSchema,
|
|
528
|
-
user_id: UserIdSchema.optional()
|
|
529
|
-
.describe("Filter by user who performed the action"),
|
|
530
|
-
action_type: z.number()
|
|
531
|
-
.int()
|
|
532
|
-
.optional()
|
|
533
|
-
.describe("Filter by action type (e.g., 1=GuildUpdate, 20=MemberKick, 22=MemberBan)"),
|
|
534
|
-
limit: z.number()
|
|
535
|
-
.int()
|
|
536
|
-
.min(1)
|
|
537
|
-
.max(100)
|
|
538
|
-
.default(20)
|
|
539
|
-
.describe("Number of entries to return (1-100)"),
|
|
540
|
-
response_format: ResponseFormatSchema
|
|
541
|
-
}).strict();
|
|
542
|
-
// Prune Schema
|
|
543
|
-
export const PruneMembersSchema = z.object({
|
|
544
|
-
guild_id: GuildIdSchema,
|
|
545
|
-
days: z.number()
|
|
546
|
-
.int()
|
|
547
|
-
.min(1)
|
|
548
|
-
.max(30)
|
|
549
|
-
.describe("Number of days of inactivity (1-30)"),
|
|
550
|
-
include_roles: z.array(RoleIdSchema)
|
|
551
|
-
.optional()
|
|
552
|
-
.describe("Roles to include in prune (by default only members without roles are pruned)"),
|
|
553
|
-
dry_run: z.boolean()
|
|
554
|
-
.default(true)
|
|
555
|
-
.describe("If true, returns count without actually pruning")
|
|
556
|
-
}).strict();
|
|
557
|
-
// Sticker Schemas
|
|
558
|
-
export const ListStickersSchema = z.object({
|
|
559
|
-
guild_id: GuildIdSchema,
|
|
560
|
-
response_format: ResponseFormatSchema
|
|
561
|
-
}).strict();
|
|
562
|
-
export const DeleteStickerSchema = z.object({
|
|
563
|
-
guild_id: GuildIdSchema,
|
|
564
|
-
sticker_id: z.string()
|
|
565
|
-
.min(17)
|
|
566
|
-
.max(20)
|
|
567
|
-
.regex(/^\d+$/, "Sticker ID must be numeric")
|
|
568
|
-
.describe("Discord sticker ID")
|
|
569
|
-
}).strict();
|
|
570
|
-
// Scheduled Event Schemas
|
|
571
|
-
export const ListEventsSchema = z.object({
|
|
572
|
-
guild_id: GuildIdSchema,
|
|
573
|
-
response_format: ResponseFormatSchema
|
|
574
|
-
}).strict();
|
|
575
|
-
export const CreateEventSchema = z.object({
|
|
576
|
-
guild_id: GuildIdSchema,
|
|
577
|
-
name: z.string()
|
|
578
|
-
.min(1)
|
|
579
|
-
.max(100)
|
|
580
|
-
.describe("Event name"),
|
|
581
|
-
description: z.string()
|
|
582
|
-
.max(1000)
|
|
583
|
-
.optional()
|
|
584
|
-
.describe("Event description"),
|
|
585
|
-
scheduled_start_time: z.string()
|
|
586
|
-
.describe("ISO8601 timestamp for when the event starts"),
|
|
587
|
-
scheduled_end_time: z.string()
|
|
588
|
-
.optional()
|
|
589
|
-
.describe("ISO8601 timestamp for when the event ends"),
|
|
590
|
-
entity_type: z.enum(["stage", "voice", "external"])
|
|
591
|
-
.describe("Type of event: 'stage', 'voice', or 'external'"),
|
|
592
|
-
channel_id: ChannelIdSchema.optional()
|
|
593
|
-
.describe("Channel ID for stage/voice events"),
|
|
594
|
-
location: z.string()
|
|
595
|
-
.max(100)
|
|
596
|
-
.optional()
|
|
597
|
-
.describe("Location for external events")
|
|
598
|
-
}).strict();
|
|
599
|
-
export const DeleteEventSchema = z.object({
|
|
600
|
-
guild_id: GuildIdSchema,
|
|
601
|
-
event_id: z.string()
|
|
602
|
-
.min(17)
|
|
603
|
-
.max(20)
|
|
604
|
-
.regex(/^\d+$/, "Event ID must be numeric")
|
|
605
|
-
.describe("Discord scheduled event ID")
|
|
606
|
-
}).strict();
|
|
607
|
-
// Ban List Schema
|
|
608
|
-
export const ListBansSchema = z.object({
|
|
609
|
-
guild_id: GuildIdSchema,
|
|
610
|
-
limit: z.number()
|
|
611
|
-
.int()
|
|
612
|
-
.min(1)
|
|
613
|
-
.max(1000)
|
|
614
|
-
.default(100)
|
|
615
|
-
.describe("Number of bans to return (1-1000)"),
|
|
616
|
-
response_format: ResponseFormatSchema
|
|
617
|
-
}).strict();
|
|
1
|
+
// Re-export all schemas from domain modules
|
|
2
|
+
export * from "./common.js";
|
|
3
|
+
export * from "./guild.js";
|
|
4
|
+
export * from "./channel.js";
|
|
5
|
+
export * from "./message.js";
|
|
6
|
+
export * from "./member.js";
|
|
7
|
+
export * from "./role.js";
|
|
8
|
+
export * from "./moderation.js";
|
|
9
|
+
export * from "./emoji.js";
|
|
10
|
+
export * from "./webhook.js";
|
|
11
|
+
export * from "./invite.js";
|
|
12
|
+
export * from "./event.js";
|
|
13
|
+
export * from "./community.js";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ListInvitesSchema: z.ZodObject<{
|
|
3
|
+
guild_id: z.ZodString;
|
|
4
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
5
|
+
}, "strict", z.ZodTypeAny, {
|
|
6
|
+
response_format: import("../types.js").ResponseFormat;
|
|
7
|
+
guild_id: string;
|
|
8
|
+
}, {
|
|
9
|
+
guild_id: string;
|
|
10
|
+
response_format?: import("../types.js").ResponseFormat | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const CreateInviteSchema: z.ZodObject<{
|
|
13
|
+
channel_id: z.ZodString;
|
|
14
|
+
max_age: z.ZodDefault<z.ZodNumber>;
|
|
15
|
+
max_uses: z.ZodDefault<z.ZodNumber>;
|
|
16
|
+
temporary: z.ZodDefault<z.ZodBoolean>;
|
|
17
|
+
unique: z.ZodDefault<z.ZodBoolean>;
|
|
18
|
+
}, "strict", z.ZodTypeAny, {
|
|
19
|
+
channel_id: string;
|
|
20
|
+
max_age: number;
|
|
21
|
+
max_uses: number;
|
|
22
|
+
temporary: boolean;
|
|
23
|
+
unique: boolean;
|
|
24
|
+
}, {
|
|
25
|
+
channel_id: string;
|
|
26
|
+
max_age?: number | undefined;
|
|
27
|
+
max_uses?: number | undefined;
|
|
28
|
+
temporary?: boolean | undefined;
|
|
29
|
+
unique?: boolean | undefined;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const DeleteInviteSchema: z.ZodObject<{
|
|
32
|
+
invite_code: z.ZodString;
|
|
33
|
+
}, "strict", z.ZodTypeAny, {
|
|
34
|
+
invite_code: string;
|
|
35
|
+
}, {
|
|
36
|
+
invite_code: string;
|
|
37
|
+
}>;
|
|
38
|
+
export type ListInvitesInput = z.infer<typeof ListInvitesSchema>;
|
|
39
|
+
export type CreateInviteInput = z.infer<typeof CreateInviteSchema>;
|
|
40
|
+
export type DeleteInviteInput = z.infer<typeof DeleteInviteSchema>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { GuildIdSchema, ChannelIdSchema, ResponseFormatSchema } from "./common.js";
|
|
3
|
+
export const ListInvitesSchema = z.object({
|
|
4
|
+
guild_id: GuildIdSchema,
|
|
5
|
+
response_format: ResponseFormatSchema
|
|
6
|
+
}).strict();
|
|
7
|
+
export const CreateInviteSchema = z.object({
|
|
8
|
+
channel_id: ChannelIdSchema,
|
|
9
|
+
max_age: z.number()
|
|
10
|
+
.int()
|
|
11
|
+
.min(0)
|
|
12
|
+
.max(604800)
|
|
13
|
+
.default(86400)
|
|
14
|
+
.describe("Invite expiration in seconds (0 = never, max 604800 = 7 days)"),
|
|
15
|
+
max_uses: z.number()
|
|
16
|
+
.int()
|
|
17
|
+
.min(0)
|
|
18
|
+
.max(100)
|
|
19
|
+
.default(0)
|
|
20
|
+
.describe("Max uses (0 = unlimited)"),
|
|
21
|
+
temporary: z.boolean()
|
|
22
|
+
.default(false)
|
|
23
|
+
.describe("Whether membership is temporary"),
|
|
24
|
+
unique: z.boolean()
|
|
25
|
+
.default(false)
|
|
26
|
+
.describe("Whether to create a unique invite")
|
|
27
|
+
}).strict();
|
|
28
|
+
export const DeleteInviteSchema = z.object({
|
|
29
|
+
invite_code: z.string()
|
|
30
|
+
.min(1)
|
|
31
|
+
.describe("Invite code to delete")
|
|
32
|
+
}).strict();
|