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

Cannot use call command #27

@sb8244

Description

@sb8244

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions