@frogbotai/piece-discord 0.22.0 → 0.23.0
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/README.md +59 -0
- package/dist/actions.d.ts +553 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +365 -0
- package/dist/actions.js.map +1 -0
- package/dist/client.d.ts +27 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +48 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +26 -0
- package/dist/config.js.map +1 -0
- package/dist/files.d.ts +12 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +57 -0
- package/dist/files.js.map +1 -0
- package/dist/index.d.ts +833 -37
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +97 -53
- package/dist/index.js.map +1 -1
- package/dist/options.d.ts +22 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +30 -0
- package/dist/options.js.map +1 -0
- package/dist/triggers.d.ts +69 -0
- package/dist/triggers.d.ts.map +1 -0
- package/dist/triggers.js +54 -0
- package/dist/triggers.js.map +1 -0
- package/package.json +7 -6
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# `@frogbotai/piece-discord`
|
|
2
|
+
|
|
3
|
+
Send Discord messages, manage communities, and connect FrogBot agents through interactions and the Gateway.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createDiscord } from '@frogbotai/piece-discord';
|
|
9
|
+
|
|
10
|
+
export const discord = createDiscord({
|
|
11
|
+
auth: { botToken: process.env.DISCORD_BOT_TOKEN! },
|
|
12
|
+
applicationId: process.env.DISCORD_APPLICATION_ID!,
|
|
13
|
+
publicKey: process.env.DISCORD_PUBLIC_KEY!,
|
|
14
|
+
});
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Channel setup
|
|
18
|
+
|
|
19
|
+
1. Create an application and bot in the Discord Developer Portal. Copy the bot token, Application ID, and Public Key into the factory configuration above.
|
|
20
|
+
2. On the Bot page, enable the privileged **Message Content Intent**. FrogBot also uses Guilds, Guild Messages, Direct Messages, Guild Message Reactions, and Direct Message Reactions.
|
|
21
|
+
3. Set the Interactions Endpoint URL to `https://<host>/api/webhooks/<piece-instance-slug>`.
|
|
22
|
+
4. Invite the bot with the `bot` and `applications.commands` scopes. Grant View Channels, Send Messages, Send Messages in Threads, Read Message History, Add Reactions, and Attach Files as needed by the agent.
|
|
23
|
+
5. Run FrogBot's shared channel Gateway listener with `frogbot channels:run`, or keep the normal resident FrogBot process running. Discord messages, mentions, DMs, and reactions are delivered through this listener and are never polled.
|
|
24
|
+
|
|
25
|
+
Set FrogBot's `serverURL` to the absolute public URL of your deployment so the Gateway listener can forward events to the webhook endpoint.
|
|
26
|
+
|
|
27
|
+
Use `mentionRoleIds` for role mentions, `respondToChannelIds` for channels where every non-bot message should reach the agent, and `respondToGlobalMentions` for `@everyone` and `@here`. Discord accounts do not expose email addresses, so channel identity is anonymous unless agent access permits anonymous users.
|
|
28
|
+
|
|
29
|
+
## Actions
|
|
30
|
+
|
|
31
|
+
| Upstream action slug | Previous wrapper export | Native action | Notes |
|
|
32
|
+
| -------------------------- | ------------------------ | ---------------------- | ------------------------------------------------------------------------------------------- |
|
|
33
|
+
| `sendMessageWithBot` | `sendMessageWithBot` | `sendMessage` | Attachments use FrogBot file IDs. |
|
|
34
|
+
| `send_message_webhook` | `sendMessageWebhook` | `sendWebhookMessage` | The webhook URL supplies its own authentication. |
|
|
35
|
+
| `request_approval_message` | `requestApprovalMessage` | `requestApproval` | Accepts a workflow-provided `reviewUrl`; durable waiting remains a workflow concern. |
|
|
36
|
+
| `add_role_to_member` | `addRoleToMember` | `addRoleToMember` | |
|
|
37
|
+
| `remove_role_from_member` | `removeRoleFromMember` | `removeRoleFromMember` | |
|
|
38
|
+
| `remove_member_from_guild` | `removeMemberFromGuild` | `removeMember` | |
|
|
39
|
+
| `list_guild_members` | `listGuildMembers` | `listMembers` | Applies the supplied username search. |
|
|
40
|
+
| `rename_channel` | `renameChannel` | `renameChannel` | |
|
|
41
|
+
| `create_channel` | `createChannel` | `createChannel` | |
|
|
42
|
+
| `delete_channel` | `deleteChannel` | `deleteChannel` | |
|
|
43
|
+
| `find_channel` | `findChannel` | `findChannel` | Exact name match. |
|
|
44
|
+
| `remove_ban_from_user` | `removeBanFromUser` | `unbanMember` | |
|
|
45
|
+
| `createGuildRole` | `createGuildRole` | `createRole` | |
|
|
46
|
+
| `deleteGuildRole` | `deleteGuildRole` | `deleteRole` | |
|
|
47
|
+
| `ban_guild_member` | `banGuildMember` | `banMember` | |
|
|
48
|
+
| `custom_api_call` | `customApiCall` | `sendApiRequest` | Restricts requests to relative Discord API paths so the bot token cannot be sent elsewhere. |
|
|
49
|
+
|
|
50
|
+
## Triggers
|
|
51
|
+
|
|
52
|
+
| Upstream trigger slug | Native trigger | Type | Notes |
|
|
53
|
+
| --------------------- | ---------------- | ----- | -------------------------------------------------------------- |
|
|
54
|
+
| `new_message` | `messageCreated` | `app` | Replaced by real-time Gateway delivery; polling is not ported. |
|
|
55
|
+
| `new_member` | Dropped | | The official adapter's Gateway intents do not deliver members. |
|
|
56
|
+
|
|
57
|
+
Additional native events are `commandReceived`, `componentReceived`, `reactionAdded`, and `reactionRemoved`. HTTP interactions are verified by the official adapter with Discord's Ed25519 signature. Gateway deliveries are authenticated by the official adapter with the bot token and use the same instance ingress URL.
|
|
58
|
+
|
|
59
|
+
Reaction triggers suppress repeated additions or removals of the same emoji by the same user on the same message for 24 hours. If a user adds, removes, then re-adds a reaction during that window, the second addition does not run the trigger.
|
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { type DiscordClient } from './client.js';
|
|
4
|
+
import { channelOptions, guildOptions, roleOptions } from './options.js';
|
|
5
|
+
type Run<T> = PieceRunArgs<T, object, DiscordClient>;
|
|
6
|
+
declare const sendMessageInput: z.ZodObject<{
|
|
7
|
+
channelId: z.ZodString;
|
|
8
|
+
message: z.ZodOptional<z.ZodString>;
|
|
9
|
+
attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
10
|
+
fileId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
11
|
+
name: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const sendMessage: {
|
|
15
|
+
slug: string;
|
|
16
|
+
description: string;
|
|
17
|
+
input: z.ZodObject<{
|
|
18
|
+
channelId: z.ZodString;
|
|
19
|
+
message: z.ZodOptional<z.ZodString>;
|
|
20
|
+
attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
21
|
+
fileId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
22
|
+
name: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>>>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
26
|
+
idempotent: false;
|
|
27
|
+
options: {
|
|
28
|
+
channelId: typeof channelOptions;
|
|
29
|
+
};
|
|
30
|
+
run({ client, input, req }: Run<z.output<typeof sendMessageInput>>): Promise<Record<string, unknown>>;
|
|
31
|
+
};
|
|
32
|
+
declare const requestApprovalInput: z.ZodObject<{
|
|
33
|
+
channelId: z.ZodString;
|
|
34
|
+
message: z.ZodString;
|
|
35
|
+
reviewUrl: z.ZodURL;
|
|
36
|
+
buttonLabel: z.ZodDefault<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export declare const requestApproval: {
|
|
39
|
+
slug: string;
|
|
40
|
+
description: string;
|
|
41
|
+
input: z.ZodObject<{
|
|
42
|
+
channelId: z.ZodString;
|
|
43
|
+
message: z.ZodString;
|
|
44
|
+
reviewUrl: z.ZodURL;
|
|
45
|
+
buttonLabel: z.ZodDefault<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
48
|
+
idempotent: false;
|
|
49
|
+
options: {
|
|
50
|
+
channelId: typeof channelOptions;
|
|
51
|
+
};
|
|
52
|
+
run({ client, input }: Run<z.output<typeof requestApprovalInput>>): Promise<Record<string, unknown>>;
|
|
53
|
+
};
|
|
54
|
+
declare const webhookInput: z.ZodObject<{
|
|
55
|
+
webhookUrl: z.ZodURL;
|
|
56
|
+
username: z.ZodOptional<z.ZodString>;
|
|
57
|
+
content: z.ZodString;
|
|
58
|
+
avatarUrl: z.ZodOptional<z.ZodURL>;
|
|
59
|
+
embeds: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
60
|
+
tts: z.ZodDefault<z.ZodBoolean>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
export declare const sendWebhookMessage: {
|
|
63
|
+
slug: string;
|
|
64
|
+
description: string;
|
|
65
|
+
input: z.ZodObject<{
|
|
66
|
+
webhookUrl: z.ZodURL;
|
|
67
|
+
username: z.ZodOptional<z.ZodString>;
|
|
68
|
+
content: z.ZodString;
|
|
69
|
+
avatarUrl: z.ZodOptional<z.ZodURL>;
|
|
70
|
+
embeds: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
71
|
+
tts: z.ZodDefault<z.ZodBoolean>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
output: z.ZodObject<{
|
|
74
|
+
success: z.ZodBoolean;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
idempotent: false;
|
|
77
|
+
run({ client, input }: Run<z.output<typeof webhookInput>>): Promise<{
|
|
78
|
+
success: true;
|
|
79
|
+
}>;
|
|
80
|
+
};
|
|
81
|
+
export declare const addRoleToMember: {
|
|
82
|
+
slug: string;
|
|
83
|
+
description: string;
|
|
84
|
+
input: z.ZodObject<{
|
|
85
|
+
guildId: z.ZodString;
|
|
86
|
+
userId: z.ZodString;
|
|
87
|
+
roleId: z.ZodString;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
output: z.ZodObject<{
|
|
90
|
+
success: z.ZodBoolean;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
idempotent: boolean;
|
|
93
|
+
options: Partial<{
|
|
94
|
+
guildId: (args: {
|
|
95
|
+
input: Partial<{
|
|
96
|
+
guildId: string;
|
|
97
|
+
userId: string;
|
|
98
|
+
roleId: string;
|
|
99
|
+
}>;
|
|
100
|
+
client: {
|
|
101
|
+
request: ({ method, path, body, headers, authenticated, }: import("./client.js").DiscordRequest) => Promise<{
|
|
102
|
+
status: number;
|
|
103
|
+
headers: {
|
|
104
|
+
[k: string]: string;
|
|
105
|
+
};
|
|
106
|
+
body: unknown;
|
|
107
|
+
}>;
|
|
108
|
+
};
|
|
109
|
+
options: object;
|
|
110
|
+
req: import("frogbot").FrogbotRequest;
|
|
111
|
+
}) => Promise<import("frogbot").PieceOption[]>;
|
|
112
|
+
userId: (args: {
|
|
113
|
+
input: Partial<{
|
|
114
|
+
guildId: string;
|
|
115
|
+
userId: string;
|
|
116
|
+
roleId: string;
|
|
117
|
+
}>;
|
|
118
|
+
client: {
|
|
119
|
+
request: ({ method, path, body, headers, authenticated, }: import("./client.js").DiscordRequest) => Promise<{
|
|
120
|
+
status: number;
|
|
121
|
+
headers: {
|
|
122
|
+
[k: string]: string;
|
|
123
|
+
};
|
|
124
|
+
body: unknown;
|
|
125
|
+
}>;
|
|
126
|
+
};
|
|
127
|
+
options: object;
|
|
128
|
+
req: import("frogbot").FrogbotRequest;
|
|
129
|
+
}) => Promise<import("frogbot").PieceOption[]>;
|
|
130
|
+
roleId: (args: {
|
|
131
|
+
input: Partial<{
|
|
132
|
+
guildId: string;
|
|
133
|
+
userId: string;
|
|
134
|
+
roleId: string;
|
|
135
|
+
}>;
|
|
136
|
+
client: {
|
|
137
|
+
request: ({ method, path, body, headers, authenticated, }: import("./client.js").DiscordRequest) => Promise<{
|
|
138
|
+
status: number;
|
|
139
|
+
headers: {
|
|
140
|
+
[k: string]: string;
|
|
141
|
+
};
|
|
142
|
+
body: unknown;
|
|
143
|
+
}>;
|
|
144
|
+
};
|
|
145
|
+
options: object;
|
|
146
|
+
req: import("frogbot").FrogbotRequest;
|
|
147
|
+
}) => Promise<import("frogbot").PieceOption[]>;
|
|
148
|
+
}>;
|
|
149
|
+
run({ client, input: value }: Run<{
|
|
150
|
+
guildId: string;
|
|
151
|
+
userId: string;
|
|
152
|
+
roleId: string;
|
|
153
|
+
}>): Promise<{
|
|
154
|
+
success: true;
|
|
155
|
+
}>;
|
|
156
|
+
};
|
|
157
|
+
export declare const removeRoleFromMember: {
|
|
158
|
+
slug: string;
|
|
159
|
+
description: string;
|
|
160
|
+
input: z.ZodObject<{
|
|
161
|
+
guildId: z.ZodString;
|
|
162
|
+
userId: z.ZodString;
|
|
163
|
+
roleId: z.ZodString;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
output: z.ZodObject<{
|
|
166
|
+
success: z.ZodBoolean;
|
|
167
|
+
}, z.core.$strip>;
|
|
168
|
+
idempotent: boolean;
|
|
169
|
+
options: Partial<{
|
|
170
|
+
guildId: (args: {
|
|
171
|
+
input: Partial<{
|
|
172
|
+
guildId: string;
|
|
173
|
+
userId: string;
|
|
174
|
+
roleId: string;
|
|
175
|
+
}>;
|
|
176
|
+
client: {
|
|
177
|
+
request: ({ method, path, body, headers, authenticated, }: import("./client.js").DiscordRequest) => Promise<{
|
|
178
|
+
status: number;
|
|
179
|
+
headers: {
|
|
180
|
+
[k: string]: string;
|
|
181
|
+
};
|
|
182
|
+
body: unknown;
|
|
183
|
+
}>;
|
|
184
|
+
};
|
|
185
|
+
options: object;
|
|
186
|
+
req: import("frogbot").FrogbotRequest;
|
|
187
|
+
}) => Promise<import("frogbot").PieceOption[]>;
|
|
188
|
+
userId: (args: {
|
|
189
|
+
input: Partial<{
|
|
190
|
+
guildId: string;
|
|
191
|
+
userId: string;
|
|
192
|
+
roleId: string;
|
|
193
|
+
}>;
|
|
194
|
+
client: {
|
|
195
|
+
request: ({ method, path, body, headers, authenticated, }: import("./client.js").DiscordRequest) => Promise<{
|
|
196
|
+
status: number;
|
|
197
|
+
headers: {
|
|
198
|
+
[k: string]: string;
|
|
199
|
+
};
|
|
200
|
+
body: unknown;
|
|
201
|
+
}>;
|
|
202
|
+
};
|
|
203
|
+
options: object;
|
|
204
|
+
req: import("frogbot").FrogbotRequest;
|
|
205
|
+
}) => Promise<import("frogbot").PieceOption[]>;
|
|
206
|
+
roleId: (args: {
|
|
207
|
+
input: Partial<{
|
|
208
|
+
guildId: string;
|
|
209
|
+
userId: string;
|
|
210
|
+
roleId: string;
|
|
211
|
+
}>;
|
|
212
|
+
client: {
|
|
213
|
+
request: ({ method, path, body, headers, authenticated, }: import("./client.js").DiscordRequest) => Promise<{
|
|
214
|
+
status: number;
|
|
215
|
+
headers: {
|
|
216
|
+
[k: string]: string;
|
|
217
|
+
};
|
|
218
|
+
body: unknown;
|
|
219
|
+
}>;
|
|
220
|
+
};
|
|
221
|
+
options: object;
|
|
222
|
+
req: import("frogbot").FrogbotRequest;
|
|
223
|
+
}) => Promise<import("frogbot").PieceOption[]>;
|
|
224
|
+
}>;
|
|
225
|
+
run({ client, input: value }: Run<{
|
|
226
|
+
guildId: string;
|
|
227
|
+
userId: string;
|
|
228
|
+
roleId: string;
|
|
229
|
+
}>): Promise<{
|
|
230
|
+
success: true;
|
|
231
|
+
}>;
|
|
232
|
+
};
|
|
233
|
+
export declare const removeMember: {
|
|
234
|
+
slug: string;
|
|
235
|
+
description: string;
|
|
236
|
+
input: z.ZodObject<{
|
|
237
|
+
guildId: z.ZodString;
|
|
238
|
+
userId: z.ZodString;
|
|
239
|
+
}, z.core.$strip>;
|
|
240
|
+
output: z.ZodObject<{
|
|
241
|
+
success: z.ZodBoolean;
|
|
242
|
+
}, z.core.$strip>;
|
|
243
|
+
idempotent: boolean;
|
|
244
|
+
options: Partial<{
|
|
245
|
+
guildId: (args: {
|
|
246
|
+
input: Partial<{
|
|
247
|
+
guildId: string;
|
|
248
|
+
userId: string;
|
|
249
|
+
}>;
|
|
250
|
+
client: {
|
|
251
|
+
request: ({ method, path, body, headers, authenticated, }: import("./client.js").DiscordRequest) => Promise<{
|
|
252
|
+
status: number;
|
|
253
|
+
headers: {
|
|
254
|
+
[k: string]: string;
|
|
255
|
+
};
|
|
256
|
+
body: unknown;
|
|
257
|
+
}>;
|
|
258
|
+
};
|
|
259
|
+
options: object;
|
|
260
|
+
req: import("frogbot").FrogbotRequest;
|
|
261
|
+
}) => Promise<import("frogbot").PieceOption[]>;
|
|
262
|
+
userId: (args: {
|
|
263
|
+
input: Partial<{
|
|
264
|
+
guildId: string;
|
|
265
|
+
userId: string;
|
|
266
|
+
}>;
|
|
267
|
+
client: {
|
|
268
|
+
request: ({ method, path, body, headers, authenticated, }: import("./client.js").DiscordRequest) => Promise<{
|
|
269
|
+
status: number;
|
|
270
|
+
headers: {
|
|
271
|
+
[k: string]: string;
|
|
272
|
+
};
|
|
273
|
+
body: unknown;
|
|
274
|
+
}>;
|
|
275
|
+
};
|
|
276
|
+
options: object;
|
|
277
|
+
req: import("frogbot").FrogbotRequest;
|
|
278
|
+
}) => Promise<import("frogbot").PieceOption[]>;
|
|
279
|
+
}>;
|
|
280
|
+
run({ client, input: value }: Run<{
|
|
281
|
+
guildId: string;
|
|
282
|
+
userId: string;
|
|
283
|
+
}>): Promise<{
|
|
284
|
+
success: true;
|
|
285
|
+
}>;
|
|
286
|
+
};
|
|
287
|
+
declare const listMembersInput: z.ZodObject<{
|
|
288
|
+
guildId: z.ZodString;
|
|
289
|
+
search: z.ZodString;
|
|
290
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
291
|
+
}, z.core.$strip>;
|
|
292
|
+
export declare const listMembers: {
|
|
293
|
+
slug: string;
|
|
294
|
+
description: string;
|
|
295
|
+
input: z.ZodObject<{
|
|
296
|
+
guildId: z.ZodString;
|
|
297
|
+
search: z.ZodString;
|
|
298
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
299
|
+
}, z.core.$strip>;
|
|
300
|
+
output: z.ZodArray<z.ZodObject<{
|
|
301
|
+
label: z.ZodString;
|
|
302
|
+
value: z.ZodString;
|
|
303
|
+
}, z.core.$strip>>;
|
|
304
|
+
idempotent: true;
|
|
305
|
+
options: {
|
|
306
|
+
guildId: typeof guildOptions;
|
|
307
|
+
};
|
|
308
|
+
run({ client, input }: Run<z.output<typeof listMembersInput>>): Promise<{
|
|
309
|
+
label: string;
|
|
310
|
+
value: string;
|
|
311
|
+
}[]>;
|
|
312
|
+
};
|
|
313
|
+
declare const renameChannelInput: z.ZodObject<{
|
|
314
|
+
channelId: z.ZodString;
|
|
315
|
+
name: z.ZodString;
|
|
316
|
+
}, z.core.$strip>;
|
|
317
|
+
export declare const renameChannel: {
|
|
318
|
+
slug: string;
|
|
319
|
+
description: string;
|
|
320
|
+
input: z.ZodObject<{
|
|
321
|
+
channelId: z.ZodString;
|
|
322
|
+
name: z.ZodString;
|
|
323
|
+
}, z.core.$strip>;
|
|
324
|
+
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
325
|
+
idempotent: true;
|
|
326
|
+
options: {
|
|
327
|
+
channelId: typeof channelOptions;
|
|
328
|
+
};
|
|
329
|
+
run({ client, input }: Run<z.output<typeof renameChannelInput>>): Promise<Record<string, unknown>>;
|
|
330
|
+
};
|
|
331
|
+
declare const createChannelInput: z.ZodObject<{
|
|
332
|
+
guildId: z.ZodString;
|
|
333
|
+
name: z.ZodString;
|
|
334
|
+
topic: z.ZodOptional<z.ZodString>;
|
|
335
|
+
}, z.core.$strip>;
|
|
336
|
+
export declare const createChannel: {
|
|
337
|
+
slug: string;
|
|
338
|
+
description: string;
|
|
339
|
+
input: z.ZodObject<{
|
|
340
|
+
guildId: z.ZodString;
|
|
341
|
+
name: z.ZodString;
|
|
342
|
+
topic: z.ZodOptional<z.ZodString>;
|
|
343
|
+
}, z.core.$strip>;
|
|
344
|
+
output: z.ZodObject<{
|
|
345
|
+
success: z.ZodBoolean;
|
|
346
|
+
channel: z.ZodObject<{
|
|
347
|
+
id: z.ZodString;
|
|
348
|
+
name: z.ZodString;
|
|
349
|
+
}, z.core.$strip>;
|
|
350
|
+
}, z.core.$strip>;
|
|
351
|
+
idempotent: false;
|
|
352
|
+
options: {
|
|
353
|
+
guildId: typeof guildOptions;
|
|
354
|
+
};
|
|
355
|
+
run({ client, input }: Run<z.output<typeof createChannelInput>>): Promise<{
|
|
356
|
+
success: true;
|
|
357
|
+
channel: {
|
|
358
|
+
id: string;
|
|
359
|
+
name: string;
|
|
360
|
+
};
|
|
361
|
+
}>;
|
|
362
|
+
};
|
|
363
|
+
declare const deleteChannelInput: z.ZodObject<{
|
|
364
|
+
channelId: z.ZodString;
|
|
365
|
+
}, z.core.$strip>;
|
|
366
|
+
export declare const deleteChannel: {
|
|
367
|
+
slug: string;
|
|
368
|
+
description: string;
|
|
369
|
+
input: z.ZodObject<{
|
|
370
|
+
channelId: z.ZodString;
|
|
371
|
+
}, z.core.$strip>;
|
|
372
|
+
output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
373
|
+
idempotent: true;
|
|
374
|
+
options: {
|
|
375
|
+
channelId: typeof channelOptions;
|
|
376
|
+
};
|
|
377
|
+
run({ client, input }: Run<z.output<typeof deleteChannelInput>>): Promise<Record<string, unknown>>;
|
|
378
|
+
};
|
|
379
|
+
declare const findChannelInput: z.ZodObject<{
|
|
380
|
+
guildId: z.ZodString;
|
|
381
|
+
name: z.ZodString;
|
|
382
|
+
}, z.core.$strip>;
|
|
383
|
+
export declare const findChannel: {
|
|
384
|
+
slug: string;
|
|
385
|
+
description: string;
|
|
386
|
+
input: z.ZodObject<{
|
|
387
|
+
guildId: z.ZodString;
|
|
388
|
+
name: z.ZodString;
|
|
389
|
+
}, z.core.$strip>;
|
|
390
|
+
output: z.ZodObject<{
|
|
391
|
+
success: z.ZodBoolean;
|
|
392
|
+
channelId: z.ZodOptional<z.ZodString>;
|
|
393
|
+
}, z.core.$strip>;
|
|
394
|
+
idempotent: true;
|
|
395
|
+
options: {
|
|
396
|
+
guildId: typeof guildOptions;
|
|
397
|
+
};
|
|
398
|
+
run({ client, input }: Run<z.output<typeof findChannelInput>>): Promise<{
|
|
399
|
+
success: boolean;
|
|
400
|
+
channelId: any;
|
|
401
|
+
}>;
|
|
402
|
+
};
|
|
403
|
+
declare const moderationInput: z.ZodObject<{
|
|
404
|
+
guildId: z.ZodString;
|
|
405
|
+
userId: z.ZodString;
|
|
406
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
407
|
+
}, z.core.$strip>;
|
|
408
|
+
export declare const unbanMember: {
|
|
409
|
+
slug: string;
|
|
410
|
+
description: string;
|
|
411
|
+
input: z.ZodObject<{
|
|
412
|
+
guildId: z.ZodString;
|
|
413
|
+
userId: z.ZodString;
|
|
414
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
415
|
+
}, z.core.$strip>;
|
|
416
|
+
output: z.ZodObject<{
|
|
417
|
+
success: z.ZodBoolean;
|
|
418
|
+
}, z.core.$strip>;
|
|
419
|
+
idempotent: true;
|
|
420
|
+
options: {
|
|
421
|
+
guildId: typeof guildOptions;
|
|
422
|
+
};
|
|
423
|
+
run({ client, input }: Run<z.output<typeof moderationInput>>): Promise<{
|
|
424
|
+
success: true;
|
|
425
|
+
}>;
|
|
426
|
+
};
|
|
427
|
+
export declare const banMember: {
|
|
428
|
+
slug: string;
|
|
429
|
+
description: string;
|
|
430
|
+
input: z.ZodObject<{
|
|
431
|
+
guildId: z.ZodString;
|
|
432
|
+
userId: z.ZodString;
|
|
433
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
434
|
+
}, z.core.$strip>;
|
|
435
|
+
output: z.ZodObject<{
|
|
436
|
+
success: z.ZodBoolean;
|
|
437
|
+
}, z.core.$strip>;
|
|
438
|
+
idempotent: true;
|
|
439
|
+
options: {
|
|
440
|
+
guildId: typeof guildOptions;
|
|
441
|
+
};
|
|
442
|
+
run({ client, input }: Run<z.output<typeof moderationInput>>): Promise<{
|
|
443
|
+
success: true;
|
|
444
|
+
}>;
|
|
445
|
+
};
|
|
446
|
+
declare const createRoleInput: z.ZodObject<{
|
|
447
|
+
guildId: z.ZodString;
|
|
448
|
+
name: z.ZodString;
|
|
449
|
+
color: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
450
|
+
displaySeparately: z.ZodOptional<z.ZodBoolean>;
|
|
451
|
+
mentionable: z.ZodOptional<z.ZodBoolean>;
|
|
452
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
453
|
+
}, z.core.$strip>;
|
|
454
|
+
export declare const createRole: {
|
|
455
|
+
slug: string;
|
|
456
|
+
description: string;
|
|
457
|
+
input: z.ZodObject<{
|
|
458
|
+
guildId: z.ZodString;
|
|
459
|
+
name: z.ZodString;
|
|
460
|
+
color: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
461
|
+
displaySeparately: z.ZodOptional<z.ZodBoolean>;
|
|
462
|
+
mentionable: z.ZodOptional<z.ZodBoolean>;
|
|
463
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
464
|
+
}, z.core.$strip>;
|
|
465
|
+
output: z.ZodObject<{
|
|
466
|
+
success: z.ZodBoolean;
|
|
467
|
+
role: z.ZodObject<{
|
|
468
|
+
id: z.ZodString;
|
|
469
|
+
name: z.ZodString;
|
|
470
|
+
}, z.core.$strip>;
|
|
471
|
+
}, z.core.$strip>;
|
|
472
|
+
idempotent: false;
|
|
473
|
+
options: {
|
|
474
|
+
guildId: typeof guildOptions;
|
|
475
|
+
};
|
|
476
|
+
run({ client, input }: Run<z.output<typeof createRoleInput>>): Promise<{
|
|
477
|
+
success: true;
|
|
478
|
+
role: {
|
|
479
|
+
id: string;
|
|
480
|
+
name: string;
|
|
481
|
+
};
|
|
482
|
+
}>;
|
|
483
|
+
};
|
|
484
|
+
declare const deleteRoleInput: z.ZodObject<{
|
|
485
|
+
guildId: z.ZodString;
|
|
486
|
+
roleId: z.ZodString;
|
|
487
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
488
|
+
}, z.core.$strip>;
|
|
489
|
+
export declare const deleteRole: {
|
|
490
|
+
slug: string;
|
|
491
|
+
description: string;
|
|
492
|
+
input: z.ZodObject<{
|
|
493
|
+
guildId: z.ZodString;
|
|
494
|
+
roleId: z.ZodString;
|
|
495
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
496
|
+
}, z.core.$strip>;
|
|
497
|
+
output: z.ZodObject<{
|
|
498
|
+
success: z.ZodBoolean;
|
|
499
|
+
}, z.core.$strip>;
|
|
500
|
+
idempotent: true;
|
|
501
|
+
options: {
|
|
502
|
+
guildId: typeof guildOptions;
|
|
503
|
+
roleId: typeof roleOptions;
|
|
504
|
+
};
|
|
505
|
+
run({ client, input }: Run<z.output<typeof deleteRoleInput>>): Promise<{
|
|
506
|
+
success: true;
|
|
507
|
+
}>;
|
|
508
|
+
};
|
|
509
|
+
declare const customApiInput: z.ZodObject<{
|
|
510
|
+
path: z.ZodString;
|
|
511
|
+
method: z.ZodEnum<{
|
|
512
|
+
GET: "GET";
|
|
513
|
+
PUT: "PUT";
|
|
514
|
+
DELETE: "DELETE";
|
|
515
|
+
POST: "POST";
|
|
516
|
+
PATCH: "PATCH";
|
|
517
|
+
}>;
|
|
518
|
+
headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
519
|
+
queryParams: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
520
|
+
body: z.ZodOptional<z.ZodUnknown>;
|
|
521
|
+
}, z.core.$strip>;
|
|
522
|
+
export declare const sendApiRequest: {
|
|
523
|
+
slug: string;
|
|
524
|
+
description: string;
|
|
525
|
+
input: z.ZodObject<{
|
|
526
|
+
path: z.ZodString;
|
|
527
|
+
method: z.ZodEnum<{
|
|
528
|
+
GET: "GET";
|
|
529
|
+
PUT: "PUT";
|
|
530
|
+
DELETE: "DELETE";
|
|
531
|
+
POST: "POST";
|
|
532
|
+
PATCH: "PATCH";
|
|
533
|
+
}>;
|
|
534
|
+
headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
535
|
+
queryParams: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
536
|
+
body: z.ZodOptional<z.ZodUnknown>;
|
|
537
|
+
}, z.core.$strip>;
|
|
538
|
+
output: z.ZodObject<{
|
|
539
|
+
status: z.ZodNumber;
|
|
540
|
+
headers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
541
|
+
body: z.ZodUnknown;
|
|
542
|
+
}, z.core.$strip>;
|
|
543
|
+
idempotent: false;
|
|
544
|
+
run({ client, input }: Run<z.output<typeof customApiInput>>): Promise<{
|
|
545
|
+
status: number;
|
|
546
|
+
headers: {
|
|
547
|
+
[k: string]: string;
|
|
548
|
+
};
|
|
549
|
+
body: unknown;
|
|
550
|
+
}>;
|
|
551
|
+
};
|
|
552
|
+
export {};
|
|
553
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,aAAa,EAAkC,MAAM,aAAa,CAAC;AAGjF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEzE,KAAK,GAAG,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,C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