jbot
jbot copied to clipboard
RichMessage.getEncodedMessage() breaks announcements
In slack if you want to announce with a bot message you need to use . When you include this in the message but call getEncodedMessage it does not work. However if you don't use the encoded message it does work.
see https://get.slack.help/hc/en-us/articles/202009646-Make-an-announcement. Scroll down to section labeled bot messages.
The same issue is present with user mentions, like <@Us2314>. User mentions should not be encoded in message payload because < and > characters should be evaluated by Slack as control sequences. Currently it is sent as <@Us2314>
Manually turning off encoding method fixes the issue.
More details: https://api.slack.com/docs/message-formatting (Control sequences)
@plokijuma How can encoding be manually turned off? It seems encode() is always called? It also breaks linking: https://api.slack.com/docs/messages/builder?msg=%7B%22text%22%3A%22This%20%3Chttp%3A%2F%2Fgoogle.com%7Ca%20link%3E%22%7D
Maybe there should be a boolean encode() option on a message object and in the reply method?