Giter VIP home page Giter VIP logo

Comments (4)

tmsrjs avatar tmsrjs commented on June 30, 2024

It seems that SlackRubyBot::Client#owner is used inside the sample_app to log team info (team_id, name and domain), but this info is already present in SlackRubyBot::Client#team.
I think we can safely remove the monkey patch and modify the sample_app to pull this info from SlackRubyBot::Client#team.
What do you think?

from slack-ruby-bot-server.

dblock avatar dblock commented on June 30, 2024

Possibly, but in most projects you need the actual stored team record with the token (the owner), not info about it after the client boots (which is what is stored as team), or some way to retrieve it, especially on restart. Check out how it's used in say https://github.com/dblock/slack-market.

from slack-ruby-bot-server.

tmsrjs avatar tmsrjs commented on June 30, 2024

Maybe I'm missing something, but couldn't we just Team.find_by(team_id: client.team.id) lazily when needed? The only scenario I think this could be a problem is if the same mongodb is used to store info for more than one slack-ruby-bot-server and more than one of those bots is added to the same team, but that sounds like bad design anyway.

from slack-ruby-bot-server.

dblock avatar dblock commented on June 30, 2024

Isn't there a chicken-and-egg problem of knowing client.team.id? I am probably wrong, so as long as we can make it work, amen :)

from slack-ruby-bot-server.

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.