Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Get room name from message

I am writing a Java bot and reading the datafeed for messages.
When receiving a message, how do I get the name of the room where the message was sent?

Votes Newest

Answers 3


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));
  
  
Posted 3 years ago
Edited 3 years ago
Yong Sheng Tan
39 × 2 Administrator

You can filter the payload to only include the rooms via parmaters such as "active": true, by modofying the body json:

file


question as extension to this one:

if I have few archived chat rooms which are not visible in deleop.symphony.com, how do I filter out these few archived / in-active chatrooms from returned data feed streams ?

thanks

  
  
Posted 3 years ago