@mahesvara/discord-mcpserver 1.0.8 → 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 +4 -2833
- 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
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ListChannelsSchema: z.ZodObject<{
|
|
3
|
+
guild_id: z.ZodString;
|
|
4
|
+
type: z.ZodDefault<z.ZodEnum<["text", "voice", "category", "all"]>>;
|
|
5
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
6
|
+
}, "strict", z.ZodTypeAny, {
|
|
7
|
+
type: "text" | "voice" | "category" | "all";
|
|
8
|
+
response_format: import("../types.js").ResponseFormat;
|
|
9
|
+
guild_id: string;
|
|
10
|
+
}, {
|
|
11
|
+
guild_id: string;
|
|
12
|
+
type?: "text" | "voice" | "category" | "all" | undefined;
|
|
13
|
+
response_format?: import("../types.js").ResponseFormat | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const GetChannelSchema: z.ZodObject<{
|
|
16
|
+
channel_id: z.ZodString;
|
|
17
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
18
|
+
}, "strict", z.ZodTypeAny, {
|
|
19
|
+
response_format: import("../types.js").ResponseFormat;
|
|
20
|
+
channel_id: string;
|
|
21
|
+
}, {
|
|
22
|
+
channel_id: string;
|
|
23
|
+
response_format?: import("../types.js").ResponseFormat | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const CreateChannelSchema: z.ZodObject<{
|
|
26
|
+
guild_id: z.ZodString;
|
|
27
|
+
name: z.ZodString;
|
|
28
|
+
type: z.ZodDefault<z.ZodEnum<["text", "voice", "category"]>>;
|
|
29
|
+
topic: z.ZodOptional<z.ZodString>;
|
|
30
|
+
parent_id: z.ZodOptional<z.ZodString>;
|
|
31
|
+
nsfw: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
bitrate: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
user_limit: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
}, "strict", z.ZodTypeAny, {
|
|
35
|
+
name: string;
|
|
36
|
+
type: "text" | "voice" | "category";
|
|
37
|
+
guild_id: string;
|
|
38
|
+
topic?: string | undefined;
|
|
39
|
+
parent_id?: string | undefined;
|
|
40
|
+
nsfw?: boolean | undefined;
|
|
41
|
+
bitrate?: number | undefined;
|
|
42
|
+
user_limit?: number | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
name: string;
|
|
45
|
+
guild_id: string;
|
|
46
|
+
type?: "text" | "voice" | "category" | undefined;
|
|
47
|
+
topic?: string | undefined;
|
|
48
|
+
parent_id?: string | undefined;
|
|
49
|
+
nsfw?: boolean | undefined;
|
|
50
|
+
bitrate?: number | undefined;
|
|
51
|
+
user_limit?: number | undefined;
|
|
52
|
+
}>;
|
|
53
|
+
export declare const DeleteChannelSchema: z.ZodObject<{
|
|
54
|
+
channel_id: z.ZodString;
|
|
55
|
+
}, "strict", z.ZodTypeAny, {
|
|
56
|
+
channel_id: string;
|
|
57
|
+
}, {
|
|
58
|
+
channel_id: string;
|
|
59
|
+
}>;
|
|
60
|
+
export declare const EditChannelSchema: z.ZodObject<{
|
|
61
|
+
channel_id: z.ZodString;
|
|
62
|
+
name: z.ZodOptional<z.ZodString>;
|
|
63
|
+
topic: z.ZodOptional<z.ZodString>;
|
|
64
|
+
parent_id: z.ZodOptional<z.ZodString>;
|
|
65
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
nsfw: z.ZodOptional<z.ZodBoolean>;
|
|
67
|
+
bitrate: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
user_limit: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
}, "strict", z.ZodTypeAny, {
|
|
70
|
+
channel_id: string;
|
|
71
|
+
name?: string | undefined;
|
|
72
|
+
topic?: string | undefined;
|
|
73
|
+
parent_id?: string | undefined;
|
|
74
|
+
nsfw?: boolean | undefined;
|
|
75
|
+
bitrate?: number | undefined;
|
|
76
|
+
user_limit?: number | undefined;
|
|
77
|
+
position?: number | undefined;
|
|
78
|
+
}, {
|
|
79
|
+
channel_id: string;
|
|
80
|
+
name?: string | undefined;
|
|
81
|
+
topic?: string | undefined;
|
|
82
|
+
parent_id?: string | undefined;
|
|
83
|
+
nsfw?: boolean | undefined;
|
|
84
|
+
bitrate?: number | undefined;
|
|
85
|
+
user_limit?: number | undefined;
|
|
86
|
+
position?: number | undefined;
|
|
87
|
+
}>;
|
|
88
|
+
export declare const PermissionOverwriteSchema: z.ZodObject<{
|
|
89
|
+
id: z.ZodString;
|
|
90
|
+
type: z.ZodEnum<["role", "member"]>;
|
|
91
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
92
|
+
deny: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
type: "role" | "member";
|
|
95
|
+
id: string;
|
|
96
|
+
allow?: string[] | undefined;
|
|
97
|
+
deny?: string[] | undefined;
|
|
98
|
+
}, {
|
|
99
|
+
type: "role" | "member";
|
|
100
|
+
id: string;
|
|
101
|
+
allow?: string[] | undefined;
|
|
102
|
+
deny?: string[] | undefined;
|
|
103
|
+
}>;
|
|
104
|
+
export declare const SetChannelPermissionsSchema: z.ZodObject<{
|
|
105
|
+
channel_id: z.ZodString;
|
|
106
|
+
target_id: z.ZodString;
|
|
107
|
+
target_type: z.ZodEnum<["role", "member"]>;
|
|
108
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
109
|
+
deny: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
110
|
+
}, "strict", z.ZodTypeAny, {
|
|
111
|
+
channel_id: string;
|
|
112
|
+
target_id: string;
|
|
113
|
+
target_type: "role" | "member";
|
|
114
|
+
allow?: string[] | undefined;
|
|
115
|
+
deny?: string[] | undefined;
|
|
116
|
+
}, {
|
|
117
|
+
channel_id: string;
|
|
118
|
+
target_id: string;
|
|
119
|
+
target_type: "role" | "member";
|
|
120
|
+
allow?: string[] | undefined;
|
|
121
|
+
deny?: string[] | undefined;
|
|
122
|
+
}>;
|
|
123
|
+
export declare const RemoveChannelPermissionsSchema: z.ZodObject<{
|
|
124
|
+
channel_id: z.ZodString;
|
|
125
|
+
target_id: z.ZodString;
|
|
126
|
+
}, "strict", z.ZodTypeAny, {
|
|
127
|
+
channel_id: string;
|
|
128
|
+
target_id: string;
|
|
129
|
+
}, {
|
|
130
|
+
channel_id: string;
|
|
131
|
+
target_id: string;
|
|
132
|
+
}>;
|
|
133
|
+
export declare const GetChannelPermissionsSchema: z.ZodObject<{
|
|
134
|
+
channel_id: z.ZodString;
|
|
135
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
136
|
+
}, "strict", z.ZodTypeAny, {
|
|
137
|
+
response_format: import("../types.js").ResponseFormat;
|
|
138
|
+
channel_id: string;
|
|
139
|
+
}, {
|
|
140
|
+
channel_id: string;
|
|
141
|
+
response_format?: import("../types.js").ResponseFormat | undefined;
|
|
142
|
+
}>;
|
|
143
|
+
export declare const SyncChannelPermissionsSchema: z.ZodObject<{
|
|
144
|
+
channel_id: z.ZodString;
|
|
145
|
+
}, "strict", z.ZodTypeAny, {
|
|
146
|
+
channel_id: string;
|
|
147
|
+
}, {
|
|
148
|
+
channel_id: string;
|
|
149
|
+
}>;
|
|
150
|
+
export type ListChannelsInput = z.infer<typeof ListChannelsSchema>;
|
|
151
|
+
export type GetChannelInput = z.infer<typeof GetChannelSchema>;
|
|
152
|
+
export type CreateChannelInput = z.infer<typeof CreateChannelSchema>;
|
|
153
|
+
export type DeleteChannelInput = z.infer<typeof DeleteChannelSchema>;
|
|
154
|
+
export type EditChannelInput = z.infer<typeof EditChannelSchema>;
|
|
155
|
+
export type SetChannelPermissionsInput = z.infer<typeof SetChannelPermissionsSchema>;
|
|
156
|
+
export type RemoveChannelPermissionsInput = z.infer<typeof RemoveChannelPermissionsSchema>;
|
|
157
|
+
export type GetChannelPermissionsInput = z.infer<typeof GetChannelPermissionsSchema>;
|
|
158
|
+
export type SyncChannelPermissionsInput = z.infer<typeof SyncChannelPermissionsSchema>;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { GuildIdSchema, ChannelIdSchema, ResponseFormatSchema } from "./common.js";
|
|
3
|
+
export const ListChannelsSchema = z.object({
|
|
4
|
+
guild_id: GuildIdSchema,
|
|
5
|
+
type: z.enum(["text", "voice", "category", "all"])
|
|
6
|
+
.default("all")
|
|
7
|
+
.describe("Filter by channel type"),
|
|
8
|
+
response_format: ResponseFormatSchema
|
|
9
|
+
}).strict();
|
|
10
|
+
export const GetChannelSchema = z.object({
|
|
11
|
+
channel_id: ChannelIdSchema,
|
|
12
|
+
response_format: ResponseFormatSchema
|
|
13
|
+
}).strict();
|
|
14
|
+
export const CreateChannelSchema = z.object({
|
|
15
|
+
guild_id: GuildIdSchema,
|
|
16
|
+
name: z.string()
|
|
17
|
+
.min(1)
|
|
18
|
+
.max(100)
|
|
19
|
+
.describe("Channel name"),
|
|
20
|
+
type: z.enum(["text", "voice", "category"])
|
|
21
|
+
.default("text")
|
|
22
|
+
.describe("Channel type: 'text', 'voice', or 'category'"),
|
|
23
|
+
topic: z.string()
|
|
24
|
+
.max(1024)
|
|
25
|
+
.optional()
|
|
26
|
+
.describe("Channel topic (text channels only)"),
|
|
27
|
+
parent_id: ChannelIdSchema.optional()
|
|
28
|
+
.describe("Category ID to create channel under (not for categories)"),
|
|
29
|
+
nsfw: z.boolean()
|
|
30
|
+
.optional()
|
|
31
|
+
.describe("Whether the channel is NSFW (text channels only)"),
|
|
32
|
+
bitrate: z.number()
|
|
33
|
+
.int()
|
|
34
|
+
.min(8000)
|
|
35
|
+
.max(384000)
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("Bitrate for voice channels (8000-384000)"),
|
|
38
|
+
user_limit: z.number()
|
|
39
|
+
.int()
|
|
40
|
+
.min(0)
|
|
41
|
+
.max(99)
|
|
42
|
+
.optional()
|
|
43
|
+
.describe("User limit for voice channels (0 = unlimited)")
|
|
44
|
+
}).strict();
|
|
45
|
+
export const DeleteChannelSchema = z.object({
|
|
46
|
+
channel_id: ChannelIdSchema
|
|
47
|
+
}).strict();
|
|
48
|
+
export const EditChannelSchema = z.object({
|
|
49
|
+
channel_id: ChannelIdSchema,
|
|
50
|
+
name: z.string()
|
|
51
|
+
.min(1)
|
|
52
|
+
.max(100)
|
|
53
|
+
.optional()
|
|
54
|
+
.describe("New channel name"),
|
|
55
|
+
topic: z.string()
|
|
56
|
+
.max(1024)
|
|
57
|
+
.optional()
|
|
58
|
+
.describe("New channel topic"),
|
|
59
|
+
parent_id: ChannelIdSchema.optional()
|
|
60
|
+
.describe("Move channel to a different category (use 'none' to remove from category)"),
|
|
61
|
+
position: z.number()
|
|
62
|
+
.int()
|
|
63
|
+
.min(0)
|
|
64
|
+
.optional()
|
|
65
|
+
.describe("New position of the channel"),
|
|
66
|
+
nsfw: z.boolean()
|
|
67
|
+
.optional()
|
|
68
|
+
.describe("Whether the channel is NSFW"),
|
|
69
|
+
bitrate: z.number()
|
|
70
|
+
.int()
|
|
71
|
+
.min(8000)
|
|
72
|
+
.max(384000)
|
|
73
|
+
.optional()
|
|
74
|
+
.describe("Bitrate for voice channels"),
|
|
75
|
+
user_limit: z.number()
|
|
76
|
+
.int()
|
|
77
|
+
.min(0)
|
|
78
|
+
.max(99)
|
|
79
|
+
.optional()
|
|
80
|
+
.describe("User limit for voice channels")
|
|
81
|
+
}).strict();
|
|
82
|
+
// Permission schemas
|
|
83
|
+
export const PermissionOverwriteSchema = z.object({
|
|
84
|
+
id: z.string()
|
|
85
|
+
.min(17)
|
|
86
|
+
.max(20)
|
|
87
|
+
.regex(/^\d+$/)
|
|
88
|
+
.describe("Role or User ID to set permissions for"),
|
|
89
|
+
type: z.enum(["role", "member"])
|
|
90
|
+
.describe("Whether this is a role or member permission override"),
|
|
91
|
+
allow: z.array(z.string())
|
|
92
|
+
.optional()
|
|
93
|
+
.describe("Permissions to allow (e.g., ['ViewChannel', 'SendMessages'])"),
|
|
94
|
+
deny: z.array(z.string())
|
|
95
|
+
.optional()
|
|
96
|
+
.describe("Permissions to deny (e.g., ['SendMessages', 'AddReactions'])")
|
|
97
|
+
});
|
|
98
|
+
export const SetChannelPermissionsSchema = z.object({
|
|
99
|
+
channel_id: ChannelIdSchema,
|
|
100
|
+
target_id: z.string()
|
|
101
|
+
.min(17)
|
|
102
|
+
.max(20)
|
|
103
|
+
.regex(/^\d+$/)
|
|
104
|
+
.describe("Role or User ID to set permissions for"),
|
|
105
|
+
target_type: z.enum(["role", "member"])
|
|
106
|
+
.describe("Whether target is a role or member"),
|
|
107
|
+
allow: z.array(z.string())
|
|
108
|
+
.optional()
|
|
109
|
+
.describe("Permissions to allow (e.g., ['ViewChannel', 'SendMessages', 'ReadMessageHistory'])"),
|
|
110
|
+
deny: z.array(z.string())
|
|
111
|
+
.optional()
|
|
112
|
+
.describe("Permissions to deny (e.g., ['SendMessages', 'AddReactions'])")
|
|
113
|
+
}).strict();
|
|
114
|
+
export const RemoveChannelPermissionsSchema = z.object({
|
|
115
|
+
channel_id: ChannelIdSchema,
|
|
116
|
+
target_id: z.string()
|
|
117
|
+
.min(17)
|
|
118
|
+
.max(20)
|
|
119
|
+
.regex(/^\d+$/)
|
|
120
|
+
.describe("Role or User ID to remove permission overrides for")
|
|
121
|
+
}).strict();
|
|
122
|
+
export const GetChannelPermissionsSchema = z.object({
|
|
123
|
+
channel_id: ChannelIdSchema,
|
|
124
|
+
response_format: ResponseFormatSchema
|
|
125
|
+
}).strict();
|
|
126
|
+
export const SyncChannelPermissionsSchema = z.object({
|
|
127
|
+
channel_id: ChannelIdSchema
|
|
128
|
+
}).strict();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ResponseFormat } from "../types.js";
|
|
3
|
+
export declare const ResponseFormatSchema: z.ZodDefault<z.ZodNativeEnum<typeof ResponseFormat>>;
|
|
4
|
+
export declare const PaginationSchema: z.ZodObject<{
|
|
5
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
limit: number;
|
|
9
|
+
offset: number;
|
|
10
|
+
}, {
|
|
11
|
+
limit?: number | undefined;
|
|
12
|
+
offset?: number | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const GuildIdSchema: z.ZodString;
|
|
15
|
+
export declare const ChannelIdSchema: z.ZodString;
|
|
16
|
+
export declare const UserIdSchema: z.ZodString;
|
|
17
|
+
export declare const RoleIdSchema: z.ZodString;
|
|
18
|
+
export declare const MessageIdSchema: z.ZodString;
|
|
19
|
+
export declare const WebhookIdSchema: z.ZodString;
|
|
20
|
+
export declare const EmojiIdSchema: z.ZodString;
|
|
21
|
+
export declare const StickerIdSchema: z.ZodString;
|
|
22
|
+
export declare const EventIdSchema: z.ZodString;
|
|
23
|
+
export declare const AutoModRuleIdSchema: z.ZodString;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ResponseFormat } from "../types.js";
|
|
3
|
+
// Response format schema
|
|
4
|
+
export const ResponseFormatSchema = z.nativeEnum(ResponseFormat)
|
|
5
|
+
.default(ResponseFormat.JSON)
|
|
6
|
+
.describe("Output format: 'markdown' for human-readable or 'json' for structured data");
|
|
7
|
+
// Pagination schema
|
|
8
|
+
export const PaginationSchema = z.object({
|
|
9
|
+
limit: z.number()
|
|
10
|
+
.int()
|
|
11
|
+
.min(1)
|
|
12
|
+
.max(100)
|
|
13
|
+
.default(20)
|
|
14
|
+
.describe("Maximum number of results to return (1-100)"),
|
|
15
|
+
offset: z.number()
|
|
16
|
+
.int()
|
|
17
|
+
.min(0)
|
|
18
|
+
.default(0)
|
|
19
|
+
.describe("Number of results to skip for pagination")
|
|
20
|
+
});
|
|
21
|
+
// ID schemas (Discord snowflakes)
|
|
22
|
+
export const GuildIdSchema = z.string()
|
|
23
|
+
.min(17)
|
|
24
|
+
.max(20)
|
|
25
|
+
.regex(/^\d+$/, "Guild ID must be numeric")
|
|
26
|
+
.describe("Discord server/guild ID (snowflake)");
|
|
27
|
+
export const ChannelIdSchema = z.string()
|
|
28
|
+
.min(17)
|
|
29
|
+
.max(20)
|
|
30
|
+
.regex(/^\d+$/, "Channel ID must be numeric")
|
|
31
|
+
.describe("Discord channel ID (snowflake)");
|
|
32
|
+
export const UserIdSchema = z.string()
|
|
33
|
+
.min(17)
|
|
34
|
+
.max(20)
|
|
35
|
+
.regex(/^\d+$/, "User ID must be numeric")
|
|
36
|
+
.describe("Discord user ID (snowflake)");
|
|
37
|
+
export const RoleIdSchema = z.string()
|
|
38
|
+
.min(17)
|
|
39
|
+
.max(20)
|
|
40
|
+
.regex(/^\d+$/, "Role ID must be numeric")
|
|
41
|
+
.describe("Discord role ID (snowflake)");
|
|
42
|
+
export const MessageIdSchema = z.string()
|
|
43
|
+
.min(17)
|
|
44
|
+
.max(20)
|
|
45
|
+
.regex(/^\d+$/, "Message ID must be numeric")
|
|
46
|
+
.describe("Discord message ID (snowflake)");
|
|
47
|
+
export const WebhookIdSchema = z.string()
|
|
48
|
+
.min(17)
|
|
49
|
+
.max(20)
|
|
50
|
+
.regex(/^\d+$/, "Webhook ID must be numeric")
|
|
51
|
+
.describe("Discord webhook ID (snowflake)");
|
|
52
|
+
export const EmojiIdSchema = z.string()
|
|
53
|
+
.min(17)
|
|
54
|
+
.max(20)
|
|
55
|
+
.regex(/^\d+$/, "Emoji ID must be numeric")
|
|
56
|
+
.describe("Discord emoji ID (snowflake)");
|
|
57
|
+
export const StickerIdSchema = z.string()
|
|
58
|
+
.min(17)
|
|
59
|
+
.max(20)
|
|
60
|
+
.regex(/^\d+$/, "Sticker ID must be numeric")
|
|
61
|
+
.describe("Discord sticker ID (snowflake)");
|
|
62
|
+
export const EventIdSchema = z.string()
|
|
63
|
+
.min(17)
|
|
64
|
+
.max(20)
|
|
65
|
+
.regex(/^\d+$/, "Event ID must be numeric")
|
|
66
|
+
.describe("Discord scheduled event ID (snowflake)");
|
|
67
|
+
export const AutoModRuleIdSchema = z.string()
|
|
68
|
+
.min(17)
|
|
69
|
+
.max(20)
|
|
70
|
+
.regex(/^\d+$/, "Rule ID must be numeric")
|
|
71
|
+
.describe("Auto moderation rule ID (snowflake)");
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const GetWelcomeScreenSchema: 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 EditWelcomeScreenSchema: z.ZodObject<{
|
|
13
|
+
guild_id: z.ZodString;
|
|
14
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
description: z.ZodOptional<z.ZodString>;
|
|
16
|
+
welcome_channels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
17
|
+
channel_id: z.ZodString;
|
|
18
|
+
description: z.ZodString;
|
|
19
|
+
emoji_id: z.ZodOptional<z.ZodString>;
|
|
20
|
+
emoji_name: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
description: string;
|
|
23
|
+
channel_id: string;
|
|
24
|
+
emoji_id?: string | undefined;
|
|
25
|
+
emoji_name?: string | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
description: string;
|
|
28
|
+
channel_id: string;
|
|
29
|
+
emoji_id?: string | undefined;
|
|
30
|
+
emoji_name?: string | undefined;
|
|
31
|
+
}>, "many">>;
|
|
32
|
+
}, "strict", z.ZodTypeAny, {
|
|
33
|
+
guild_id: string;
|
|
34
|
+
description?: string | undefined;
|
|
35
|
+
enabled?: boolean | undefined;
|
|
36
|
+
welcome_channels?: {
|
|
37
|
+
description: string;
|
|
38
|
+
channel_id: string;
|
|
39
|
+
emoji_id?: string | undefined;
|
|
40
|
+
emoji_name?: string | undefined;
|
|
41
|
+
}[] | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
guild_id: string;
|
|
44
|
+
description?: string | undefined;
|
|
45
|
+
enabled?: boolean | undefined;
|
|
46
|
+
welcome_channels?: {
|
|
47
|
+
description: string;
|
|
48
|
+
channel_id: string;
|
|
49
|
+
emoji_id?: string | undefined;
|
|
50
|
+
emoji_name?: string | undefined;
|
|
51
|
+
}[] | undefined;
|
|
52
|
+
}>;
|
|
53
|
+
export declare const GetOnboardingSchema: z.ZodObject<{
|
|
54
|
+
guild_id: z.ZodString;
|
|
55
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
56
|
+
}, "strict", z.ZodTypeAny, {
|
|
57
|
+
response_format: import("../types.js").ResponseFormat;
|
|
58
|
+
guild_id: string;
|
|
59
|
+
}, {
|
|
60
|
+
guild_id: string;
|
|
61
|
+
response_format?: import("../types.js").ResponseFormat | undefined;
|
|
62
|
+
}>;
|
|
63
|
+
export declare const EditOnboardingSchema: z.ZodObject<{
|
|
64
|
+
guild_id: z.ZodString;
|
|
65
|
+
prompts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
66
|
+
id: z.ZodOptional<z.ZodString>;
|
|
67
|
+
type: z.ZodEnum<["multiple_choice", "dropdown"]>;
|
|
68
|
+
title: z.ZodString;
|
|
69
|
+
single_select: z.ZodDefault<z.ZodBoolean>;
|
|
70
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
71
|
+
in_onboarding: z.ZodDefault<z.ZodBoolean>;
|
|
72
|
+
options: z.ZodArray<z.ZodObject<{
|
|
73
|
+
id: z.ZodOptional<z.ZodString>;
|
|
74
|
+
title: z.ZodString;
|
|
75
|
+
description: z.ZodOptional<z.ZodString>;
|
|
76
|
+
emoji_id: z.ZodOptional<z.ZodString>;
|
|
77
|
+
emoji_name: z.ZodOptional<z.ZodString>;
|
|
78
|
+
role_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
79
|
+
channel_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
title: string;
|
|
82
|
+
description?: string | undefined;
|
|
83
|
+
id?: string | undefined;
|
|
84
|
+
emoji_id?: string | undefined;
|
|
85
|
+
emoji_name?: string | undefined;
|
|
86
|
+
role_ids?: string[] | undefined;
|
|
87
|
+
channel_ids?: string[] | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
title: string;
|
|
90
|
+
description?: string | undefined;
|
|
91
|
+
id?: string | undefined;
|
|
92
|
+
emoji_id?: string | undefined;
|
|
93
|
+
emoji_name?: string | undefined;
|
|
94
|
+
role_ids?: string[] | undefined;
|
|
95
|
+
channel_ids?: string[] | undefined;
|
|
96
|
+
}>, "many">;
|
|
97
|
+
}, "strip", z.ZodTypeAny, {
|
|
98
|
+
title: string;
|
|
99
|
+
options: {
|
|
100
|
+
title: string;
|
|
101
|
+
description?: string | undefined;
|
|
102
|
+
id?: string | undefined;
|
|
103
|
+
emoji_id?: string | undefined;
|
|
104
|
+
emoji_name?: string | undefined;
|
|
105
|
+
role_ids?: string[] | undefined;
|
|
106
|
+
channel_ids?: string[] | undefined;
|
|
107
|
+
}[];
|
|
108
|
+
type: "multiple_choice" | "dropdown";
|
|
109
|
+
single_select: boolean;
|
|
110
|
+
required: boolean;
|
|
111
|
+
in_onboarding: boolean;
|
|
112
|
+
id?: string | undefined;
|
|
113
|
+
}, {
|
|
114
|
+
title: string;
|
|
115
|
+
options: {
|
|
116
|
+
title: string;
|
|
117
|
+
description?: string | undefined;
|
|
118
|
+
id?: string | undefined;
|
|
119
|
+
emoji_id?: string | undefined;
|
|
120
|
+
emoji_name?: string | undefined;
|
|
121
|
+
role_ids?: string[] | undefined;
|
|
122
|
+
channel_ids?: string[] | undefined;
|
|
123
|
+
}[];
|
|
124
|
+
type: "multiple_choice" | "dropdown";
|
|
125
|
+
id?: string | undefined;
|
|
126
|
+
single_select?: boolean | undefined;
|
|
127
|
+
required?: boolean | undefined;
|
|
128
|
+
in_onboarding?: boolean | undefined;
|
|
129
|
+
}>, "many">>;
|
|
130
|
+
default_channel_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
131
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
132
|
+
mode: z.ZodOptional<z.ZodEnum<["onboarding_default", "onboarding_advanced"]>>;
|
|
133
|
+
}, "strict", z.ZodTypeAny, {
|
|
134
|
+
guild_id: string;
|
|
135
|
+
enabled?: boolean | undefined;
|
|
136
|
+
prompts?: {
|
|
137
|
+
title: string;
|
|
138
|
+
options: {
|
|
139
|
+
title: string;
|
|
140
|
+
description?: string | undefined;
|
|
141
|
+
id?: string | undefined;
|
|
142
|
+
emoji_id?: string | undefined;
|
|
143
|
+
emoji_name?: string | undefined;
|
|
144
|
+
role_ids?: string[] | undefined;
|
|
145
|
+
channel_ids?: string[] | undefined;
|
|
146
|
+
}[];
|
|
147
|
+
type: "multiple_choice" | "dropdown";
|
|
148
|
+
single_select: boolean;
|
|
149
|
+
required: boolean;
|
|
150
|
+
in_onboarding: boolean;
|
|
151
|
+
id?: string | undefined;
|
|
152
|
+
}[] | undefined;
|
|
153
|
+
default_channel_ids?: string[] | undefined;
|
|
154
|
+
mode?: "onboarding_default" | "onboarding_advanced" | undefined;
|
|
155
|
+
}, {
|
|
156
|
+
guild_id: string;
|
|
157
|
+
enabled?: boolean | undefined;
|
|
158
|
+
prompts?: {
|
|
159
|
+
title: string;
|
|
160
|
+
options: {
|
|
161
|
+
title: string;
|
|
162
|
+
description?: string | undefined;
|
|
163
|
+
id?: string | undefined;
|
|
164
|
+
emoji_id?: string | undefined;
|
|
165
|
+
emoji_name?: string | undefined;
|
|
166
|
+
role_ids?: string[] | undefined;
|
|
167
|
+
channel_ids?: string[] | undefined;
|
|
168
|
+
}[];
|
|
169
|
+
type: "multiple_choice" | "dropdown";
|
|
170
|
+
id?: string | undefined;
|
|
171
|
+
single_select?: boolean | undefined;
|
|
172
|
+
required?: boolean | undefined;
|
|
173
|
+
in_onboarding?: boolean | undefined;
|
|
174
|
+
}[] | undefined;
|
|
175
|
+
default_channel_ids?: string[] | undefined;
|
|
176
|
+
mode?: "onboarding_default" | "onboarding_advanced" | undefined;
|
|
177
|
+
}>;
|
|
178
|
+
export type GetWelcomeScreenInput = z.infer<typeof GetWelcomeScreenSchema>;
|
|
179
|
+
export type EditWelcomeScreenInput = z.infer<typeof EditWelcomeScreenSchema>;
|
|
180
|
+
export type GetOnboardingInput = z.infer<typeof GetOnboardingSchema>;
|
|
181
|
+
export type EditOnboardingInput = z.infer<typeof EditOnboardingSchema>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { GuildIdSchema, ChannelIdSchema, RoleIdSchema, ResponseFormatSchema } from "./common.js";
|
|
3
|
+
// Welcome Screen schemas
|
|
4
|
+
export const GetWelcomeScreenSchema = z.object({
|
|
5
|
+
guild_id: GuildIdSchema,
|
|
6
|
+
response_format: ResponseFormatSchema
|
|
7
|
+
}).strict();
|
|
8
|
+
export const EditWelcomeScreenSchema = z.object({
|
|
9
|
+
guild_id: GuildIdSchema,
|
|
10
|
+
enabled: z.boolean()
|
|
11
|
+
.optional()
|
|
12
|
+
.describe("Whether the welcome screen is enabled"),
|
|
13
|
+
description: z.string()
|
|
14
|
+
.max(140)
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("The server description shown in the welcome screen (max 140 chars)"),
|
|
17
|
+
welcome_channels: z.array(z.object({
|
|
18
|
+
channel_id: ChannelIdSchema,
|
|
19
|
+
description: z.string().max(50).describe("Channel description (max 50 chars)"),
|
|
20
|
+
emoji_id: z.string().optional().describe("Custom emoji ID (for custom server emojis)"),
|
|
21
|
+
emoji_name: z.string().optional().describe("Emoji name (unicode emoji or custom emoji name)")
|
|
22
|
+
}))
|
|
23
|
+
.max(5)
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("Welcome screen channels (max 5)")
|
|
26
|
+
}).strict();
|
|
27
|
+
// Onboarding schemas
|
|
28
|
+
export const GetOnboardingSchema = z.object({
|
|
29
|
+
guild_id: GuildIdSchema,
|
|
30
|
+
response_format: ResponseFormatSchema
|
|
31
|
+
}).strict();
|
|
32
|
+
export const EditOnboardingSchema = z.object({
|
|
33
|
+
guild_id: GuildIdSchema,
|
|
34
|
+
prompts: z.array(z.object({
|
|
35
|
+
id: z.string().optional().describe("Prompt ID (required for editing existing prompts)"),
|
|
36
|
+
type: z.enum(["multiple_choice", "dropdown"]).describe("Prompt type"),
|
|
37
|
+
title: z.string().max(100).describe("Prompt title"),
|
|
38
|
+
single_select: z.boolean().default(true).describe("Whether only one option can be selected"),
|
|
39
|
+
required: z.boolean().default(false).describe("Whether this prompt is required"),
|
|
40
|
+
in_onboarding: z.boolean().default(true).describe("Whether shown during onboarding"),
|
|
41
|
+
options: z.array(z.object({
|
|
42
|
+
id: z.string().optional().describe("Option ID (required for editing existing options)"),
|
|
43
|
+
title: z.string().max(50).describe("Option title"),
|
|
44
|
+
description: z.string().max(100).optional().describe("Option description"),
|
|
45
|
+
emoji_id: z.string().optional().describe("Custom emoji ID"),
|
|
46
|
+
emoji_name: z.string().optional().describe("Emoji name"),
|
|
47
|
+
role_ids: z.array(RoleIdSchema).optional().describe("Roles to assign when selected"),
|
|
48
|
+
channel_ids: z.array(ChannelIdSchema).optional().describe("Channels to show when selected")
|
|
49
|
+
})).min(1).describe("Available options for this prompt")
|
|
50
|
+
})).optional().describe("Onboarding prompts/questions"),
|
|
51
|
+
default_channel_ids: z.array(ChannelIdSchema)
|
|
52
|
+
.optional()
|
|
53
|
+
.describe("Channels shown to new members by default"),
|
|
54
|
+
enabled: z.boolean()
|
|
55
|
+
.optional()
|
|
56
|
+
.describe("Whether onboarding is enabled"),
|
|
57
|
+
mode: z.enum(["onboarding_default", "onboarding_advanced"])
|
|
58
|
+
.optional()
|
|
59
|
+
.describe("Onboarding mode")
|
|
60
|
+
}).strict();
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ListEmojisSchema: 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 CreateEmojiSchema: z.ZodObject<{
|
|
13
|
+
guild_id: z.ZodString;
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
image_url: z.ZodString;
|
|
16
|
+
}, "strict", z.ZodTypeAny, {
|
|
17
|
+
name: string;
|
|
18
|
+
guild_id: string;
|
|
19
|
+
image_url: string;
|
|
20
|
+
}, {
|
|
21
|
+
name: string;
|
|
22
|
+
guild_id: string;
|
|
23
|
+
image_url: string;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const DeleteEmojiSchema: z.ZodObject<{
|
|
26
|
+
guild_id: z.ZodString;
|
|
27
|
+
emoji_id: z.ZodString;
|
|
28
|
+
}, "strict", z.ZodTypeAny, {
|
|
29
|
+
guild_id: string;
|
|
30
|
+
emoji_id: string;
|
|
31
|
+
}, {
|
|
32
|
+
guild_id: string;
|
|
33
|
+
emoji_id: string;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const ListStickersSchema: z.ZodObject<{
|
|
36
|
+
guild_id: z.ZodString;
|
|
37
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
38
|
+
}, "strict", z.ZodTypeAny, {
|
|
39
|
+
response_format: import("../types.js").ResponseFormat;
|
|
40
|
+
guild_id: string;
|
|
41
|
+
}, {
|
|
42
|
+
guild_id: string;
|
|
43
|
+
response_format?: import("../types.js").ResponseFormat | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
export declare const DeleteStickerSchema: z.ZodObject<{
|
|
46
|
+
guild_id: z.ZodString;
|
|
47
|
+
sticker_id: z.ZodString;
|
|
48
|
+
}, "strict", z.ZodTypeAny, {
|
|
49
|
+
guild_id: string;
|
|
50
|
+
sticker_id: string;
|
|
51
|
+
}, {
|
|
52
|
+
guild_id: string;
|
|
53
|
+
sticker_id: string;
|
|
54
|
+
}>;
|
|
55
|
+
export type ListEmojisInput = z.infer<typeof ListEmojisSchema>;
|
|
56
|
+
export type CreateEmojiInput = z.infer<typeof CreateEmojiSchema>;
|
|
57
|
+
export type DeleteEmojiInput = z.infer<typeof DeleteEmojiSchema>;
|
|
58
|
+
export type ListStickersInput = z.infer<typeof ListStickersSchema>;
|
|
59
|
+
export type DeleteStickerInput = z.infer<typeof DeleteStickerSchema>;
|