This might be a simple question, but I can not get it work.
I am using Slack Python Api to mention a user in a channel, and I am referring to the document here, http
After a little bit exploration, I got the solution which is quite simple. I don't know how I could miss it.
message = sc.api_call(
'chat.postMessage',
link_names=1,
channel='#channelname',
text='@someone This is a test.'
)
use the option link_names=1
to link channels or user names automatically in the text message. This will do the trick.
Thank you everyone.