aurival 0.2.1 → 0.4.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 CHANGED
@@ -74,14 +74,22 @@ machine you revoke; a leaked token would be the bot.
74
74
  bot.command('say', async (ctx) => {
75
75
  ctx.command; // "say"
76
76
  ctx.arguments; // the raw rest of the line, unparsed, possibly ""
77
- ctx.chat; // { id, type, name }
78
- ctx.sender; // { id, handle, name }
77
+ ctx.chat; // { id, type, name, member_count }
78
+ ctx.sender; // { id, handle, name } — always set
79
79
  ctx.message.text; // "/say hi" — the invoking message, verbatim
80
80
  await ctx.reply('…');
81
81
  });
82
82
  ```
83
83
 
84
- `ctx.message` is now the invoking message itself: `ctx.message.id`, `.text`, `.sent_at`, `.sender`, and `.reply_to` (the id of the message it quoted, or `null`) — or, for an event that carries none, `ctx.message` itself is `null` and none of those fields are reachable. `ctx.reply()` still quotes it by id, so an answer never floats free in a busy chat. There is no flag: on the rare event that carries no message id it sends a plain message instead.
84
+ `ctx.message` is the invoking message itself: `ctx.message.id`, `.text`, `.sent_at`, `.sender`,
85
+ and `.reply_to` (the id of the message it quoted, or `null`). `ctx.reply()` quotes it by id, so
86
+ an answer never floats free in a busy chat. On an event that is about no message — someone
87
+ joining, someone adding the bot — there is nothing to quote and the reply is sent plain. There
88
+ is no flag for it: the context knows which message its event is about, or knows there is none.
89
+
90
+ `ctx.chat.member_count` is the chat's live participant count, bots included. It is a number on
91
+ every event the server sends today, and `null` only on a frame that omitted it — never
92
+ defaulted to 0, because a genuinely empty chat is still a number.
85
93
 
86
94
  Handlers run concurrently, and an event is acked only after its handler settles — so a
87
95
  crash mid-handler redelivers rather than loses. **Do not block inside a handler.** A
@@ -110,76 +118,88 @@ goes through `bot.on(type, fn)`:
110
118
 
111
119
  ```ts
112
120
  bot.on('member.joined', async (ctx) => {
113
- await ctx.send(ctx.chat.id, `welcome, ${ctx.user?.handle}`);
121
+ await ctx.send(ctx.chat, `welcome, ${ctx.user.handle}`);
114
122
  });
115
123
 
116
124
  bot.on('member.left', async (ctx) => {
117
- console.log(ctx.user?.handle, 'left', ctx.chat.id);
125
+ console.log(ctx.user.handle, 'left', ctx.chat.id);
118
126
  });
119
127
 
120
128
  bot.on('bot.added', async (ctx) => {
121
- await ctx.send(ctx.chat.id, `thanks for adding me, ${ctx.actor?.handle}`);
129
+ await ctx.send(ctx.chat, `thanks for adding me, ${ctx.actor.handle}`);
122
130
  });
123
131
 
124
132
  bot.on('bot.removed', async (ctx) => {
125
- console.log(ctx.actor?.handle, 'removed me from', ctx.chat.id);
133
+ console.log(ctx.actor.handle, 'removed me from', ctx.chat.id);
126
134
  });
127
135
 
128
136
  bot.on('reaction.added', async (ctx) => {
129
- console.log(ctx.sender?.handle, 'reacted', ctx.emoji, 'on', ctx.message?.id);
137
+ console.log(ctx.sender.handle, 'reacted', ctx.emoji, 'on', ctx.message.id);
130
138
  });
131
139
  ```
132
140
 
133
- One `Context` for every event type. Only the fields that event actually carries are
134
- populated — everything else is `null`:
141
+ None of those handlers annotates `ctx`. The event name is what picks the class, so the editor
142
+ offers the five names as you type `bot.on('`, and then knows what `ctx` holds. A handler
143
+ defined somewhere else names its class itself:
135
144
 
136
- | event | `ctx.chat` | `ctx.sender` | `ctx.user` | `ctx.actor` | `ctx.message` | `ctx.emoji` |
137
- | ----------------- | ---------- | ------------ | ---------- | ----------- | ------------- | ----------- |
138
- | `command.invoked` | ✓ | ✓ | | | ✓ | |
139
- | `member.joined` | ✓ | | ✓ | | | |
140
- | `member.left` | ✓ | | ✓ | | | |
141
- | `bot.added` | ✓ | | | ✓ | | |
142
- | `bot.removed` | ✓ | | | ✓ | | |
143
- | `reaction.added` | ✓ | ✓ | | | ✓ | ✓ |
145
+ ```ts
146
+ import type { MemberContext } from 'aurival';
144
147
 
145
- An event type this SDK does not know about yet is never fatal — `bot.on()` a type the
146
- server hasn't invented yet and, if it starts sending it, the handler runs with whatever
147
- fields it happens to carry. There is no `reaction.removed` event: un-reacting is silent.
148
+ async function onLeft(ctx: MemberContext): Promise<void> {
149
+ console.log(ctx.user.handle, 'left', ctx.chat.id);
150
+ }
148
151
 
149
- ## Actions
152
+ bot.on('member.left', onLeft);
153
+ ```
150
154
 
151
- Every action is available on a handler's `ctx`. `ctx.chat.member_count` carries the chat's
152
- live participant count, so you don't need a separate call to know how many people are in it:
155
+ | event | `ctx` | beside `ctx.chat` and `ctx.event` |
156
+ | ------------------------------- | ----------------- | ----------------------------------------------------------------- |
157
+ | `command.invoked` | `Context` | `command`, `arguments`, `sender`, `message` |
158
+ | `member.joined` / `member.left` | `MemberContext` | `user` |
159
+ | `bot.added` / `bot.removed` | `BotContext` | `actor` |
160
+ | `reaction.added` | `ReactionContext` | `sender`, `message` (id only, the text is not re-sent), `emoji` |
161
+ | anything else | `EventContext` | `sender`, `user`, `actor`, `message`, `emoji` — each one nullable |
162
+
163
+ Each class carries only its own family's fields, and every one of them is set. That is the
164
+ whole point: your editor tells you what `ctx` has, so you never read a doc to find out, and
165
+ you never guard a field that is always there. `ctx.emoji` in a member handler is a compile
166
+ error rather than a runtime `undefined`, and so is a `bot.added` handler registered for
167
+ `member.joined`.
168
+
169
+ An event type this SDK does not know about yet is never fatal — `bot.on()` a type the server
170
+ hasn't invented yet and, if it starts sending it, the handler runs with an `EventContext`
171
+ holding whatever fields the frame happened to carry. Nothing is pinned there, so everything is
172
+ nullable and you narrow before you read. There is no `reaction.removed` event: un-reacting is
173
+ silent.
153
174
 
154
- The typing indicator is also automatic (0.2.1): a command handler still running 300 ms after
155
- it started shows the chat "is thinking", and the indicator clears when the handler returns,
156
- including on a throw. A handler that replies inside those 300 ms sends nothing, so a fast bot
157
- never flickers. `new Bot({ autoTyping: false })` turns it off if you would rather drive
158
- `ctx.withTyping()` yourself.
175
+ ## Actions
159
176
 
160
- ```ts
161
- bot.command('busy', async (ctx) => {
162
- await ctx.withTyping(async () => {
163
- // ... slow work, e.g. calling out to another service ...
164
- await ctx.reply(`done, and there are ${ctx.chat.member_count} of us in here`);
165
- });
166
- });
177
+ Every action is available on a handler's `ctx`, whichever class it is — they live on the shared
178
+ base, so `ctx.reply()` reads the same in a command as in a `member.joined`.
167
179
 
180
+ ```ts
168
181
  bot.command('fix', async (ctx) => {
169
- const sent = await ctx.reply('working on it...');
170
- await ctx.edit(String(sent['id']), 'done!');
182
+ const sent = await ctx.reply('working on it…');
183
+ await ctx.edit(sent, 'done!');
171
184
  });
172
185
 
173
186
  bot.command('oops', async (ctx) => {
174
- if (ctx.message) await ctx.delete(ctx.message);
187
+ await ctx.delete(ctx.message);
175
188
  });
176
189
 
177
190
  bot.command('upvote', async (ctx) => {
178
- if (ctx.message) await ctx.react(ctx.message, '\u{1F44D}');
191
+ await ctx.react(ctx.message, '\u{1F44D}');
179
192
  });
180
193
 
181
194
  bot.command('downvote', async (ctx) => {
182
- if (ctx.message) await ctx.unreact(ctx.message, '\u{1F44D}');
195
+ await ctx.unreact(ctx.message, '\u{1F44D}');
196
+ });
197
+
198
+ bot.command('busy', async (ctx) => {
199
+ await ctx.withTyping(async () => {
200
+ // ... slow work, e.g. calling out to another service ...
201
+ await ctx.reply(`done, and there are ${ctx.chat.member_count} of us in here`);
202
+ });
183
203
  });
184
204
 
185
205
  bot.command('roster', async (ctx) => {
@@ -188,18 +208,29 @@ bot.command('roster', async (ctx) => {
188
208
  // (CONTRACT-V1 §4), and inferring "more pages" from the cursor is exactly
189
209
  // the off-by-one every other SDK ships.
190
210
  const handles: string[] = [];
191
- let cursor: string | undefined;
211
+ let cursor: string | null = null;
192
212
  for (;;) {
193
- const page = await ctx.members(undefined, { cursor });
213
+ const page = await ctx.members(undefined, cursor === null ? {} : { cursor });
194
214
  handles.push(...page.users.map((u) => u.handle));
195
215
  if (!page.hasMore) break;
196
- cursor = page.nextCursor ?? undefined;
216
+ cursor = page.nextCursor;
197
217
  }
198
218
  await ctx.reply(handles.join(', '));
199
219
  });
200
220
  ```
201
221
 
202
- `ctx.typing(true | false)` and `ctx.withTyping(fn)` toggle the typing indicator — `withTyping`
222
+ `reply()`, `send()` and `edit()` return the message they stored, so `sent` is what you hand
223
+ straight back to `edit()`, `delete()` and `react()` — no id juggling. The `sender` on one of
224
+ those, when it is set at all, is known by id alone — `handle` and `name` are empty strings,
225
+ because the REST entity names the sender with a bare `usr_…`.
226
+
227
+ The typing indicator is automatic: a command handler still running 300 ms after it started
228
+ shows the chat "is thinking", and the indicator clears when the handler returns, including on a
229
+ throw. A handler that replies inside those 300 ms sends nothing, so a fast bot never flickers.
230
+ `new Bot({ autoTyping: false })` turns it off if you would rather drive `ctx.withTyping()`
231
+ yourself.
232
+
233
+ `ctx.typing(true | false)` and `ctx.withTyping(fn)` toggle the indicator by hand — `withTyping`
203
234
  sends `true` on entry and `false` on exit, always, even if `fn` throws.
204
235
 
205
236
  `@`-mention someone with `mention(user)` — it template-literals straight into `text` as
@@ -208,28 +239,110 @@ sends `true` on entry and `false` on exit, always, even if `fn` throws.
208
239
  ```ts
209
240
  import { mention } from 'aurival';
210
241
 
242
+ bot.on('member.joined', async (ctx) => {
243
+ const who = mention(ctx.user);
244
+ await ctx.send(ctx.chat, `welcome, ${who}!`, { mentions: [who] });
245
+ });
246
+ ```
247
+
248
+ ## Embeds and buttons
249
+
250
+ `Embed` is a builder — every `setAuthor`/`setThumbnail`/`addField`/`setFooter` call returns the
251
+ same instance, so you chain them off the constructor. `Button` is a separate, flat object:
252
+ `new Button({ label, id, style })`, where `style` is one of `'primary' | 'secondary' | 'danger'`
253
+ — `'link'` isn't supported yet, and passing it throws a plain error naming the bad style. Pass
254
+ arrays of both into the existing options-object shape `ctx.reply(text, { embeds, buttons })`,
255
+ the same convention `ctx.send(chat, text, { mentions })` already uses:
256
+
257
+ ```ts
258
+ import { Embed, Button } from 'aurival';
259
+
260
+ const embed = new Embed({ title: 'Trivia round 4', description: 'Which ocean is the deepest?', color: '#3E6E8E' })
261
+ .setAuthor('Quizbot', 'https://cdn.aurival.com/q.png')
262
+ .setThumbnail('https://cdn.aurival.com/t.png')
263
+ .addField('Players', '6', true)
264
+ .addField('Round', '4 of 10', true)
265
+ .setFooter('Answer within 30s');
266
+
267
+ const buttons = [
268
+ new Button({ label: 'Pacific', id: 'pacific', style: 'primary' }),
269
+ new Button({ label: 'Atlantic', id: 'atlantic', style: 'secondary' }),
270
+ new Button({ label: 'Indian', id: 'indian', style: 'secondary' }),
271
+ ];
272
+
273
+ await ctx.reply('Ready when you are.', { embeds: [embed], buttons });
274
+ ```
275
+
276
+ There are caps, and the SDK checks them locally before the frame ever goes out, so a bad bot
277
+ fails fast with a plain error naming which cap it hit: a message carries at most 3 embeds, an
278
+ embed at most 6 fields, a message at most 5 buttons, and a button label is at most 24
279
+ characters.
280
+
281
+ A press comes back as a `button.pressed` event, handled the same way any other event is:
282
+
283
+ ```ts
284
+ bot.on('button.pressed', async (ctx) => {
285
+ await ctx.ack();
286
+ if (ctx.button === 'pacific') {
287
+ await ctx.reply('Correct! The Pacific is deepest.');
288
+ }
289
+ });
290
+ ```
291
+
292
+ The `ctx` there is a `ButtonContext`: `.chat`, `.user`, `.message`, `.button` (the id you set
293
+ when building it) and `.interaction`. Call `await ctx.ack()` exactly once per press — a button
294
+ is single-use, and acking one a second time doesn't throw locally, the server 409s the request.
295
+
296
+ The full set of showcase examples (trivia, giveaways, DJ bots, moderation reports…) is in the
297
+ [cookbook](https://bots.aurival.com/docs/cookbook).
298
+
299
+ ## Upgrading from 0.2.x
300
+
301
+ There is one `Context` per event family now, instead of one class for every event with most of
302
+ its fields `null`. Three things change in code you already wrote.
303
+
304
+ `ctx.sender` in a command handler is a `User` again, not `User | null`. The narrowing 0.2.0
305
+ asked for was an artefact of the shared class — the server never sends a command without a
306
+ sender, and now the type says so. Drop the guard:
307
+
308
+ ```ts
211
309
  bot.command('thanks', async (ctx) => {
212
- if (!ctx.sender) return; // no sender on this event type — nothing to thank
213
- await ctx.send(ctx.chat, `thanks, ${mention(ctx.sender)}!`, {
214
- mentions: [mention(ctx.sender)],
215
- });
310
+ // 0.2.x — if (!ctx.sender) return;
311
+ await ctx.reply(`thanks, ${ctx.sender.handle}!`);
312
+ });
313
+ ```
314
+
315
+ `ctx.user`, `ctx.actor` and `ctx.emoji` no longer exist on `Context`. They live on the class for
316
+ the family that actually delivers them, where they are never `null`, so an optional read becomes
317
+ a plain one:
318
+
319
+ ```ts
320
+ bot.on('member.joined', async (ctx) => {
321
+ // 0.2.x — ctx.user?.handle
322
+ console.log(ctx.user.handle, 'joined');
216
323
  });
217
324
  ```
218
325
 
219
- > **0.2.0 breaking change:** `ctx.sender` is now `User | null` (was `User`). The single
220
- > `Context` class is shared across every event type, and `sender` is genuinely absent on
221
- > `member.joined`/`member.left`/`bot.added`/`bot.removed` (see the table above) — so it can
222
- > no longer be typed as always-present. Narrow it before use:
223
- >
224
- > ```ts
225
- > // 0.1.x — ctx.sender.handle compiled unconditionally.
226
- > console.log(ctx.sender.handle);
227
- >
228
- > // 0.2.0 — narrow first (an early return, as in the `thanks` example above,
229
- > // or an `if (ctx.sender)` guard around the rest of the handler).
230
- > if (!ctx.sender) return;
231
- > console.log(ctx.sender.handle);
232
- > ```
326
+ `Context.fromGenericEvent()` is gone, and nothing replaces it. Choosing the class for an event
327
+ is the SDK's job, not yours — where 0.2.x called `Context.fromGenericEvent(event, http)`, 0.3.0
328
+ calls nothing, because `bot.on()` hands your handler the right context already built.
329
+
330
+ One thing that is not a break, but is worth knowing if you pinned to it: `version` reports
331
+ `'0.3.0'`. In 0.2.1 it still said `'0.2.0'`, which was simply wrong; a test pins it to
332
+ `package.json` now, so it cannot drift again.
333
+
334
+ ### Upgrading from 0.3.x
335
+
336
+ `Embed`, `Button` and `ButtonContext` are new in 0.4.0. None of it is a break: `reply()` and
337
+ `send()` gained an `embeds` and a `buttons` field on their options object, both optional, so
338
+ calls that never mention them behave exactly as they did on 0.3.x.
339
+
340
+ `Message` gained three new fields — `embeds`, `buttons` and `buttonUsed` — all of which default
341
+ to an empty array (or `null` for `buttonUsed`) on a message that never carried any, so existing
342
+ code reading other `Message` fields is unaffected.
343
+
344
+ `bot.on('button.pressed', ...)` is a new event a bot can opt into; a bot that never registers a
345
+ handler for it simply never receives one.
233
346
 
234
347
  ## Shadowed commands
235
348
 
@@ -296,7 +409,7 @@ and "zero runtime dependencies" could not both be true.
296
409
 
297
410
  ```
298
411
  $ npm ls --omit=dev
299
- aurival@0.2.0
412
+ aurival@0.3.0
300
413
  └── (empty)
301
414
  ```
302
415
 
package/dist/bot.d.ts CHANGED
@@ -3,14 +3,26 @@ import { KeyFile } from './auth.js';
3
3
  import type { Machine, MachineKey } from './auth.js';
4
4
  import { Context, Event } from './events.js';
5
5
  import { HttpClient } from './http.js';
6
+ import type { AnyContext, BotContext, BotEventType, ButtonContext, ButtonEventType, EventContext, MemberContext, MemberEventType, ReactionContext, ReactionEventType } from './events.js';
6
7
  import type { Logger } from './http.js';
8
+ /** A `bot.command()` handler. */
7
9
  export type Handler = (ctx: Context) => Promise<void> | void;
10
+ /** A `member.joined` / `member.left` handler. */
11
+ export type MemberHandler = (ctx: MemberContext) => Promise<void> | void;
12
+ /** A `bot.added` / `bot.removed` handler. */
13
+ export type BotHandler = (ctx: BotContext) => Promise<void> | void;
14
+ /** A `reaction.added` handler. */
15
+ export type ReactionHandler = (ctx: ReactionContext) => Promise<void> | void;
16
+ /** A `button.pressed` handler. */
17
+ export type ButtonHandler = (ctx: ButtonContext) => Promise<void> | void;
18
+ /** A handler for an event type this SDK does not name — every field optional. */
19
+ export type EventHandler = (ctx: EventContext) => Promise<void> | void;
8
20
  /**
9
21
  * The hook also receives a `backlog.overflowed` Event, which is operational
10
22
  * rather than an error — it never reaches a handler (SDK-28).
11
23
  */
12
24
  export type Reportable = unknown | Event;
13
- export type ErrorHook = (error: Reportable, ctx: Context | null) => Promise<void> | void;
25
+ export type ErrorHook = (error: Reportable, ctx: AnyContext | null) => Promise<void> | void;
14
26
  /** How long a clean shutdown waits for handlers that are still running (SDK-32). */
15
27
  export declare const SHUTDOWN_GRACE_MS = 10000;
16
28
  export declare const MAX_COMMANDS = 50;
@@ -82,12 +94,17 @@ export declare class Bot {
82
94
  command(name: string, handler: Handler): void;
83
95
  command(name: string, description: string, handler: Handler): void;
84
96
  /**
85
- * Register a handler for any event type other than `command.invoked` (use
86
- * `command()` for that) — `member.joined`, `member.left`, `bot.added`,
87
- * `bot.removed`, `reaction.added`, or a future type this SDK does not yet
88
- * name. Many handlers may share one type; each runs in the order it was
89
- * registered (matches python), and the event is acked once, after every
90
- * handler for it has settled.
97
+ * Register a handler for an event. Which context the handler gets follows
98
+ * from the type, and your editor knows it (BA-R68):
99
+ *
100
+ * - `member.joined` / `member.left` → `MemberContext` (`ctx.user`)
101
+ * - `bot.added` / `bot.removed` → `BotContext` (`ctx.actor`)
102
+ * - `reaction.added` → `ReactionContext` (`ctx.sender`, `ctx.message`, `ctx.emoji`)
103
+ * - any other string → `EventContext` (everything optional)
104
+ *
105
+ * `command.invoked` goes through `command()`. Many handlers may share one
106
+ * type; each runs in the order it was registered (matches python), and
107
+ * the event is acked once, after every handler for it has settled.
91
108
  *
92
109
  * Throws immediately, before any registration, for the two types that are
93
110
  * STRUCTURALLY undispatchable through `on()`: `command.invoked` (never
@@ -100,7 +117,11 @@ export declare class Bot {
100
117
  * because the wire hasn't sent it yet would be a forward-compatibility
101
118
  * trap — the handler just never fires until/unless that changes.
102
119
  */
103
- on(type: string, handler: Handler): void;
120
+ on(type: MemberEventType, handler: MemberHandler): void;
121
+ on(type: BotEventType, handler: BotHandler): void;
122
+ on(type: ReactionEventType, handler: ReactionHandler): void;
123
+ on(type: ButtonEventType, handler: ButtonHandler): void;
124
+ on(type: string & {}, handler: EventHandler): void;
104
125
  /**
105
126
  * Called with (error, context | null) for anything the SDK caught for you: a
106
127
  * handler that threw, a `problem` frame, a backlog overflow.
package/dist/bot.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bot.d.ts","sourceRoot":"","sources":["../src/bot.ts"],"names":[],"mappings":"AAAA,sFAA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OAAO,GAAE,UAAe,EAMnC;IAID;;;OAGG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9C,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAUnE;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IACxD,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IAClD,EAAE,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAC5D,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IAGxD,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,EAAE,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;IAWnD;;;OAGG;IACH,OAAO,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI,CAE3B;IAID,iFAAiF;IAC3E,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAuBzB;IAEK,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA6C/C;CAwMF"}
package/dist/bot.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /** The developer-facing surface: declare commands, call run(), we hold the socket. */
2
2
  import { Auth, KeyFile, machineLabel, pair, resolveHost } from './auth.js';
3
3
  import { AurivalError, BotSuspended, RateLimitError, SessionSuperseded } from './errors.js';
4
- import { Context, Event } from './events.js';
4
+ import { Context, Event, contextFor } from './events.js';
5
5
  import { DEFAULT_HOST, HttpClient, defaultLogger } from './http.js';
6
6
  import { EVENT_BACKLOG_OVERFLOWED, EVENT_COMMAND_INVOKED, Socket } from './socket.js';
7
7
  import * as status from './status.js';
@@ -135,25 +135,6 @@ export class Bot {
135
135
  status.duplicateCommand(name, this.#quiet);
136
136
  this.#registered.set(key, { command: { name, description }, handler });
137
137
  }
138
- /**
139
- * Register a handler for any event type other than `command.invoked` (use
140
- * `command()` for that) — `member.joined`, `member.left`, `bot.added`,
141
- * `bot.removed`, `reaction.added`, or a future type this SDK does not yet
142
- * name. Many handlers may share one type; each runs in the order it was
143
- * registered (matches python), and the event is acked once, after every
144
- * handler for it has settled.
145
- *
146
- * Throws immediately, before any registration, for the two types that are
147
- * STRUCTURALLY undispatchable through `on()`: `command.invoked` (never
148
- * dispatched here — use `command()`) and `backlog.overflowed` (never
149
- * dispatched to any handler, by contract). A handler that truly can never
150
- * run is exactly the silent footgun this check exists to catch at
151
- * registration time. `reaction.removed` is NOT refused: it does not exist
152
- * on the wire today (AMENDMENT-04 A-2.1, un-reacting is silent), but that
153
- * is a today-fact, not a structural one, and refusing a type merely
154
- * because the wire hasn't sent it yet would be a forward-compatibility
155
- * trap — the handler just never fires until/unless that changes.
156
- */
157
138
  on(type, handler) {
158
139
  const reason = NEVER_DISPATCHED_TO_ON.get(type);
159
140
  if (reason !== undefined) {
@@ -397,7 +378,7 @@ export class Bot {
397
378
  }
398
379
  if (this.#http === null)
399
380
  return;
400
- const ctx = Context.fromGenericEvent(event, this.#http);
381
+ const ctx = contextFor(event, this.#http);
401
382
  for (const handler of handlers) {
402
383
  try {
403
384
  await handler(ctx);
package/dist/bot.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bot.js","sourceRoot":"","sources":["../src/bot.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE3E,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,EAAE,OAAO,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AE,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC"}
package/dist/caps.d.ts ADDED
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Cap numbers and cap sentences for embeds and buttons.
3
+ *
4
+ * These are the exact sentences the server sends back as `invalid_request`
5
+ * for the same violation, so a caller sees one wording whichever side
6
+ * refuses — client-side validation here or the backend behind it. Do not
7
+ * reword; do not add a cap that is not listed. Mirrors
8
+ * `sdk/python/aurival/caps.py` byte for byte.
9
+ */
10
+ export declare const MAX_EMBEDS = 3;
11
+ export declare const MAX_EMBED_FIELDS = 6;
12
+ export declare const MAX_BUTTONS = 5;
13
+ export declare const MAX_LABEL_RUNES = 24;
14
+ export declare const MAX_BUTTON_ID_LENGTH = 32;
15
+ export declare const MAX_TITLE_LENGTH = 256;
16
+ export declare const MAX_DESCRIPTION_LENGTH = 1024;
17
+ export declare const BUTTON_STYLES: readonly ['primary', 'secondary', 'danger'];
18
+ export type ButtonStyle = (typeof BUTTON_STYLES)[number];
19
+ export declare const CAP_TOO_MANY_EMBEDS = "a message carries at most 3 embeds";
20
+ export declare const CAP_TOO_MANY_FIELDS = "a message carries at most 6 embed fields";
21
+ export declare const CAP_TOO_MANY_BUTTONS = "a message carries at most 5 buttons";
22
+ export declare const CAP_LABEL_TOO_LONG = "a button label is at most 24 characters";
23
+ export declare const CAP_BUTTON_ID_TOO_LONG = "a button id is at most 32 characters";
24
+ export declare const CAP_DUPLICATE_BUTTON_ID = "a button id must be unique within a message";
25
+ export declare const CAP_BAD_BUTTON_STYLE = "a button style must be one of primary, secondary, danger";
26
+ export declare const CAP_LINK_STYLE_DEFERRED = "link buttons are not supported in v1";
27
+ export declare const CAP_TITLE_TOO_LONG = "an embed title is at most 256 characters";
28
+ export declare const CAP_DESCRIPTION_TOO_LONG = "an embed description is at most 1024 characters";
29
+ export declare const CAP_IMAGE_URL_NOT_HTTPS = "an image url must start with https://";
30
+ /**
31
+ * The SDK's own precondition, not one of the server's cap sentences: a send
32
+ * with no text, no embeds and no buttons has nothing to deliver, so it is
33
+ * refused here rather than sent for the server to refuse as empty text.
34
+ */
35
+ export declare const EMPTY_MESSAGE = "a message needs text, embeds or buttons";
36
+ //# sourceMappingURL=caps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caps.d.ts","sourceRoot":"","sources":["../src/caps.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,aAAa,YAAI,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAU,CAAC;AAEzE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,mBAAmB,uCAAuC,CAAC;AACxE,eAAO,MAAM,mBAAmB,6CAA6C,CAAC;AAC9E,eAAO,MAAM,oBAAoB,wCAAwC,CAAC;AAC1E,eAAO,MAAM,kBAAkB,4CAA4C,CAAC;AAC5E,eAAO,MAAM,sBAAsB,yCAAyC,CAAC;AAC7E,eAAO,MAAM,uBAAuB,gDAAgD,CAAC;AACrF,eAAO,MAAM,oBAAoB,6DAA6D,CAAC;AAC/F,eAAO,MAAM,uBAAuB,yCAAyC,CAAC;AAC9E,eAAO,MAAM,kBAAkB,6CAA6C,CAAC;AAC7E,eAAO,MAAM,wBAAwB,oDAAoD,CAAC;AAC1F,eAAO,MAAM,uBAAuB,0CAA0C,CAAC;AAE/E;;;;GAIG;AACH,eAAO,MAAM,aAAa,4CAA4C,CAAC"}
package/dist/caps.js ADDED
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Cap numbers and cap sentences for embeds and buttons.
3
+ *
4
+ * These are the exact sentences the server sends back as `invalid_request`
5
+ * for the same violation, so a caller sees one wording whichever side
6
+ * refuses — client-side validation here or the backend behind it. Do not
7
+ * reword; do not add a cap that is not listed. Mirrors
8
+ * `sdk/python/aurival/caps.py` byte for byte.
9
+ */
10
+ export const MAX_EMBEDS = 3;
11
+ export const MAX_EMBED_FIELDS = 6;
12
+ export const MAX_BUTTONS = 5;
13
+ export const MAX_LABEL_RUNES = 24;
14
+ export const MAX_BUTTON_ID_LENGTH = 32;
15
+ export const MAX_TITLE_LENGTH = 256;
16
+ export const MAX_DESCRIPTION_LENGTH = 1024;
17
+ export const BUTTON_STYLES = ['primary', 'secondary', 'danger'];
18
+ export const CAP_TOO_MANY_EMBEDS = 'a message carries at most 3 embeds';
19
+ export const CAP_TOO_MANY_FIELDS = 'a message carries at most 6 embed fields';
20
+ export const CAP_TOO_MANY_BUTTONS = 'a message carries at most 5 buttons';
21
+ export const CAP_LABEL_TOO_LONG = 'a button label is at most 24 characters';
22
+ export const CAP_BUTTON_ID_TOO_LONG = 'a button id is at most 32 characters';
23
+ export const CAP_DUPLICATE_BUTTON_ID = 'a button id must be unique within a message';
24
+ export const CAP_BAD_BUTTON_STYLE = 'a button style must be one of primary, secondary, danger';
25
+ export const CAP_LINK_STYLE_DEFERRED = 'link buttons are not supported in v1';
26
+ export const CAP_TITLE_TOO_LONG = 'an embed title is at most 256 characters';
27
+ export const CAP_DESCRIPTION_TOO_LONG = 'an embed description is at most 1024 characters';
28
+ export const CAP_IMAGE_URL_NOT_HTTPS = 'an image url must start with https://';
29
+ /**
30
+ * The SDK's own precondition, not one of the server's cap sentences: a send
31
+ * with no text, no embeds and no buttons has nothing to deliver, so it is
32
+ * refused here rather than sent for the server to refuse as empty text.
33
+ */
34
+ export const EMPTY_MESSAGE = 'a message needs text, embeds or buttons';
35
+ //# sourceMappingURL=caps.js.map
@@ -0,0 +1 @@
1
+ {"version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