Sitemap
Level Up Coding

Coding tutorials and news. The developer homepage gitconnected.com && skilled.dev && levelup.dev

Follow publication

Member-only story

GOLANG SLACKBOT TUTORIAL

Implement Slack Slash Command in Golang using Socket Mode

Empower your users with easy shortcuts

7 min readMay 23, 2021

--

Miniature Space Rocket and Gopher (Golang) with a jet-pack
Photo by Jean-Philippe Delberghe on Unsplash, Gopher by Egon Elbre.

Slash Commands are the messages you type in the conversation box, starting with "/". They let you easily extend the capabilities of Slack and are pretty simple to implement. I see them as ways to interact with your ecosystem by writing from your Slack Channels, and then your Slack application is the orchestrator behind the scene redirecting your user request to the right system. In short, I'd like to describe them as functions that you can trigger remotely from Slack. So no matter you want to add simple utilities or convert your workspace into a full-fledge ChatOps Headquarter, Slash commands are a must-have in your Slack application.

This article features a rapid introduction to slash command and a detailed explanation on how to get started in Golang using Socket Mode. The key Slack API concept demonstrated are Slack Slash Commands, Ephemeral Messages, and Interactive Messages.

What can you achieve with Slash Commands?

You may be familiar with Slack Built-in commands. If not, go to any conversation type "/" a first time, then "/" a second time, and you will see all the available commands in your workspace 👍.

--

--

Level Up Coding
Level Up Coding
Alexandre Couëdelo
Alexandre Couëdelo

Written by Alexandre Couëdelo

Software Supply Chain and Automation Specialist (aka. DevOps).

Responses (1)