Slack-Bot is a communication tool used by developers and companies to share information and communicate. It has grown very popular in recent years.
In this Golang project, we’re building a slack bot that uploads a file. With so much technology available to individuals and corporations , you could have several different files uploaded to your stack server. Slack supports several file types including standard images . Users can also ink videos that can be viewed directly from the link displaying the video content and play buttons in slack.
1.Clone the repository: git clone: https://github.com/Poonam-13/Slack-bot-File-Uploading.git
2.Connecting to Slack from Golang:
mkdir slack-bot
cd slack-bot
go mod init
-
Build the application:
go build
-
Install the required dependencies:
go get -u github.com/slack-go/slack
go get -u github.com/poonam-13
-
Set up a Slack app and obtain the necessary credentials (token, signing secret).
-
Configure the bot's credentials by either setting environment variables or creating a
config.json
file. See the Configuration section for more details. -
Run the application:
go run main.go
-
Invite the bot to your Slack workspace and grant the necessary permissions to upload files.
-
Add the bot to a channel where you want to enable file uploading.
-
In the Slack chat interface, use the bot's designated commands to upload files. For example, you might use a command like
/upload <path-to-file>
to initiate the file upload process. -
The bot will process the file and upload it to the specified channel.
-
The bot will respond with a success message and provide a link to access the uploaded file.
The bot requires the following configuration options:
SLACK_TOKEN
: The Slack bot token used for authentication.SLACK_SIGNING_SECRET
: The Slack app's signing secret for verifying requests.
Make sure to replace the placeholder values with your actual credentials.
Contributions are welcome! If you'd like to contribute to the project.
This project utilizes the official Slack API for interacting with the Slack platform.
If you have any questions, feedback, or suggestions, please feel free to reach out: