rampatra / jbot

Make Slack and Facebook Bots in Java.
GNU General Public License v3.0
1.2k stars 352 forks source link

How to publicly distribute a JBot #173

Open ChrisBrumfitt01 opened 4 years ago

ChrisBrumfitt01 commented 4 years ago

Hi,

I don't see how you would go about making a JBot publicly distributable? Would really appreciate some help.

I have added a redirect /authorization REST endpoint to the JBot project - when someone clicks on the "Add to slack" button which I have generated, this is the endpoint that gets called, which in turn calls https://slack.com/api/oauth.v2.access to get an access token - I'm doing this part successfully.

Looking at the SlackBot.java - it reads in the ${slackBotToken} from the properties file. But how can I get it to use the above mentioned access token instead?

Will I need to create a new instance of SlackBot each time it is distributed to a new user? With each instance storing a different access token? But it looks impossible to set the token before the @PostConstruct method in Bot.java runs...

Thanks