Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Add slack block interactions #33

Merged
merged 3 commits into from
Jun 11, 2019

Conversation

AllenAnthes
Copy link
Contributor

Adds support for Slack's new Block-based interactive messages. (accompanying slack-sansio PR)

Adds on_block and on_dialog_submission methods for registering actions of the corresponding types.

@coveralls
Copy link

coveralls commented May 31, 2019

Coverage Status

Coverage decreased (-0.6%) to 80.682% when pulling d00f807 on AllenAnthes:add-slack-block-interactions into 4904b55 on pyslackers:master.

Copy link
Member

@ovv ovv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a small change and good to go.
The travis failure is due to the new version of isort. Running tox should fix it.
Otherwise the change needed is

--- a/sirbot/plugins/postgres/plugin.py
+++ b/sirbot/plugins/postgres/plugin.py
@@ -1,10 +1,10 @@
 import os
 import logging
 
+import ujson
 import asyncpg
 import aiofiles
 from aiocontext import async_contextmanager
-import ujson
 
 LOG = logging.getLogger(__name__)

Thanks for the PR 👍

@@ -141,20 +141,57 @@ def on_message(
pattern=pattern, handler=(handler, configuration), **kwargs
)

def on_action(self, action, handler, name="*", wait=True):
def on_action(self, callback_id, handler, name="*", wait=True):
Copy link
Member

@ovv ovv Jun 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep action here. Only to not break compatibility

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, true. Wasn't thinking about keyword args.

@ovv ovv merged commit 2dd4795 into pyslackers:master Jun 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants