migrated all pawprint work

This commit is contained in:
buenosairesam
2025-12-31 08:34:18 -03:00
parent fc63e9010c
commit 680969ca42
63 changed files with 4687 additions and 5 deletions

View File

@@ -0,0 +1,30 @@
"""
Slack connection client using slack_sdk.
"""
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
class SlackClientError(Exception):
pass
def get_client(token: str) -> WebClient:
"""Create a Slack WebClient with the given token."""
return WebClient(token=token)
def test_auth(client: WebClient) -> dict:
"""Test authentication and return user/bot info."""
try:
response = client.auth_test()
return {
"ok": response["ok"],
"user": response.get("user"),
"user_id": response.get("user_id"),
"team": response.get("team"),
"team_id": response.get("team_id"),
}
except SlackApiError as e:
raise SlackClientError(f"Auth failed: {e.response['error']}")