Coder Social home page Coder Social logo

Comments (11)

thatside avatar thatside commented on August 24, 2024

Sorry, seems there is another problem - this package is currently incompatible with Slack App-integrated bots.
Was too impatient to try the package :)
Closing the issue now.
Hope it will support Slack apps soon - AFAIK Slack team recommends this way.

from slack-machine.

DonDebonair avatar DonDebonair commented on August 24, 2024

Hi! I want to support your use case, but I'm not sure exactly what you want/need.
How do "Slack App-integrated bots" differ from bots you register through https://my.slack.com/services/new/bot ?

Even though I didn't advertise this package yet, it should be useable. I'm using it in production myself :)

from slack-machine.

thatside avatar thatside commented on August 24, 2024

Hello!
As stated here: https://api.slack.com/bot-users: every workspace (team) could have custom integration among which bot users go. But bots which could be used by other teams (theoritically :)) should be attached to Slack app itself and then they could be used by all teams who have the app installed.
So you should create an app here first: https://api.slack.com/apps. And then you could register a bot user for this app.
This isn't critical for me - I'm developing a simple app for my team but it would be more convenient in future to be able to use both token types (AFAIK simple bot token starts with xoxb and app token starts with xoxp).

I've found the package on pypi using search - it has high "search weight" so I wanted to find an alternative of using simple web server with slash commands for interaction :)

from slack-machine.

DonDebonair avatar DonDebonair commented on August 24, 2024

Interesting concept. I had heard about Slack apps, and even installed a couple for my own teams. But I've not looked closely into how Slack apps work from the technical perspective.

But bots which could be used by other teams (theoritically :)) should be attached to Slack app itself and then they could be used by all teams who have the app installed.

This technically means that the bot should be able to handle multiple teams, right? This is currently not the case for Slack Machine. It uses Slack's own Python Slack client, which - as far as I can tell - assumes it is connected to 1 team only.

from slack-machine.

thatside avatar thatside commented on August 24, 2024

I've checked slackclient package and it doesn't seems it could handle only one team at the given moment - neither it isn't said it could handle multiple teams. Should check this in future.

Nevertheless my initial problem was solved and I think it is more important to develop other features than add support of multi-team applications :)

from slack-machine.

DonDebonair avatar DonDebonair commented on August 24, 2024

Agreed. Multi-team/App support are currently out of scope. I did find an example from Slack itself on how to build a Slack App in Python: https://github.com/slackapi/Slack-Python-Onboarding-Tutorial. But that example doesn't seem to support multiple teams.

If Slack Machine were to support being installed as a Slack App, it would have to implement the OAuth flow, and with that, it would have to run a web server (like Flask) to be accessible from the outside. I actually like the fact that currently, it doesn't need to be accessible from the outside (except for the websocket connection of course), so it can be run behind a firewall and doesn't have to expose a web server.

I'll leave it alone for now :)

If I may ask though, how did you solve your issue?

from slack-machine.

DonDebonair avatar DonDebonair commented on August 24, 2024

Update: what's interesting, is that Hubot also doesn't support multiple teams as far as I can tell. And when you install the Hubot Slack App, it will give you an xoxb token:

(don't worry, the integration was removed, so the token is invalid)

So apparently, you can create Slack apps that do not use OAuth?

from slack-machine.

thatside avatar thatside commented on August 24, 2024

If I may ask though, how did you solve your issue?
I have created a separate bot user - first I have used the token from Slack App and it doesn't work but with separate bot token (from the link you have provided) everything worked perfectly.

Hubot seems to be a slightly different thing - it seems it only provides an adapter to generate a bot token in more convenient way.

At least it is needed to check if it is possible to use app bot tokens (and how to implement this if not possible) - for example, if somebody would try to implement OAuth part on their side and then start the machine with tokens received from team admin.
I'll check this out when I'll have my free time :)

from slack-machine.

DonDebonair avatar DonDebonair commented on August 24, 2024

Apparently Slack supports apps for Single Teams. That is kinda the way the Hubot App works. In the case of Hubot, you still have to run your own instance of Hubot, and the Hubot Slack App just provides you with a token easily (as you said). The caveat is that the Hubot App is a "special case", in that it only gives you 1 token, whereas "regular" Slack Apps with Bot Integration enabled, give you 2 tokens, a bot token and a regular OAuth token. This can lead to problems

Anyways, glad you worked out a solution. If you use Slack Machine, I'd interested in your experience and what features are missing for you at the moment (if any) :)

from slack-machine.

thatside avatar thatside commented on August 24, 2024

I am going to develop a simple bookmark-like app (to store useful links for channels like Hangouts app does) so I will definitely try it out soon :)

from slack-machine.

DonDebonair avatar DonDebonair commented on August 24, 2024

Cool! If it works out for you with Slack Machine, we could try and make a plugin out of your bookmark app (if you want, of course)

from slack-machine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.