https://github.com/anshsinghsonkhia/go-slack-file-bot
a simple Slack bot written in Go that allows users to upload, download, and manage files directly from Slack channels. It leverages Slack's API and Go's concurrency features for efficient file handling.
https://github.com/anshsinghsonkhia/go-slack-file-bot
go golang slack slack-bot
Last synced: 2 months ago
JSON representation
a simple Slack bot written in Go that allows users to upload, download, and manage files directly from Slack channels. It leverages Slack's API and Go's concurrency features for efficient file handling.
- Host: GitHub
- URL: https://github.com/anshsinghsonkhia/go-slack-file-bot
- Owner: AnshSinghSonkhia
- License: cc0-1.0
- Created: 2025-07-12T16:14:50.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-07-12T17:00:57.000Z (3 months ago)
- Last Synced: 2025-07-12T19:23:20.427Z (3 months ago)
- Topics: go, golang, slack, slack-bot
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-slack-file-bot
[](https://golang.org/)
[](https://api.slack.com/bot-users)
[](LICENSE)## Overview
**go-slack-file-bot** is a simple Slack bot written in Go that allows users to upload, download, and manage files directly from Slack channels. It leverages Slack's API and Go's concurrency features for efficient file handling.
## Features
- Upload files to Slack channels
- Download files from Slack
- List files shared in a channel
- Delete files (admin only)
- Simple command interface## Getting Started
### Prerequisites
- Go 1.21 or higher
- A Slack workspace
- A Slack bot token with appropriate permissions (`files:read`, `files:write`, `chat:write`, etc.)### Installation
1. Clone the repository:
```bash
git clone https://github.com/yourusername/go-slack-file-bot.git
cd go-slack-file-bot
```2. Build the bot:
```bash
go build -o slack-file-bot
```3. Set your Slack bot token as an environment variable:
```bash
export SLACK_BOT_TOKEN="xoxb-your-slack-bot-token"
```4. Run the bot:
```bash
./slack-file-bot
```## Usage
Interact with the bot in your Slack workspace using the following commands:
- `upload `: Upload a file to the current channel.
- `download `: Download a file from Slack.
- `list`: List recent files in the channel.
- `delete `: Delete a file (admin only).Example:
```
@go-slack-file-bot upload report.pdf
```## Configuration
You can configure the bot using environment variables:
| Variable | Description |
|--------------------|---------------------------|
| SLACK_BOT_TOKEN | Your Slack bot token |
| SLACK_APP_TOKEN | (Optional) App-level token|## Contributing
Contributions are welcome! Please open issues or submit pull requests for new features, bug fixes, or improvements.
## License
This project is licensed under the MIT License. See [LICENSE](LICENSE) for details.
## Acknowledgements
- [Slack API](https://api.slack.com/)
- [Go Slack SDK](https://github.com/slack-go/slack)