What I learned building my first slack bot. 
Tags: slack, kotlin, tech, bot
Published: 2018-11-07 10:27:15

---
title: What I learned building my first slack bot. 
published: true
description: I built a slack-bot and thought that my experiences could be useful for some of you. 
tags: slack, kotlin, tech, bot
---

![](https://thepracticaldev.s3.amazonaws.com/i/opp6ydfeo7nvntds60v4.png)

I built a slack bot which is now live on slacks app directory and realized that I had to face some challenges, which I wasn't prepared for. 

About our app: 
[Olaph](https://olaph.io/) is a bot which helps you to take part at your stand-ups (or daily, weekly or however call it at your company :) a quick meeting where team members update each other about their current progress or challenges)
You can create a simple standup where you define the members, days, time and questions which should be asked to your team and [Olaph](https://olaph.io/) will send those questions to your team-members and broadcast their answers to a specified channel.
We don't use it as a replacement for our dailies, but as a reminder where you can think about what you actually did before the meeting starts (who doesn't know the thinking-breaks when someone doesn't remember what he did yesterday). 
also, you can comment on the answers of others without interrupting the daily. 


First of all: 
The slack support is the best I worked with so far, they respond fast and precise, gave me tips and used feedback properly, e.g.: they changed the documentation on some places which I found confusing. 

Slack suggests some third party SDK's from developers which built wrappers for different languages, but none of them really suited our needs, so we started from scratch (we will publish our wrapper as well, but to make it open source, we have to change and extend some things)

The start was pretty straightforward, we created a slack app, registered our endpoints, and tested it in a dev-workspace. 

When we were in our finishing-phase, things started to become interesting. 
To submit your app to the slack app directory, you have to create a fresh workspace with your installed app & test-users to give slack access to it. 
They have a submission checklist, where all necessary steps are described: https://api.slack.com/docs/slack-apps-checklist. 
so far so good, we clicked on submit, checked all points and submitted [Olaph](https://olaph.io/).
After some days, the slack-team had some minor requests which we had to change (just naming of slash-commands and parameters for commands) 
And then we were allowed to publish our app! 

Said and done, Olaph was live and some workspaces installed Olaph. 
The first week was horrible, errors here and there, gladly no crashes, but some users were not able to use Olaph properly.. 
Some of you might know this feeling, you built something, tried to test every part of your code and suddenly nothing works. 
And then I made the first mistake, I started to freak out. 
"I tested the whole flow, I created a blank workspace, installed the app, used it, everything worked on my development system, how in the world is it possible that there are so many errors?" 
I got a mail from a nice woman, which asked for help because she wasn't able to create a standup. 
That calmed my mind a bit, there are actually users that ask for help instead of uninstalling everything and ignore my app forever. 

The challenge was that slack sends different data to your backend when its used in enterprise environments. 
There is some additional/different data, mixed userids and things I didn't know before because I didn't test our app on enterprise workspaces, of course I didn't, I don't even know what that costs, because for enterprises you have to contact slack. 

well, for companies it might be expensive (or maybe not, as mentioned, I don't know the prices) but I was a developer. I found out that you can request an enterprise test instance for developers. 
So I immediately requested an instance and.. waited. 
That's why I had to fix errors which I saw in our logs, tell the users that this error is fixed, and wait for the next error. 

It took about a week until I could set up my test-enterprise and test the app there. After I fixed every error and understood how enterprise workspaces work, I could publish a new release and our Users could finally use Olaph properly. 

What i miss at slack are some statistics and numbers about my app, when you publish your app to the App directory, you don't get any information about clicks, installs, uninstalls, how often slash commands are used or stuff like that. 
Of course, you are able to collect those data by yourself, but i have to invest time for that which could be used to improve or extend the product. 

Slack has a public [roadmap](https://trello.com/b/ZnTQyumQ/slack-platform-roadmap-for-developers) for developers to give insights in their current priorities, but the cards are not very detailed, so i dont really know if we will get real statistics and numbers, but they are pretty active and i am pretty confident that slack will give us tools to improve our apps. 

So far I really enjoyed the work with slack and their API, and I am looking forward to further changes and improvements.