Giter Site home page Giter Site logo

Comments (9)

CanisHelix avatar CanisHelix commented on August 17, 2024 1

Has there been any progress on exposing client? I have a bot running very nicely, but I'd like the ability to have the bot message users after a specific rails api call too. I'm not familiar with the send(:client) hack mentioned above, could someone elaborate a bit?

from slack-ruby-bot.

dblock avatar dblock commented on August 17, 2024

In theory I think there's no harm exposing client, outside of the bot, you might want to test it with .send(:client) and if that works feel free to PR a change. You might want to reach into client.web_client if you need the web one that was used to open the connection in the first place.

Also, generally, I'm interested in expanding slack-ruby-bot with support for web hooks and such, maybe merging parts or all of https://github.com/dblock/slack-bot-server or turning the latter into a framework (see slack-ruby/slack-ruby-bot-server#3).

from slack-ruby-bot.

klaustopher avatar klaustopher commented on August 17, 2024

Ok, good, I thought I was really missing something when looking at the code. The "hack" with send(:client) is what I ended up doing, but it felt so ugly that I had to wash my hands after writing this code 😂

I'll take a look at the referenced issues. I think there's something missing between "Running a bot that only replies to chat" and "Running a full slack integration available to others" ;)

from slack-ruby-bot.

dblock avatar dblock commented on August 17, 2024

@klaustopher I think https://github.com/dblock/slack-ruby-bot-server is the beginning of the answer for the missing link.

from slack-ruby-bot.

klaustopher avatar klaustopher commented on August 17, 2024

@dblock Thanks, this looks good. I'll definitely take a look ;)

from slack-ruby-bot.

dblock avatar dblock commented on August 17, 2024

This is related to https://github.com/dblock/slack-ruby-bot-server/issues/6.

I think we should either expose client as is, or delegate calls to it. Thoughts? PRs?

from slack-ruby-bot.

kstole avatar kstole commented on August 17, 2024

This issue seems to revolve around the same discussion as supporting slash commands and webhooks.

I'm also extremely interested in this and I ran into the same issues as @klaustopher. I was previously using Lita, which includes a built-in web server, but this library is much nicer for working with Slack so it would be nice if it could also include a web server.

I'm not a Ruby expert. @dblock do you think it makes more sense to look into slack-ruby-bot-server or to try the hacky .send(:client)? @klaustopher do you have any sample code you could share for your .send(:client) solution?

from slack-ruby-bot.

dblock avatar dblock commented on August 17, 2024

See my comment above for client, but generally I would like native webhook support in slack-ruby-bot-server.

from slack-ruby-bot.

dblock avatar dblock commented on August 17, 2024

Slash commands and webhooks require a web server. I've released https://github.com/slack-ruby/slack-ruby-bot-server-events that has full support for those.

from slack-ruby-bot.

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.