Skip to content

Unable to send messages unless removed then re-invited #231

Open
@Rodeoclash

Description

@Rodeoclash

Apologies if this is something intrinsic to the way that Slack works and is not the fault of this library.

I've have some unusual behaviour that means I can only send a message if:

  1. The bot is connected
  2. The bot is invited to the channel within its "session".
  3. The bot maintains its current "session", that is, I cannot restart the server, without requiring the bot to removed and invited again to the test channel.

Currently as I right this, I have a work implementation and can send a hello world message using the example code from the Readme in my REPL. The bot is currently connected to its private test channel that I am using and I see the messages appearing fine.

If I restart iex using ctrl-c then start it again (iex -S mix) I see that the bot connects successfully (the handle_connect). However, if I send a message then I get the error: 12:20:41.848 [error] channel #bot-test not found.

If I remove the bot from the channel then re-invite the bot again, the correct behaviour is restored and I'm able to send messages once more (this is while maintaining the same iex session where it was previously failing) so something about removing then inviting the bot again seems to make things work again.

I'm a bit concerned that deployments are doing to be difficult as I'm not planning on using code reloading and instead just running everything in a Docker container. I assume this will suffer the same issues that I've described above.

Am I missing something when establishing my initial connection (or in general about how Slack bots work)? I'm happy to add something to the documentation in a PR to make this easier for the next developer once I understand what's going.

Please let me know what debugging would be useful if this is not a PEBCAK.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions