Send message to specific user in room


I’m trying to figure out to send a message to a specific user in a room. I know it exists inside the framework, as I have seen an app we that use display a message with the text “Only you can see this message”. I have seen other people ask about this and it sounds like I need to call a “notify message” (link). I looked at code for the app I mentioned above and it looks like notifyUser() is called. My issue is that I have no idea how to call this function. I am very new to NodeJS and Typescript, and Rocket.Chat in general.

I also found this #9177. In the thread, someone mentions RocketChat.Notifications.notifyUser(Meteor.userId(), ‘message’, {}). But again, I’m not sure how to call this exactly.

Server Setup Information

  • Version of Rocket.Chat Server: 1.1.3
  • Operating System: Linux 4.4.0-137-generic
  • Deployment Method: snap
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Unsure
  • NodeJS Version: v8.11.4
  • MongoDB Version: 3.4.20