Skip to content
This repository has been archived by the owner on Apr 11, 2020. It is now read-only.

Cannot use call command #27

Open
sb8244 opened this issue Dec 24, 2016 · 0 comments
Open

Cannot use call command #27

sb8244 opened this issue Dec 24, 2016 · 0 comments

Comments

@sb8244
Copy link

sb8244 commented Dec 24, 2016

I am trying to use https://github.com/exciting-io/slack-bot-server/blob/master/lib/slack_bot_server/remote_control.rb#L57. My invocation looks like:

server.call(key, 'users.list', [])

When process_instruction handles this, the following occurs:

    1: class SlackBotServer::Server
    2:   def process_instruction(instruction)
 => 3:     binding.pry
    4:     type, *args = instruction
    5:     bot_key = args.shift
    6:     if type.to_sym == :add_bot
    7:       log "adding bot: #{bot_key} #{args.inspect}"
    8:       add_bot(bot_key, *args)

[1] pry(#<SlackBotServer::Server>)> instruction
=> ["call", ["XXX", "users.list", []]]
[2] pry(#<SlackBotServer::Server>)> type, *args = instruction
=> ["call", ["XXX", "users.list", []]]
[3] pry(#<SlackBotServer::Server>)> args
=> [["XXX", "users.list", []]]
[4] pry(#<SlackBotServer::Server>)> args.shift
=> ["XXX", "users.list", []]

The entire array content is being used for bot_key rather than just the key part of it. The call command fails due to this.

I'm using ruby 2.3.1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant