I think you are misunderstanding the problem. People here are not talking about adding an emoticon to some text BUT posting "some text" and using an emoticon as the ICON displayed next to their username...
you need to change this in your slackr and slackr_msg functions:
According to the slack api documentation (https://api.slack.com/methods/chat.postMessage), icon_emoji and username parameters are ignored if as_user is TRUE. You simply need to change
I think you are misunderstanding the problem. People here are not talking about adding an emoticon to some text BUT posting "some text" and using an emoticon as the ICON displayed next to their username...
you need to change this in your slackr and slackr_msg functions: According to the slack api documentation (https://api.slack.com/methods/chat.postMessage), icon_emoji and username parameters are ignored if as_user is TRUE. You simply need to change
resp <- POST(url="https://slack.com/api/chat.postMessage", body=list(token=api_token, channel=slackr_chtrans(channel), username=username, icon_emoji=icon_emoji, text=output, as_user=TRUE, link_names=1, ...))
to: resp <- POST(url="https://slack.com/api/chat.postMessage", body=list(token=api_token, channel=slackr_chtrans(channel), username=username, icon_emoji=icon_emoji, text=output, as_user=FALSE, link_names=1, ...))
and these functions will actually change icon_emoji and username as expected