Skip to content

Commit

Permalink
Add bot_id to SquarebotSlackMessageValue
Browse files Browse the repository at this point in the history
This makes the bot_id from bot-sent messages more accessible to
Squarebot consumers.
  • Loading branch information
jonathansick committed Sep 19, 2024
1 parent 7b7370c commit 068cef9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion changelog.d/20240919_190157_jsick_DM_46413.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

### New features

-
- Added `SquarebotSlackMessageValue.bot_id` to capture the ID of the app that send a bot message.

### Bug fixes

Expand Down
9 changes: 9 additions & 0 deletions client/src/rubin/squarebot/models/kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ class SquarebotSlackMessageValue(BaseModel):
),
)

bot_id: str | None = Field(
None,
description=(
"The ID of the Slack App integration that sent the message. This "
"is null for non-bot messages."
),
)

ts: str = Field(
...,
description=(
Expand Down Expand Up @@ -152,6 +160,7 @@ def from_event(cls, event: SlackMessageEvent, raw: dict[str, Any]) -> Self:
channel=event.event.channel,
channel_type=event.event.channel_type,
user=event.event.user,
bot_id=event.event.bot_id,
ts=event.event.ts,
thread_ts=event.event.thread_ts,
text=event.event.combined_text_content,
Expand Down

0 comments on commit 068cef9

Please sign in to comment.