我正在构建一个简单的机器人来定期生成图表作为图像并通过 python slackclient包发布到 slack 。我已经设法使用以下代码发送机器人消息:def post_message_to_channel(self, channel_id, message=DEFAULT_TEST_MESSAGE):    sc = SlackClient(TOKEN)    sc.api_call(        "chat.postMessage",        channel=channel_id,        username='mybot',        text='test text message'    )但是当我尝试对文件上传做同样的事情时,图像被正确发送,但它显示了我的名字,而不是指定的机器人名称:def post_image_to_channel(self, channel_name, filepath, tile='Test Upload'):    sc = SlackClient(TOKEN)    with open(filepath, 'rb') as file_content:        sc.api_call(                "files.upload",                channels=channel_id,                file=file_content,                title=tile,                username='mybot',                           )查看files.upload的 slack API 文档,似乎username不可用。如何使用机器人名称发送files.upload图像?
                    
                    
                添加回答
举报
0/150
	提交
		取消
	
