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.
Hi!
The function
SendMessage(channel *models.Channel, text string)
inrealtime/messages.go
currently takes astring
and creates amodels.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:
models.Message
parameter instead of astring
.NewMessage(channel *models.Channel, text string)
inrealtime/messages.go
that returns a basic message with a RoomID, a Msg, and an ID based on the functionnewRandomId()
.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!