diff --git a/blossom/api/slack/commands/__init__.py b/blossom/api/slack/commands/__init__.py index 950e860..5f4e0f2 100644 --- a/blossom/api/slack/commands/__init__.py +++ b/blossom/api/slack/commands/__init__.py @@ -70,9 +70,10 @@ def process_command(data: Dict) -> None: "watchlist": watchlist_cmd, "watchstatus": watchstatus_cmd, "unclaim": unclaim_cmd, + } + modal_options = { "submissions": submissions_cmd, } - tokens = message.split() if len(tokens) > 0: @@ -83,5 +84,10 @@ def process_command(data: Dict) -> None: options[key](channel, message) return + for key in modal_options.keys(): + # modals require different data to work + if cmd_name == key: + modal_options[key](data) + # if we fall through here, we got a message that we don't understand. client.chat_postMessage(channel=channel, text=i18n["slack"]["errors"]["unknown_request"]) diff --git a/blossom/api/slack/commands/list_submissions.py b/blossom/api/slack/commands/list_submissions.py index a090d61..e253d89 100644 --- a/blossom/api/slack/commands/list_submissions.py +++ b/blossom/api/slack/commands/list_submissions.py @@ -183,6 +183,6 @@ def process_submission_list(data: dict) -> None: ) -def submissions_cmd(channel: str, _message: str) -> None: +def submissions_cmd(slack_data: dict) -> None: """Get information from a date range about submissions of a user.""" - client.views_open(trigger_id=str(uuid4()), view=_build_message()) + client.views_open(trigger_id=slack_data.get("trigger_id"), view=_build_message())