Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot is not updating session #85

Open
Bassov opened this issue Nov 27, 2017 · 2 comments
Open

Bot is not updating session #85

Bassov opened this issue Nov 27, 2017 · 2 comments

Comments

@Bassov
Copy link

Bassov commented Nov 27, 2017

Currently it is possible to get information about teams/users/channels using session. But the problem is that it is not updating when something happens.

For example, consider a bot which logic is based on group members. In this case there could be some problems, when someone joined a channel or left it.

Possible solution is to implement some basic bot, that can update own session when something relative happens. And add some way of extension of that bot to let users write custom event handlers.

@mpickering
Copy link
Collaborator

You can implement a handler which does update the state and it would be a useful addition to the library but I didn't have the motivation to write it when I first released the bindings.

@asayers
Copy link
Collaborator

asayers commented Nov 28, 2017

The docs in the latest (unreleased) version make the current behaviour clearer:

-- | When the connection is established, the slack server sends a bunch of
-- session information. This is accessible here.
--
-- (Caveat: this information represents things as they were when the
-- session was established; it is liable to become stale. If you care about
-- keeping an up-to-date view of this stuff, you need to track changes to
-- it using 'getNextEvent'.)

The current expectation is that users will maintain their own copy of SlackSession (or relevant parts) and keep it up-to-date manually. It would be convenient for slack-api to provide this functionality, however.

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

No branches or pull requests

3 participants