Rocket.Chat.Go.SDK
Rocket.Chat.Go.SDK copied to clipboard
Feature: Modify SendMessage function to take a models.Message parameter instead of a string
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.Messageparameter instead of astring. - Implement a new function called
NewMessage(channel *models.Channel, text string)inrealtime/messages.gothat 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!
This issue can be closed now.