BlakeWilliams / Elixir-Slack

Slack real time messaging and web API client in Elixir
MIT License
675 stars 182 forks source link

bots key not coming back in first api response #201

Closed NorthIsUp closed 5 years ago

NorthIsUp commented 5 years ago
01:00:21.605 [info]  Application mybot exited: exited in: mybot.Application.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (MatchError) no match of right hand side value: {:error, {{:badkey, :bots, %{ok: true, self: %{id: "xxxxxx", name: "adambot"}, team: %{domain: "MyApp", id: "xxxxxx", name: "MyApp"}, url: "wss://xxxxxxx"}}, [{Slack.Bot, :init, 1, [file: 'lib/slack/bot.ex', line: 91]}, {:websocket_client, :init, 1, [file: '/app/mybot/deps/websocket_client/src/websocket_client.erl', line: 164]}, {:gen_fsm, :init_it, 6, [file: 'gen_fsm.erl', line: 351]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}}
            (slack) lib/slack/bot.ex:51: Slack.Bot.start_link/4
            (mybot) lib/mybot/application.ex:15: mybot.Application.start/2
            (kernel) application_master.erl:277: :application_master.start_it_old/4

it seems that the library is expecting a map of bots but is instead getting nothing. maybe a missing scope?

This is the structure that it is getting

rtm = %{
    ok: true,
    self: %{id: "xxxxxx", name: "adambot"},
    team: %{domain: "MyApp", id: "xxxxxx", name: "MyApp"},
    url: "wss://xxxxxxx"}
}
NorthIsUp commented 5 years ago

looks like a dupe of #181