@imvu/bot 0.0.0-stage → 0.1.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
@@ -1,3 +1,121 @@
1
- # Temporary Holding Version
1
+ # @imvu/bot
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Build IMVU chat bots on top of [`@imvu/client`](https://dhkatz.github.io/imvu.js/packages/client/), for one room or hundreds, and
4
+ for IMs: the same commands answer in rooms and in private or group conversations, with
5
+ permissions and cooldowns, middleware, rate limiting per source and per account, paced
6
+ joins, and rejoining when the server drops the bot.
7
+
8
+ ```ts
9
+ import { Bot } from '@imvu/bot';
10
+ import { Client } from '@imvu/client';
11
+
12
+ const client = new Client();
13
+ await client.login(username, password);
14
+
15
+ const bot = new Bot({ client, admins: [myCid] });
16
+
17
+ bot.command('ping', (ctx) => ctx.reply('pong'));
18
+
19
+ bot.command('skip', { permission: 'moderator', sources: ['room'], cooldown: 10_000 }, async (ctx) => {
20
+ await radio.skip(ctx.source.id);
21
+ await ctx.reply(`Skipped for ${ctx.author.username}.`);
22
+ });
23
+
24
+ bot.on('participantJoin', (participant, room) => void room.say(`Welcome, ${participant.user?.username}!`));
25
+ bot.on('error', (error, source) => console.error(source?.name, error));
26
+
27
+ const { joined, failed } = await bot.joinAll(['123456-1', '654321-2' /* … */]);
28
+ ```
29
+
30
+ ## The model
31
+
32
+ The comparison with discord.js:
33
+
34
+ | discord.js | @imvu/bot |
35
+ | ----------------------------------- | --------------------------------------------------------- |
36
+ | `Client` | `Bot`: one logged-in account and one realtime connection |
37
+ | `Guild`, `client.guilds.cache` | `BotRoom`, `bot.rooms` (a map by room id) |
38
+ | `GuildMember`, `guild.members` | `ChatParticipant`, `room.participants` (a map by user id) |
39
+ | `message.author` / `message.member` | `message.author` (a full `User`) / `message.participant` |
40
+ | `message.guild` / `message.channel` | `message.source`: a `BotRoom` or a `BotConversation` (IM) |
41
+ | DM channels | `bot.conversations` (a map by conversation id) |
42
+
43
+ - **`message.author` is always a full `User`.** Participant lists embed every user, so
44
+ authors come from the cache. A user is only fetched (once, shared) when a line
45
+ arrives before their join has been seen.
46
+ - **`message.participant`** is the author's presence in the room: join time, seat,
47
+ outfit (`productIds`), `user`. It is null for IMs, and when not known yet.
48
+ - **`message.source`** says where the message came from: `source.type` is `'room'` or
49
+ `'conversation'`. Both have `id`, `name`, `say()`, `whisper()` and `roleOf()`.
50
+ Rooms add participants and `boot()`; conversations add `group` and the underlying
51
+ `conversation`.
52
+
53
+ ## IMs
54
+
55
+ The bot answers IMs by default (`ims: false` turns that off). Joining a room starts
56
+ it; a bot that is in no rooms calls `await bot.start()`.
57
+
58
+ - **Commands run in both kinds of source.** Restrict one with `sources: ['room']` or
59
+ `sources: ['conversation']`.
60
+ - **`ctx.reply()` answers in the conversation**, and `ctx.whisper()` sends a separate
61
+ one-to-one IM when the conversation is a group.
62
+ - **Roles in IMs:** there are no room roles, so the author is `admin` (your `admins`)
63
+ or `everyone`.
64
+ - Accounts without a verified email can only start conversations with friends
65
+ (`RATE-001`). Bot accounts should verify their email. Whether an unverified account
66
+ may reply in a conversation someone else started hasn't been tested.
67
+
68
+ ## Commands
69
+
70
+ - `!name arg "quoted words"` gives `ctx.args` `['arg', 'quoted words']`; `ctx.argText`
71
+ is the raw text. The prefix is configurable (`prefix`, default `!`), names are
72
+ case-insensitive, and `aliases` add more names.
73
+ - **`ctx.reply(text)` answers in kind**: a whisper to the bot gets a whisper back,
74
+ public chat a public reply. `ctx.whisper(text)` always whispers.
75
+ - **`sources`** restricts where a command runs (`['room']`, `['conversation']`), and
76
+ narrows `ctx.source` in its handler: a room-only command gets a `BotRoom`, with no
77
+ type checks needed.
78
+ - **Permissions** are roles in the message's source, each including the ones below:
79
+ - `everyone`;
80
+ - `moderator`: the room's moderator list, re-read every `moderatorCacheMs`;
81
+ - `owner`: the room owner;
82
+ - `admin`: your `admins`, everywhere.
83
+
84
+ Pass a function for custom checks. Refusals emit `denied`.
85
+
86
+ - **`cooldown`** (ms) limits each user per command per room; admins are exempt.
87
+ - **Middleware**, `bot.use((ctx, next) => …)`, runs before every command, in order.
88
+ Skip `next()` to stop the command.
89
+ - A built-in `help` lists what the caller may run there (`help: false` drops it).
90
+ - Messages are handled in arrival order per room. Handlers run independently, so a
91
+ slow command doesn't hold up the next. Handler errors emit `commandError`, or
92
+ `error` when nothing listens for that.
93
+
94
+ ## Many rooms
95
+
96
+ - **`bot.joinAll(ids)`** joins through a paced queue (`joinInterval`, default 1.5 s)
97
+ and returns `{ joined, failed }`. Full rooms (`CHAT_PARTICIPANT-002`, common because
98
+ room-list occupancy lags) and missing rooms end up in `failed` rather than throwing.
99
+ `bot.join(id)` is the single-room form, and both return the existing room if the
100
+ bot is already there. `client.account.rooms.managed()` lists the rooms the account
101
+ moderates.
102
+ - **Two budgets for everything the bot says**: per room (default 3 lines per 5 s, at
103
+ most `maxQueue` = 20 waiting) and per account across all rooms (`globalRateLimit`,
104
+ default 20 lines per 10 s). IMVU rate-limits chat, and an account that floods can be
105
+ flagged. When a room's queue is full, sends reject instead of backing up.
106
+ - **Built to scale:**
107
+ - Presence keepalives start at random offsets, so rooms don't renew in lockstep.
108
+ - In joined rooms, outfit and seat changes come from the chat broadcasts everyone
109
+ already sends, not from re-reading participants.
110
+ - Authors come from the cache.
111
+ - All rooms share one realtime connection.
112
+ - **Rejoining:** if the server drops the bot (expired presence, network trouble), it
113
+ rejoins after 5 s, 15 s and 60 s (`rejoin.delays`) and emits `roomRejoin`. After a
114
+ boot it stays out unless `rejoin.afterBoot` is set. When it is out for good it
115
+ emits `roomLeave`.
116
+ - **Room events**, each with the room: `participantJoin`, `participantLeave`,
117
+ `participantUpdate` (outfit and seat changes), `booted`, plus `message` for every
118
+ line.
119
+
120
+ **Listen for `error`.** Errors are only reported through that event, so a bot
121
+ without an `error` listener fails silently.
package/dist/Bot.d.ts ADDED
@@ -0,0 +1,239 @@
1
+ import { EventEmitter } from 'node:events';
2
+ import type { ChatMessage, ChatParticipant, ChatSession, ChatSessionCloseReason, Client, Conversation, ConversationMessage, JoinOptions, ParticipantChange, ParticipantLeave, Room, User } from '@imvu/client';
3
+ import { type RateLimit } from './RateLimiter.js';
4
+ /** Who may run a command, lowest to highest. Each level includes the ones below it. */
5
+ export type Role = 'everyone' | 'moderator' | 'owner' | 'admin';
6
+ /** Where a message came from: a room, or an IM conversation. Check `source.type`. */
7
+ export type MessageSource = BotRoom | BotConversation;
8
+ export type SourceType = MessageSource['type'];
9
+ export interface BotOptions {
10
+ client: Client;
11
+ /** Command prefix. Default `!`. */
12
+ prefix?: string;
13
+ /** Bot operators: allowed every command everywhere. */
14
+ admins?: Array<string | number>;
15
+ /** Outgoing chat budget per room. Default 3 lines per 5 s. */
16
+ rateLimit?: RateLimit;
17
+ /** Outgoing chat budget for the whole account, across all rooms. Default 20 lines per 10 s. */
18
+ globalRateLimit?: RateLimit;
19
+ /** Lines allowed to wait for a room's rate limit before new ones are rejected. Default 20. */
20
+ maxQueue?: number;
21
+ /** Pause between room joins, so joining hundreds of rooms doesn't burst. Default 1.5 s. */
22
+ joinInterval?: number;
23
+ /**
24
+ * Rejoin when the server drops the bot (expired presence, network). Default `true`.
25
+ * `afterBoot` also rejoins after being booted (default `false`; staying out is polite).
26
+ */
27
+ rejoin?: boolean | {
28
+ afterBoot?: boolean;
29
+ delays?: number[];
30
+ };
31
+ /** Register a built-in `help` command. Default `true`. */
32
+ help?: boolean;
33
+ /** How long a room's moderator list is trusted before re-reading it. Default 5 min. */
34
+ moderatorCacheMs?: number;
35
+ /** Passed to every `room.join()`. */
36
+ join?: JoinOptions;
37
+ /** Answer IMs (private and group conversations) as well as room chat. Default `true`. */
38
+ ims?: boolean;
39
+ }
40
+ /** A chat line the bot received, with its author resolved. */
41
+ export interface BotMessage {
42
+ text: string;
43
+ /** The sender. Resolved from the cache (participant reads embed users), fetched only on a miss. */
44
+ author: User;
45
+ /** The sender's presence in the room; null for IMs, and when not known yet. */
46
+ participant: ChatParticipant | null;
47
+ source: MessageSource;
48
+ /** `/me …` narration. */
49
+ action: boolean;
50
+ /** Whispered to the bot rather than said publicly. Always false for IMs. */
51
+ whisper: boolean;
52
+ receivedAt: Date;
53
+ /** The underlying room chat line or IM. */
54
+ raw: ChatMessage | ConversationMessage;
55
+ /** Answer in kind: a whisper gets a whisper back, public chat a public reply. */
56
+ reply(text: string): Promise<void>;
57
+ }
58
+ /** The source type for a `type`: `SourceOf<'room'>` is `BotRoom`. */
59
+ export type SourceOf<T extends SourceType> = Extract<MessageSource, {
60
+ type: T;
61
+ }>;
62
+ export interface CommandOptions<T extends SourceType = SourceType> {
63
+ description?: string;
64
+ /** Shown by `help <command>`, e.g. `<user> [reason]`. */
65
+ usage?: string;
66
+ aliases?: string[];
67
+ /** Minimum role, or a custom check. Default `'everyone'`. */
68
+ permission?: Role | ((context: CommandContext<SourceOf<T>>) => boolean | Promise<boolean>);
69
+ /** Per-user cooldown in milliseconds (per source). */
70
+ cooldown?: number;
71
+ /**
72
+ * Where the command may run. Default: everywhere. Also narrows `ctx.source` in the
73
+ * handler: with `['room']` it is a `BotRoom`.
74
+ */
75
+ sources?: T[];
76
+ }
77
+ export type CommandHandler<S extends MessageSource = MessageSource> = (context: CommandContext<S>) => void | Promise<void>;
78
+ export type Middleware = (context: CommandContext, next: () => Promise<void>) => void | Promise<void>;
79
+ export interface CommandContext<S extends MessageSource = MessageSource> {
80
+ bot: Bot;
81
+ message: BotMessage;
82
+ source: S;
83
+ author: User;
84
+ participant: ChatParticipant | null;
85
+ /** The canonical command name (not the alias that was typed). */
86
+ command: string;
87
+ args: string[];
88
+ argText: string;
89
+ /** The author's role in this source. */
90
+ role: Role;
91
+ reply(text: string): Promise<void>;
92
+ /** Whisper the author. */
93
+ whisper(text: string): Promise<void>;
94
+ }
95
+ export interface JoinFailure {
96
+ target: Room | string;
97
+ error: Error;
98
+ }
99
+ export interface BotEvents {
100
+ message: [message: BotMessage];
101
+ roomJoin: [room: BotRoom];
102
+ /** The bot is out of the room for good (booted, or rejoining failed). Not emitted for `leave()`. */
103
+ roomLeave: [room: BotRoom, reason: ChatSessionCloseReason];
104
+ roomRejoin: [room: BotRoom];
105
+ booted: [room: BotRoom, by: string];
106
+ participantJoin: [participant: ChatParticipant, room: BotRoom];
107
+ participantLeave: [event: ParticipantLeave, room: BotRoom];
108
+ participantUpdate: [participant: ChatParticipant, changes: ParticipantChange[], room: BotRoom];
109
+ /** A command was refused for lack of permission. */
110
+ denied: [context: CommandContext];
111
+ commandError: [error: Error, context: CommandContext];
112
+ error: [error: Error, source?: MessageSource];
113
+ }
114
+ /** One room the bot is in (the IMVU counterpart of a discord.js guild). Survives rejoins. */
115
+ export declare class BotRoom {
116
+ #private;
117
+ private readonly bot;
118
+ readonly room: Room;
119
+ session: ChatSession;
120
+ readonly type: 'room';
121
+ constructor(bot: Bot, room: Room, session: ChatSession, limit: RateLimit, maxQueue: number);
122
+ get id(): string;
123
+ get name(): string;
124
+ /** Everyone present, by user id (the counterpart of `guild.members.cache`). A live view, not a copy. */
125
+ get participants(): ReadonlyMap<string, ChatParticipant>;
126
+ participant(userId: string | number): ChatParticipant | undefined;
127
+ /** Say something in public chat (rate limited per room and per account). */
128
+ say(text: string): Promise<void>;
129
+ /** Whisper one participant (rate limited). */
130
+ whisper(userId: string | number, text: string): Promise<void>;
131
+ /** Boot a participant. Needs owner or moderator rights in the room. */
132
+ boot(userId: string | number): Promise<void>;
133
+ /** The highest role `userId` holds here. */
134
+ roleOf(userId: string | number): Promise<Role>;
135
+ leave(): Promise<void>;
136
+ /** @internal */
137
+ _stop(): void;
138
+ private ownerId;
139
+ private moderatorIds;
140
+ }
141
+ /**
142
+ * One IM conversation the bot is part of (the counterpart of a discord.js DM channel,
143
+ * or a group DM). Created when its first message arrives.
144
+ */
145
+ export declare class BotConversation {
146
+ #private;
147
+ private readonly bot;
148
+ conversation: Conversation;
149
+ readonly type: 'conversation';
150
+ constructor(bot: Bot, conversation: Conversation, limit: RateLimit, maxQueue: number);
151
+ get id(): string;
152
+ /** The other members' names, e.g. for logs. */
153
+ get name(): string;
154
+ /** True for a conversation with more than one other person. */
155
+ get group(): boolean;
156
+ /** Send a message to the conversation (rate limited per conversation and per account). */
157
+ say(text: string): Promise<void>;
158
+ /**
159
+ * Message one member privately: the conversation itself when it is one-to-one, a
160
+ * separate one-to-one IM when it is a group.
161
+ */
162
+ whisper(userId: string | number, text: string): Promise<void>;
163
+ /** In IMs there are no room roles: bot admins are `admin`, everyone else `everyone`. */
164
+ roleOf(userId: string | number): Promise<Role>;
165
+ /** Conversations have no participants in the room sense. */
166
+ participant(): undefined;
167
+ /** @internal */
168
+ _stop(): void;
169
+ }
170
+ /**
171
+ * A chat bot for any number of rooms and IM conversations: routes `!commands` to handlers with permissions,
172
+ * cooldowns and middleware, rate-limits what it says per room and per account, paces
173
+ * its joins, and rejoins when the server drops it.
174
+ *
175
+ * ```ts
176
+ * const bot = new Bot({ client, admins: [myCid] });
177
+ * bot.command('ping', (ctx) => ctx.reply('pong'));
178
+ * await bot.joinAll(roomIds);
179
+ * ```
180
+ */
181
+ export declare class Bot extends EventEmitter<BotEvents> {
182
+ #private;
183
+ readonly client: Client;
184
+ readonly prefix: string;
185
+ /** @internal */
186
+ readonly moderatorCacheMs: number;
187
+ constructor(options: BotOptions);
188
+ /** The rooms the bot is in, by room id (the counterpart of `client.guilds.cache`). */
189
+ get rooms(): ReadonlyMap<string, BotRoom>;
190
+ /** IM conversations the bot has heard from, by conversation id. */
191
+ get conversations(): ReadonlyMap<string, BotConversation>;
192
+ /**
193
+ * Start answering IMs (unless `ims: false`). Joining a room does this too, so call
194
+ * it yourself only for a bot that is in no rooms. Safe to call more than once.
195
+ */
196
+ start(): Promise<void>;
197
+ isAdmin(userId: string | number): boolean;
198
+ command(name: string, handler: CommandHandler): this;
199
+ command<T extends SourceType = SourceType>(name: string, options: CommandOptions<T>, handler: CommandHandler<SourceOf<T>>): this;
200
+ /** Run `middleware` before every command handler; call `next()` to continue. */
201
+ use(middleware: Middleware): this;
202
+ /**
203
+ * Join a room by id (e.g. `'123456-1'`) or {@link Room}. Joins are paced by
204
+ * `joinInterval`; joining a room the bot is in (or joining) returns that room.
205
+ */
206
+ join(target: Room | string): Promise<BotRoom>;
207
+ /**
208
+ * Join many rooms, paced, without stopping at the first failure. Full rooms
209
+ * (`CHAT_PARTICIPANT-002`), private rooms and missing rooms end up in `failed`.
210
+ */
211
+ joinAll(targets: Iterable<Room | string>): Promise<{
212
+ joined: BotRoom[];
213
+ failed: JoinFailure[];
214
+ }>;
215
+ leave(roomId: string): Promise<void>;
216
+ /** Leave every room and stop answering IMs. */
217
+ stop(): Promise<void>;
218
+ private startIms;
219
+ /** @internal Every outgoing line passes the account-wide budget. */
220
+ _send(task: () => Promise<void>): Promise<void>;
221
+ private paced;
222
+ private joinNow;
223
+ private attach;
224
+ private onClose;
225
+ /**
226
+ * Messages are handled in arrival order per source (author and role lookups are
227
+ * async), then each command handler runs on its own so a slow one doesn't hold up
228
+ * the next.
229
+ */
230
+ private enqueue;
231
+ private onMessage;
232
+ private dispatchCommand;
233
+ private run;
234
+ private permitted;
235
+ private coolingDown;
236
+ private help;
237
+ private emitError;
238
+ }
239
+ //# sourceMappingURL=Bot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bot.d.ts","sourceRoot":"","sources":["../src/Bot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,EACX,WAAW,EACX,eAAe,EACf,WAAW,EACX,sBAAsB,EACtB,MAAM,EACN,YAAY,EACZ,mBAAmB,EAEnB,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE/D,uFAAuF;AACvF,MAAM,MAAM,IAAI,GAAG,UAAU,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