Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/core/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,12 @@ async def process_slack_events(request: Request) -> dict[str, str]:
)
return ({"status": "success"}, 200)


# Challenge from Bot Authentication
if request.headers.get("content-type") == "application/json":
if body.get("type") == "url_verification":
logger.info("SLACK EVENT: Was a challenge!")
return {"challenge": body.get("challenge")}

if not body:
logger.debug("SLACK EVENT: Was a challenge, with no body")
return {"challenge": body.get("challenge")}

event: dict = body.get("event", {})

if event.get("subtype", None) is not None:
Expand Down Expand Up @@ -272,7 +267,7 @@ async def process_slack_message_actions(payload: str):
user_id = form_json.get("user", {}).get("id")

username: str = await get_username(user_id)
username = username[:40]
username = username[:40] # Only get the first 40 characters so it fits on a single line

add_announcement(message_object, username)

Expand Down
Loading