Rocket.Chat.Go.SDK icon indicating copy to clipboard operation
Rocket.Chat.Go.SDK copied to clipboard

Feature: Modify SendMessage function to take a models.Message parameter instead of a string

Open ZakiChammaa opened this issue 6 years ago • 1 comments

Hi!

The function SendMessage(channel *models.Channel, text string) in realtime/messages.go currently takes a string and creates a models.Message variable in the function before sending it. This really limits what we can send to rocket.chat (we need to send attachments with the message for example).

I propose the following:

  • Implement a feature to modify this function so that it takes a models.Message parameter instead of a string.
  • Implement a new function called NewMessage(channel *models.Channel, text string) in realtime/messages.go that returns a basic message with a RoomID, a Msg, and an ID based on the function newRandomId().

Please let me know what you think about each of the above points. I can start working on a PR as soon as you approve these propositions.

Thanks!

ZakiChammaa avatar Mar 26 '19 18:03 ZakiChammaa

This issue can be closed now.

debdutdeb avatar May 08 '21 11:05 debdutdeb