Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for uploading files #56

Closed
wants to merge 1 commit into from

Conversation

alexkwolfe
Copy link

I rebased #22 on master and fixed up a few of the issues mentioned in that PR.

Also of note is that file uploading is now done with a multipart request. I'm allowing the caller to override the token param, which is essential for performing a file upload from a bot. Bots cannot do file uploads so a real user's API token must be provided.

# Here's what a createFile call looks like
client.createFile file: '/home/user/smiley.png', token: 'xxxx-xxxxxxxx-xxxxxxxx', channels:'panic room', (result) ->
  console.log(result)

I'm looking for feedback on this PR and am happy to make adjustments, etc.

@meteormanaged
Copy link

any hope in getting this merged?

@Tehnix
Copy link

Tehnix commented Oct 14, 2015

This would be awesome to have support for! Any updates on what is missing, if anything is?

@meteormanaged
Copy link

sry. wrong post.

@SJAnderson
Copy link

any word on this getting merged?

@halkeye
Copy link

halkeye commented Feb 6, 2016

@alexkwolfe do you have time to fix the merge conflicts? I want to start nudging people for this again but it seems like its no longer a clean merge. If you don't have time, lemme know and I'll take a stab.

@jeffclyne
Copy link

I'd love to see this merged as well so slackapi/hubot-slack#62 can proceed.

@ghost
Copy link

ghost commented Feb 21, 2016

Can you link me to the hubot issue where that's discussed?

Right now, you can upload files via something like:

webClient.files.upload({
  file: ...,
  channels: ['...'],
});

The way the PR is currently structured would need to be changed around quite a bit, as the pattern of mixing the model objects with API actions (e.g. file.setComments) isn't one the >= 2.0.x client is going to support.

So, if the issue is the general one of getting an API call to use to upload files, that's pretty simple and I can add a full example to the /examples directory later today. If the richer support around file comments etc is needed, that'll take a while longer.

@jeffclyne
Copy link

I think the issue is just having an API call to use to upload files, so the hubot-slack adapter can provide the hook for scripts to utilize.

@ghost
Copy link

ghost commented Feb 22, 2016

Gotcha. I'll write up a proper example this week. Thanks for the clarification.

@crookedneighbor
Copy link
Contributor

Is this PR needed any more? I see an example for how to upload files in the example directory.

@DEGoodmanWilson
Copy link

I'm going to assume not—I'll open an issue to track this should it turn out that uploading files on 3.x isn't working so hot.

aoberoi pushed a commit to aoberoi/node-slack-sdk that referenced this pull request Mar 20, 2019
Support validation of message_action
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants