Skip to content

Documentation / @imvu/bot / BotRoom

Class: BotRoom ​

Defined in: packages/bot/src/Bot.ts:147

One room the bot is in (the IMVU counterpart of a discord.js guild). Survives rejoins.

Constructors ​

Constructor ​

ts
new BotRoom(
   bot, 
   room, 
   session, 
   limit, 
   maxQueue
): BotRoom;

Defined in: packages/bot/src/Bot.ts:153

Parameters ​

ParameterType
botBot
roomRoom
sessionChatSession
limitRateLimit
maxQueuenumber

Returns ​

BotRoom

Properties ​

room ​

ts
readonly room: Room;

Defined in: packages/bot/src/Bot.ts:155


session ​

ts
session: ChatSession;

Defined in: packages/bot/src/Bot.ts:156


type ​

ts
readonly type: "room";

Defined in: packages/bot/src/Bot.ts:148

Accessors ​

id ​

Get Signature ​

ts
get id(): string;

Defined in: packages/bot/src/Bot.ts:164

Returns ​

string


name ​

Get Signature ​

ts
get name(): string;

Defined in: packages/bot/src/Bot.ts:168

Returns ​

string


participants ​

Get Signature ​

ts
get participants(): ReadonlyMap<string, ChatParticipant>;

Defined in: packages/bot/src/Bot.ts:173

Everyone present, by user id (the counterpart of guild.members.cache). A live view, not a copy.

Returns ​

ReadonlyMap<string, ChatParticipant>

Methods ​

_stop() ​

ts
_stop(): void;

Defined in: packages/bot/src/Bot.ts:210

Internal

Returns ​

void


boot() ​

ts
boot(userId): Promise<void>;

Defined in: packages/bot/src/Bot.ts:192

Boot a participant. Needs owner or moderator rights in the room.

Parameters ​

ParameterType
userIdstring | number

Returns ​

Promise<void>


leave() ​

ts
leave(): Promise<void>;

Defined in: packages/bot/src/Bot.ts:205

Returns ​

Promise<void>


participant() ​

ts
participant(userId): 
  | ChatParticipant
  | undefined;

Defined in: packages/bot/src/Bot.ts:177

Parameters ​

ParameterType
userIdstring | number

Returns ​

| ChatParticipant | undefined


roleOf() ​

ts
roleOf(userId): Promise<Role>;

Defined in: packages/bot/src/Bot.ts:197

The highest role userId holds here.

Parameters ​

ParameterType
userIdstring | number

Returns ​

Promise<Role>


say() ​

ts
say(text): Promise<void>;

Defined in: packages/bot/src/Bot.ts:182

Say something in public chat (rate limited per room and per account).

Parameters ​

ParameterType
textstring

Returns ​

Promise<void>


whisper() ​

ts
whisper(userId, text): Promise<void>;

Defined in: packages/bot/src/Bot.ts:187

Whisper one participant (rate limited).

Parameters ​

ParameterType
userIdstring | number
textstring

Returns ​

Promise<void>

Released under the MIT License.