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

Development of Slack mixins #355

Open
Ashex opened this issue May 23, 2018 · 1 comment
Open

Development of Slack mixins #355

Ashex opened this issue May 23, 2018 · 1 comment

Comments

@Ashex
Copy link
Collaborator

Ashex commented May 23, 2018

I'm migrating our will bot over to Slack and have been fumbling with some difficulties regarding mixins. They presently don't exist for slack which means that channel and handle lookups prove to be a bit difficult and I'm currently relying on looking them up via the storage backend like so:

    def get_handle(self, id):
        people_cache = self.load('slack_people_cache', {})
        for k, c in people_cache.items():
            if id in c.mention_handle:
                return c.handle

I'm happy to contribute towards one but it's not immediately clear to me on how I should go about implementing a Slack mixin.

@skoczen
Copy link
Owner

skoczen commented Jun 6, 2018

Hey,

So, great question, and I'm really glad to see things like this coming up. Broadly, I'd say I see this happening two ways:

  1. With a mixin, similar to how it was, so we'd see self.people in the WillPlugin methods, or
  2. Exposing the lookup through the message object message.backend.people.

Since we're now living in a world where a given message might come from multiple backends (and trying to encourage plugin patterns that allow people to switch messaging backends with as little cost as possible), I'm inclined toward something in the vein of #2.

What're your thoughts?

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

No branches or pull requests

2 participants