How Building a Slack Bot for Deepgram Became a Highlight of My Tech Journey

How Building a Slack Bot for Deepgram Became a Highlight of My Tech Journey

Hey there! I’m excited to share a story about a project that became one of the most enjoyable and enlightening experiences of my career: building a Slack bot for Deepgram. Let me tell you, it was quite the adventure!

The Genesis of the Project

At Deepgram, we’re pioneers in speech recognition technology. With great innovation comes great responsibility, and we found ourselves in need of a solution to manage customer insights and feedback within our Slack channels. The answer? A Slack bot!

Admittedly, when I first embarked on this project, I was a mix of excitement and nerves. The goal was ambitious: develop a bot to seamlessly connect over 1,000 conversations in our customer Slack channels to Zendesk. No pressure, right?

Diving Into the Code

The journey was a deep dive into coding, testing, and learning. Exploring the Slack Events API and Zendesk API was exhilarating as I watched the pieces fall into place.

Here’s a glimpse into how we set up our Slack bot to listen for events:

import os  
from slackeventsapi import SlackEventAdapter  
  
SLACK\_SIGNING\_SECRET = os.environ\["SLACK\_SIGNING\_SECRET"\]  
slack\_events\_adapter = SlackEventAdapter(SLACK\_SIGNING\_SECRET, endpoint="/slack/events")

Note: This is a simplified example. Ensure your tokens and credentials are secure!

This code initializes our bot with the Slack Events API, enabling it to securely listen for events in our workspace. We then created listeners for various events, such as mentions and reactions, to trigger Zendesk ticket creation and tracking:

@slack\_events\_adapter.on("app\_mention")  
def handle\_mention(event\_data):  
    # Logic to handle app mentions  
    pass  
  
@slack\_events\_adapter.on("reaction\_added")  
def handle\_reaction(event\_data):  
    # Logic to handle reactions  
    pass

Connecting to Zendesk was crucial to ensure that we captured valuable insights and metrics for our support team!

Simplifying Deployment with Docker

To streamline deployment and management, we containerized our bot using Docker:

version: "3.4"  
services:  
  bot-listener:  
    image: libearden/dg-supportbot:latest  
    volumes:  
      - .:/usr/src/app  
    environment:  
      - SLACK\_SIGNING\_SECRET  
    ports:  
      - 5000:5000

This setup allowed us to quickly deploy our bot with consistent dependencies, making the process efficient and straightforward.

Integrating with Zapier for Seamless Automation

A key aspect of our bot’s functionality was its integration with Zapier. We used Zapier to automate actions between Slack and our Zendesk support system. Here are some highlights:

  • Ticket Creation from app_mention Events: When our bot was mentioned in Slack, Zapier created a new Zendesk ticket, ensuring no query went unnoticed.
  • Bidirectional Reply Connection: We established a two-way connection between Slack and Zendesk, allowing seamless conversation flow.
  • Channel Tracking and Mass Updates: We used reactions like “mega” to trigger updates or announcements in specific channels.
  • Event Logging: All bot activities were logged in a dedicated Slack channel, providing transparency and an audit trail.

Reflections on the Journey

The more I worked on this project, the more I enjoyed it. It was like solving a puzzle, with each piece bringing a sense of accomplishment. The bot became a bridge between our team and our customers, enhancing our interactions and efficiency.

The highlight? Seeing the bot in action and knowing it made a real impact. It supported over 150 enterprise customers and contributed to Deepgram’s $72M Series B funding. What a rewarding experience!

This journey taught me that automation is more than just efficiency; it’s about creating connections and exploring new possibilities. I’m excited for what lies ahead on this tech adventure.

If you’re interested in the technical details or want to chat about technology, feel free to check out the project on GitHub or connect with me on LinkedIn.

Here’s to more thrilling adventures in the world of technology!