Get room name from message
Get room name from message
You can use the streams service to get room info, then extract the room name in the `roomAttributes` object.
**BDK 2.0:**
```java
bdk.datafeed().subscribe(new RealTimeEventListener() {
@Override
public void onMessageSent(V4Initiator initiator, V4MessageSent event) {
String streamId = event.getMessage().getStream().getStreamId();
String roomName = bdk.streams().getRoomInfo(streamId).getRoomAttributes().getName();
bdk.messages().send(streamId, "Hello in room: " + roomName);
}
}
```
**SDK:**
```java
String streamId = msg.getStream().getStreamId();
String roomName = botClient.getStreamsClient()
.getRoomInfo(streamId).getRoomAttributes().getName();
this.botClient.getMessagesClient().sendMessage(streamId,
new OutboundMessage("Hello in room: " + roomName));
```
You can use the streams service to get room info, then extract the room name in the `roomAttributes` object.
**BDK 2.0:**
```
bdk.datafeed().subscribe(new RealTimeEventListener() {
@Override
public void onMessageSent(V4Initiator initiator, V4MessageSent event) {
String streamId = event.getMessage().getStream().getStreamId();
String roomName = bdk.streams().getRoomInfo(streamId).getRoomAttributes().getName();
bdk.messages().send(streamId, "Hello in room: " + roomName);
}
}
```
**SDK:**
```
String streamId = msg.getStream().getStreamId();
String roomName = botClient.getStreamsClient()
.getRoomInfo(streamId).getRoomAttributes().getName();
this.botClient.getMessagesClient().sendMessage(streamId,
new OutboundMessage("Hello in room: " + roomName));
```
Get room name from message
Get room name from message
You can use the streams service to get room info, then extract the room name in the `roomAttributes` object.
**BDK 2.0:**
```
bdk.datafeed().subscribe(new RealTimeEventListener() {
@Override
public void onMessageSent(V4Initiator initiator, V4MessageSent event) {
String streamId = event.getMessage().getStream().getStreamId();
String roomName = bdk.streams().getRoomInfo(streamId).getRoomAttributes().getName();
bdk.messages().send(streamId, "Hello in room: " + roomName);
}
}
```
**SDK:**
```
String streamId = msg.getStream().getStreamId();
String roomName = botClient.getStreamsClient()
.getRoomInfo(streamId).getRoomAttributes().getName();
this.botClient.getMessagesClient().sendMessage(streamId,
new OutboundMessage("Hello in room: " + roomName));
```
You can use the streams service to get room info, then extract the room name in the `roomAttributes` object.
BDK 2.0:
```
bdk.datafeed().subscribe(new RealTimeEventListener() {
@Override
public void onMessageSent(V4Initiator initiator, V4MessageSent event) {
String streamId = event.getMessage().getStream().getStreamId();
String roomName = bdk.streams().getRoomInfo(streamId).getRoomAttributes().getName();
bdk.messages().send(streamId, "Hello in room: " + roomName);
}
}
```
SDK:
```
String streamId = msg.getStream().getStreamId();
String roomName = botClient.getStreamsClient()
.getRoomInfo(streamId).getRoomAttributes().getName();
this.botClient.getMessagesClient().sendMessage(streamId,
new OutboundMessage("Hello in room: " + roomName));
```
Get room name from message
Get room name from message
You can use the streams service to get room info, then extract the room name in the `roomAttributes` object.
BDK 2.0:
```
bdk.datafeed().subscribe(new RealTimeEventListener() {
@Override
public void onMessageSent(V4Initiator initiator, V4MessageSent event) {
String streamId = event.getMessage().getStream().getStreamId();
String roomName = bdk.streams().getRoomInfo(streamId).getRoomAttributes().getName();
bdk.messages().send(streamId, "Hello in room: " + roomName);
}
}
```
SDK:
```
String streamId = msg.getStream().getStreamId();
String roomName = botClient.getStreamsClient()
.getRoomInfo(streamId).getRoomAttributes().getName();
this.botClient.getMessagesClient().sendMessage(streamId,
new OutboundMessage("Hello in room: " + roomName));
```
You can use the streams service to get room info, then extract the room name in the `roomAttributes` object.
BDK 2.0:
```java
bdk.datafeed().subscribe(new RealTimeEventListener() {
@Override
public void onMessageSent(V4Initiator initiator, V4MessageSent event) {
String streamId = event.getMessage().getStream().getStreamId();
String roomName = bdk.streams().getRoomInfo(streamId).getRoomAttributes().getName();
bdk.messages().send(streamId, "Hello in room: " + roomName);
}
}
```
SDK:
```java
String streamId = msg.getStream().getStreamId();
String roomName = botClient.getStreamsClient()
.getRoomInfo(streamId).getRoomAttributes().getName();
this.botClient.getMessagesClient().sendMessage(streamId,
new OutboundMessage("Hello in room: " + roomName));
```
Get room name from message
You can use the streams service to get room info, then extract the room name in the `roomAttributes` object.
BDK 2.0:
```java
bdk.datafeed().subscribe(new RealTimeEventListener() {
@Override
public void onMessageSent(V4Initiator initiator, V4MessageSent event) {
String streamId = event.getMessage().getStream().getStreamId();
String roomName = bdk.streams().getRoomInfo(streamId).getRoomAttributes().getName();
bdk.messages().send(streamId, "Hello in room: " + roomName);
}
}
```
SDK:
```java
String streamId = msg.getStream().getStreamId();
String roomName = botClient.getStreamsClient()
.getRoomInfo(streamId).getRoomAttributes().getName();
this.botClient.getMessagesClient().sendMessage(streamId,
new OutboundMessage("Hello in room: " + roomName));
```