{"id":23731058,"url":"https://github.com/pramithamj/slack-sdk-go","last_synced_at":"2026-04-28T00:32:15.246Z","repository":{"id":280755702,"uuid":"909466529","full_name":"PramithaMJ/slack-sdk-go","owner":"PramithaMJ","description":"A lightweight and modular SDK for building Slack bots and apps in Go. With this SDK, you can easily send messages, manage users, and extend functionality to integrate with the Slack API seamlessly.","archived":false,"fork":false,"pushed_at":"2025-04-03T21:33:50.000Z","size":61,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-19T10:46:38.934Z","etag":null,"topics":["go","sdk","slack"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/pramithamj/slack-sdk-go@v1.0.0#section-readme","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PramithaMJ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["pramithamj"],"custom":["https://buymeacoffee.com/lpramithamm","https://pramithamj.me/"]}},"created_at":"2024-12-28T19:38:22.000Z","updated_at":"2025-04-03T21:33:53.000Z","dependencies_parsed_at":"2025-05-26T09:33:32.008Z","dependency_job_id":null,"html_url":"https://github.com/PramithaMJ/slack-sdk-go","commit_stats":null,"previous_names":["pramithamj/slack-sdk-go"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/PramithaMJ/slack-sdk-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PramithaMJ%2Fslack-sdk-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PramithaMJ%2Fslack-sdk-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PramithaMJ%2Fslack-sdk-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PramithaMJ%2Fslack-sdk-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PramithaMJ","download_url":"https://codeload.github.com/PramithaMJ/slack-sdk-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PramithaMJ%2Fslack-sdk-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32361477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","sdk","slack"],"created_at":"2024-12-31T03:16:34.860Z","updated_at":"2026-04-28T00:32:15.241Z","avatar_url":"https://github.com/PramithaMJ.png","language":"Go","funding_links":["https://github.com/sponsors/pramithamj","https://buymeacoffee.com/lpramithamm","https://pramithamj.me/"],"categories":[],"sub_categories":[],"readme":"# 🚀 Slack SDK for Go\n\n[![Go](https://github.com/PramithaMJ/slack-sdk-go/workflows/Go/badge.svg)](https://github.com/PramithaMJ/slack-sdk-go/actions/workflows/go.yml)\n[![CI](https://github.com/PramithaMJ/slack-sdk-go/workflows/CI/badge.svg)](https://github.com/PramithaMJ/slack-sdk-go/actions/workflows/main.yml)\n[![Publish Package](https://github.com/PramithaMJ/slack-sdk-go/actions/workflows/publish.yml/badge.svg)](https://github.com/PramithaMJ/slack-sdk-go/actions/workflows/publish.yml)\n\nA **lightweight** and **modular** SDK for building Slack bots and apps in **Go**. With this SDK, you can easily send messages with Block Kit support, manage users, and extend functionality to integrate with the Slack API seamlessly.\n\n*Last Updated: March 6, 2025*\n\n---\n\n### 🌟 Features  \n\n- 📨 **Send messages** to Slack channels with Block Kit support\n- 🎨 **Rich formatting** using Block Kit components\n- 👤 **Fetch user information**\n- ⚡️ **Extendable** for additional Slack APIs\n- 🧩 **Lightweight** and modular design\n- 🎯 **Easy integration** into Go projects\n\n---\n\n### 🛠 Getting Started  \n\n#### ✅ Prerequisites  \n\n- **Go** 1.18 or later  \n- A **Slack Bot Token** with the required permissions.  \n  \u003e [Create a Slack App](https://api.slack.com/apps) to generate your token.  \n\n#### 📦 Installation  \n\nAdd the SDK to your project using:  \n\n```sh  \ngo get github.com/pramithamj/slack-sdk-go/pkg/slack  \n```\n✨ Example Usage\n\nHere’s a quick example to send a message using the SDK:\n```go\npackage main  \n\nimport (  \n\t\"fmt\"  \n\t\"log\"  \n\n\t\"github.com/pramithamj/slack-sdk-go/pkg/slack\"  \n)  \n\nfunc main() {  \n\t// Replace with your actual Slack Bot Token  \n\ttoken := \"xoxb-your-slack-bot-token\"  \n\tsdk := slack.NewSlackSDK(token)  \n\n\tchannel := \"C123456789\" // Slack channel ID  \n\tmessage := \"Hello, Slack from Go SDK!\"  \n\n\tresponse, err := sdk.SendMessage(channel, message)  \n\tif err != nil {  \n\t\tlog.Fatalf(\"Error sending message: %v\", err)  \n\t}  \n\n\tfmt.Printf(\"Message sent successfully: %v\\n\", response)  \n}  \n```\n#### 📖 API Methods\n\n1️⃣ SendMessage\n\nSend a message to a Slack channel.\n\n📥 Parameters:\n\t•\tchannel (string): The channel ID where the message will be sent.\n\t•\ttext (string): The message text.\n\n📤 Example:\n```go\nresponse, err := sdk.SendMessage(\"C123456789\", \"Hello, Slack!\")  \nif err != nil {  \n\tlog.Fatalf(\"Error: %v\", err)  \n}  \nfmt.Println(response)  \n```\n\n2️⃣ GetUserInfo\n\nFetch details about a Slack user.\n\n📥 Parameters:\n\t•\tuserID (string): The ID of the user.\n\n📤 Example:\n```go\nresponse, err := sdk.GetUserInfo(\"U123456789\")  \nif err != nil {  \n\tlog.Fatalf(\"Error: %v\", err)  \n}  \nfmt.Println(response)  \n```\n#### 🔍 Testing\n\nRun all tests using:\n\ngo test ./tests/...  \n\n#### 🤝 Contributing\n\nWe welcome contributions! To contribute:\n\t1.\tFork the repository\n\t2.\tCreate a new branch: git checkout -b feature-name\n\t3.\tCommit your changes: git commit -m 'Add feature'\n\t4.\tPush the branch: git push origin feature-name\n\t5.\tOpen a Pull Request\n\n#### 📜 License\n\nThis project is licensed under the MIT License. See the LICENSE file for more details.\n\n👤 Author\n\nPramithaMJ\n\t•\t💻 [PramithaMJ]](https://github.com/pramithamj)\n\t•\t📧 lpramithamj@gmail.com\n\n---\n\n# Slack SDK for Go 🚀\n\nA powerful and flexible Go SDK for interacting with the Slack API, providing a simple yet comprehensive interface for sending messages and managing Slack communications.\n\n## Features ✨\n\n- 📝 Simple and rich message support\n- 🧵 Thread reply functionality\n- 🔄 Automatic retries with configurable attempts\n- ⏱️ Context support for timeouts and cancellation\n- 🎯 Custom error types and proper error handling\n- 🔐 Secure configuration via environment variables\n- 📦 Block kit and message attachments support\n\n## Installation 📥\n\n```bash\ngo get github.com/pramithamj/slack-go-sdk\n```\n\n## Quick Start 🚀\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"log\"\n    \"os\"\n    \"time\"\n\n    \"github.com/pramithamj/slack-go-sdk/pkg/slack\"\n)\n\nfunc main() {\n    // Get token from environment\n    token := os.Getenv(\"SLACK_BOT_TOKEN\")\n    if token == \"\" {\n        log.Fatal(\"SLACK_BOT_TOKEN is required\")\n    }\n\n    // Initialize SDK\n    sdk := slack.NewSlackSDK(token)\n\n    // Send a message\n    ctx := context.Background()\n    response, err := sdk.SendMessage(ctx, \"CHANNEL_ID\", \"Hello from Go SDK!\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    log.Printf(\"Message sent: %v\", response)\n}\n```\n\n## Advanced Usage 🔧\n\n### Custom Configuration\n\n```go\nsdk := slack.NewSlackSDKWithConfig(slack.Config{\n    Token:         token,\n    BaseURL:       \"https://slack.com/api/\",\n    Timeout:       10 * time.Second,\n    RetryAttempts: 2,\n    RetryWaitTime: time.Second,\n})\n```\n\n### Rich Messages with Blocks\n\n```go\nrichMessage := slack.MessagePayload{\n    Channel: channelID,\n    Blocks: []slack.Block{\n        {\n            Type: \"section\",\n            Text: \u0026slack.TextObject{\n                Type: \"mrkdwn\",\n                Text: \"*Hello!*\\nThis is a rich message.\",\n            },\n        },\n    },\n}\n\nresponse, err := sdk.SendRichMessage(ctx, richMessage)\n```\n\n### Thread Replies\n\n```go\nresponse, err := sdk.SendThreadReply(ctx, channelID, threadTS, \"This is a reply!\")\n```\n\n## Environment Variables 🔐\n\n- `SLACK_BOT_TOKEN`: Your Slack bot token (required)\n- `SLACK_CHANNEL_ID`: Default channel ID for messages\n\n## Error Handling 🔍\n\n```go\nresponse, err := sdk.SendMessage(ctx, channelID, message)\nif err != nil {\n    if slackErr, ok := err.(*slack.SlackError); ok {\n        log.Printf(\"Slack API error: %s\", slackErr.Message)\n    } else {\n        log.Printf(\"Other error: %v\", err)\n    }\n}\n```\n\n## Contributing 🤝\n\nContributions are welcome! Feel free to:\n- Report bugs\n- Suggest new features\n- Submit PRs\n\n## Contact 📫\n\n- 💻 [PramithaMJ](https://github.com/pramithamj)\n- 📧 lpramithamj@gmail.com\n\n## License 📄\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n---\nLast Updated: March 6, 2025\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpramithamj%2Fslack-sdk-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpramithamj%2Fslack-sdk-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpramithamj%2Fslack-sdk-go/lists"}