Skip to content

Include room name in message stream for bots #11811

@timkinnane

Description

@timkinnane

A common use case for bots is to have room specific functionality. In the current subscription model, all they get access to is the room ID, so they usually need a subsequent call using DDP or the API to find out the name for the current room using the ID.

It's a very simple solution to just add the room name to the meta (options) object that is the second argument given to the stream event callbacks. This already contains the room type, so it's the logical place.

I know some rooms (DM) don't have a name, but that's fine, the property can contain undefined and the bot can either check for undefined or just use the name when room type is not d.

I have a PR ready for this and am implementing it with bots locally already.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions