Skip to content

Commit f00df7d

Browse files
committed
refactor: remove unused parameters from listeners
1 parent 256ab90 commit f00df7d

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

listeners/assistant/assistant_thread_started.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55

66
def assistant_thread_started(
7-
say: Say,
87
agent: BoltAgent,
98
logger: Logger,
9+
say: Say,
1010
):
1111
"""
1212
Handle the assistant thread start event by greeting the user and setting suggested prompts.

listeners/assistant/message.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from logging import Logger
33

44
from openai.types.responses import ResponseInputParam
5-
from slack_bolt import BoltAgent, BoltContext, Say
5+
from slack_bolt import BoltAgent, Say
66
from slack_sdk.models.messages.chunk import (
77
MarkdownTextChunk,
88
PlanUpdateChunk,
@@ -15,29 +15,20 @@
1515

1616
def message(
1717
agent: BoltAgent,
18-
context: BoltContext,
1918
logger: Logger,
2019
message: dict,
21-
payload: dict,
2220
say: Say,
2321
):
2422
"""
2523
Handles when users send messages or select a prompt in an assistant thread and generate AI responses:
2624
2725
Args:
2826
agent: BoltAgent for making API calls
29-
client: Slack WebClient for making API calls
30-
context: Bolt context containing channel and thread information
3127
logger: Logger instance for error tracking
32-
payload: Event payload with message details (channel, user, text, etc.)
28+
message: Dictionary with message information
3329
say: Function to send messages to the thread
3430
"""
3531
try:
36-
channel_id = payload["channel"]
37-
team_id = context.team_id
38-
thread_ts = payload["thread_ts"]
39-
user_id = context.user_id
40-
4132
# The first example shows a message with thinking steps that has different
4233
# chunks to construct and update a plan alongside text outputs.
4334
if message["text"] == "Wonder a few deep thoughts.":

listeners/events/app_mentioned.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,9 @@ def app_mentioned_callback(
2424
say: Function to send messages to the thread from the app
2525
"""
2626
try:
27-
channel_id = event.get("channel")
28-
team_id = event.get("team")
2927
text = event.get("text")
30-
thread_ts = event.get("thread_ts") or event.get("ts")
31-
user_id = event.get("user")
3228

3329
agent.set_status(
34-
channel_id=channel_id,
35-
thread_ts=thread_ts,
3630
status="thinking...",
3731
loading_messages=[
3832
"Teaching the hamsters to type faster…",

0 commit comments

Comments
 (0)