Skip to main content
 首页 » 编程设计

python之Slack API 上传片段长度

2025年02月15日9txw1958

我的片段被截断为几百行。这是我用来上传它们的代码

 self.client.api_call( 
     'files.upload', 
     channels=channel_id, 
     content=msg, 
     as_user='true:', 
     filetype=filetype, 
     filename=filename 
 ) 

我还需要设置哪些其他参数才能发布整个代码段?

请您参考如下方法:

没有。此限制由 Slack API 对 files.upload 方法强加。

引自documentation :

There is a 1 megabyte file size limit for files uploaded as snippets.