简体   繁体   中英

Post message via slack api with file attachment

I am trying to use Python SDK to post a file to Slack. However, I am also trying to mention some people with @ in the uploaded message.

I am trying this code:

import os
import slack
client = slack.WebClient(token='xoxp-asksjdfj')
res = client.files_upload(channels='#uploads', file='a.txt', title='@john')

However, the title doesn't show up as a mention. Is there a way to do that ? Thanks

与其将您的提及放在titleinitial_comment将其放在initial_comment

res = client.files_upload(channels='#uploads', file='a.txt', initial_comment='@john')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM