@indy-center/indy-larry-worker 1.1.0 → 1.2.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/dist/api.d.ts +43 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -8,6 +8,13 @@ export type AllowedMentions = {
|
|
|
8
8
|
/** Role IDs that may ping (not with `parse: ['roles']`). */
|
|
9
9
|
roles?: string[];
|
|
10
10
|
};
|
|
11
|
+
/** A button that opens a web address. */
|
|
12
|
+
export type LinkButton = {
|
|
13
|
+
/** Up to 80 characters. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** An http(s) address, up to 512 characters. */
|
|
16
|
+
url: string;
|
|
17
|
+
};
|
|
11
18
|
/** A message to send as Larry. At least one of `content` or `embeds` is required. */
|
|
12
19
|
export type Message = {
|
|
13
20
|
/** Up to 2000 characters. Mention a user with `<@userId>`, a role with `<@&roleId>`. */
|
|
@@ -20,6 +27,12 @@ export type Message = {
|
|
|
20
27
|
* ping more, or `{ parse: [] }` to ping nobody.
|
|
21
28
|
*/
|
|
22
29
|
allowedMentions?: AllowedMentions;
|
|
30
|
+
/**
|
|
31
|
+
* Up to 5 buttons under the message, each opening a web address. Larry offers no buttons that do
|
|
32
|
+
* something when pressed. On editMessage()/enqueueEdit(), leave it out to keep the buttons the message
|
|
33
|
+
* has, or pass `[]` to remove them.
|
|
34
|
+
*/
|
|
35
|
+
buttons?: LinkButton[];
|
|
23
36
|
};
|
|
24
37
|
/** A message to a channel. */
|
|
25
38
|
export type ChannelSend = Message & {
|
|
@@ -29,6 +42,21 @@ export type ChannelSend = Message & {
|
|
|
29
42
|
*/
|
|
30
43
|
channel: string;
|
|
31
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* A change to a message Larry posted in a channel from `SEND_CHANNELS`. What is given replaces what the
|
|
47
|
+
* message had; `content` or `embeds` left out stays as it was. An edit pings nobody.
|
|
48
|
+
*/
|
|
49
|
+
export type ChannelEdit = ChannelSend & {
|
|
50
|
+
/** The message's ID, as send() returned it. */
|
|
51
|
+
messageId: string;
|
|
52
|
+
};
|
|
53
|
+
/** A message Larry posted in a channel from `SEND_CHANNELS`, to delete. */
|
|
54
|
+
export type MessageRef = {
|
|
55
|
+
/** The channel name it was sent to, as in ChannelSend. */
|
|
56
|
+
channel: string;
|
|
57
|
+
/** The message's ID, as send() returned it. */
|
|
58
|
+
messageId: string;
|
|
59
|
+
};
|
|
32
60
|
/** A private message to a user. */
|
|
33
61
|
export type DirectSend = Message & {
|
|
34
62
|
/** The user's Discord ID. They must share a server with Larry and allow DMs from it. */
|
|
@@ -166,7 +194,7 @@ export type Sent = {
|
|
|
166
194
|
messageId: string;
|
|
167
195
|
};
|
|
168
196
|
/**
|
|
169
|
-
* Larry's RPC surface, version 1.
|
|
197
|
+
* Larry's RPC surface, version 1.2.0. Every method checks the message first and throws for an unknown
|
|
170
198
|
* channel, a bad user ID, an empty message or one over Discord's limits.
|
|
171
199
|
*/
|
|
172
200
|
export interface LarryRpc extends Rpc.WorkerEntrypointBranded {
|
|
@@ -181,6 +209,20 @@ export interface LarryRpc extends Rpc.WorkerEntrypointBranded {
|
|
|
181
209
|
enqueue(request: ChannelSend): Promise<void>;
|
|
182
210
|
/** Queue a DM, like enqueue(). */
|
|
183
211
|
enqueueDirect(request: DirectSend): Promise<void>;
|
|
212
|
+
/**
|
|
213
|
+
* Change a message Larry posted, now, and return it. Throws if Discord refuses, including when the
|
|
214
|
+
* message has been deleted or was not Larry's.
|
|
215
|
+
*/
|
|
216
|
+
editMessage(request: ChannelEdit): Promise<Sent>;
|
|
217
|
+
/** Queue the same change, like enqueue(). An edit to a message that has since been deleted is dropped. */
|
|
218
|
+
enqueueEdit(request: ChannelEdit): Promise<void>;
|
|
219
|
+
/**
|
|
220
|
+
* Delete a message Larry posted, now. **Cannot be undone.** A message that is already gone counts as
|
|
221
|
+
* deleted. Throws if Discord refuses, e.g. for someone else's message without Manage Messages.
|
|
222
|
+
*/
|
|
223
|
+
deleteMessage(request: MessageRef): Promise<void>;
|
|
224
|
+
/** Queue the same deletion and return once it's queued. Delivery retries rate limits and Discord outages. */
|
|
225
|
+
enqueueDelete(request: MessageRef): Promise<void>;
|
|
184
226
|
/**
|
|
185
227
|
* Make each role's membership match what is asked for, and report what changed. One role failing
|
|
186
228
|
* does not stop the rest. Refuses roles that carry moderation permissions. Throws if `GUILD_ID` isn't set.
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { AllowedMentions, ChannelIdSend, ChannelSend, ChannelSyncResult, ChannelsResult, ChannelsSync, DeleteRequest, DeleteResult, Deletion, DirectSend, LarryBinding, LarryRpc, ManagedChannel, MemberRole, Message, RoleSync, RoleSyncResult, RolesResult, RolesSync, Sent, } from './api';
|
|
1
|
+
export type { AllowedMentions, ChannelEdit, ChannelIdSend, ChannelSend, ChannelSyncResult, ChannelsResult, ChannelsSync, DeleteRequest, DeleteResult, Deletion, DirectSend, LarryBinding, LarryRpc, LinkButton, ManagedChannel, MemberRole, Message, MessageRef, RoleSync, RoleSyncResult, RolesResult, RolesSync, Sent, } from './api';
|