Skip to content

takara2314/slack-go-util

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Slack API in Go Utility

Go Reference CI Release

A powerful utility package for slack-go that converts Markdown text into Slack's Block Kit format with ease! ✨

✨ Features

  • 🔄 Convert Markdown to Slack Blocks
  • 📚 Support for multiple Markdown elements:
    • Headers
    • Paragraphs
    • Lists
    • Nested lists
    • Code blocks
    • Blockquotes

📦 Installation

Install using Go Modules:

go get github.com/takara2314/slack-go-util

🚀 Usage

Here's a basic example of converting Markdown text to Slack Blocks:

package main

import (
	"github.com/slack-go/slack"
	slackUtil "github.com/takara2314/slack-go-util"
)

func main() {
	// Initialize Slack API client
	api := slack.New("your-slack-token")

	markdown := `# Today's Tasks
**Project Updates**
- 🎯 Completed user authentication feature
  - Login flow implemented
  - Session management added
- 🐛 Fixed database connection issues
- 📱 Updated mobile responsive design

**Todo**
1. Review pull requests
2. Update documentation
3. Deploy to staging

> Don't forget team meeting at 2pm!`

	// Convert Markdown to Slack Blocks
	blocks, err := slackUtil.ConvertMarkdownTextToBlocks(markdown)
	if err != nil {
		panic(err)
	}

	// Send message to Slack
	_, _, err = api.PostMessage(
		"CHANNEL_ID",
		slack.MsgOptionBlocks(blocks...),
	)
	if err != nil {
		panic(err)
	}
}

The above code will send a beautifully formatted message to your Slack channel, including both bulleted and numbered lists! 📝

👥 Contributing

Contributions are welcome! 🎉 Feel free to:

  • Report bugs
  • Request features
  • Submit pull requests

Please check out our CONTRIBUTING.md for guidelines.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🤝 Support

If you have any questions or need support, please open an issue in the GitHub repository.

About

Slack API in Go Utility

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors