Skip to content

Commit 8752dfc

Browse files
committed
refactor: remove commented event handlers
1 parent 0f19ab1 commit 8752dfc

7 files changed

Lines changed: 4 additions & 288 deletions

File tree

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ black .
7676

7777
Every incoming request is routed to a "listener". This directory groups each listener based on the Slack Platform feature used, so `/listeners/events` handles incoming events, `/listeners/shortcuts` would handle incoming [Shortcuts](https://docs.slack.dev/interactivity/implementing-shortcuts/) requests, and so on.
7878

79-
> [!NOTE]
80-
> The `listeners/events` folder is purely educational and demonstrates alternative approaches to implementation. These listeners are **not registered** and are not used in the actual application. For the working implementation, refer to `listeners/assistant/assistant.py`.
81-
8279
**`/listeners/assistant`**
8380

8481
Configures the new Slack Assistant features, providing a dedicated side panel UI for users to interact with the AI chatbot. This module includes:

listeners/events/__init__.py

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,6 @@
1-
# This sample app repository contains event listener code to help developers understand what's happening under the hood.
2-
# We recommend using assistant middleware instead of these event listeners.
3-
# For more details, refer to https://tools.slack.dev/bolt-python/concepts/assistant/.
4-
5-
# from typing import Dict, Any
6-
71
from slack_bolt import App
8-
9-
# from slack_bolt.request.payload_utils import is_event
10-
11-
# from .assistant_thread_started import start_thread_with_suggested_prompts
12-
# from .asssistant_thread_context_changed import save_new_thread_context
13-
# from .user_message import respond_to_user_message
14-
from .assistant_mentioned import assistant_mentioned_callback
2+
from .app_mentioned import app_mentioned_callback
153

164

175
def register(app: App):
18-
app.event("app_mention")(assistant_mentioned_callback)
19-
20-
21-
# app.event("assistant_thread_started")(start_thread_with_suggested_prompts)
22-
# app.event("assistant_thread_context_changed")(save_new_thread_context)
23-
# app.event("message", matchers=[is_user_message_event_in_assistant_thread])(respond_to_user_message)
24-
# app.event("message", matchers=[is_message_event_in_assistant_thread])(just_ack)
25-
26-
27-
# def is_message_event_in_assistant_thread(body: Dict[str, Any]) -> bool:
28-
# if is_event(body):
29-
# return body["event"]["type"] == "message" and body["event"].get("channel_type") == "im"
30-
# return False
31-
32-
33-
# def is_user_message_event_in_assistant_thread(body: Dict[str, Any]) -> bool:
34-
# return is_message_event_in_assistant_thread(body) and body["event"].get("subtype") in (None, "file_share")
35-
36-
37-
# def just_ack():
38-
# pass
6+
app.event("app_mention")(app_mentioned_callback)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"""
1515

1616

17-
def assistant_mentioned_callback(
18-
client: WebClient, event: dict, get_thread_context: GetThreadContext, logger: Logger, say: Say
17+
def app_mentioned_callback(
18+
client: WebClient, event: dict, logger: Logger, say: Say
1919
):
2020
try:
2121

listeners/events/assistant_thread_started.py

Lines changed: 0 additions & 68 deletions
This file was deleted.

listeners/events/asssistant_thread_context_changed.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

listeners/events/thread_context_store.py

Lines changed: 0 additions & 66 deletions
This file was deleted.

listeners/events/user_message.py

Lines changed: 0 additions & 92 deletions
This file was deleted.

0 commit comments

Comments
 (0)