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

Sending files on slack #28

Open
muasir opened this issue Jan 2, 2017 · 7 comments
Open

Sending files on slack #28

muasir opened this issue Jan 2, 2017 · 7 comments
Assignees

Comments

@muasir
Copy link

muasir commented Jan 2, 2017

Do you have an example for sending files (like pdf) over slack.

@rampatra
Copy link
Owner

rampatra commented Jan 3, 2017

Currently, Jbot supports Slack's RTM API, Slash Commands and webhooks and I don't think RTM API has upload file capability. The Slack web API do have.

@rampatra
Copy link
Owner

rampatra commented Jan 3, 2017

You can write a POST call using the files.upload Slack web API in SlackService.java and use it in your bot. If you add one on your fork then you can raise a PR on github if you want.

@rampatra rampatra self-assigned this Jan 3, 2017
@laxman954
Copy link

laxman954 commented Feb 15, 2017

@ramswaroop I didn't get it, can u explain how to send a file as Reply message for particular user.

Because if i am using files.upload to upload the file, the file is private without channel.

How i can send reply message as File by bot

@mndominguez
Copy link

mndominguez commented Aug 24, 2017

@laxman954 I'm using the Meteoroid library to post files to Slack:

public void postFileToSlack(Event event, File file) throws IOException {
        okhttp3.Response response = new Meteoroid.Builder()
                .token("YOUR-TOKEN")
                .channels(event.getChannelId())
                .uploadFile(file)
                .build()
                .post();

        response.close();
    }

You get the channel from the Event object, and if the conversation started in a private conversation, then that's what the channelId is going to be.

@Elfilali-Taoufiq
Copy link

Hii, is there some update about the upload of files? thanks

@Elfilali-Taoufiq
Copy link

I'm trying to import Meteoroid library using maven but the dependecy generate an error

@pkatre2
Copy link

pkatre2 commented Oct 23, 2021

can you please assign it to me , would like to contribute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants