Don't monkey-patch SlackRubyBot::Client
https://github.com/dblock/slack-ruby-bot-server/blob/master/lib/slack-ruby-bot-server/ext/slack-ruby-bot/client.rb contains a monkey patch that adds a client field to SlackRubyBot::Client. That shouldn't be necessary, the client instantiated should be a child of SlackRubyBot::Client.
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?
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.
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.
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 :)