Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


slackm8 will randomly shuffle a team into a specific amount of groups & invite members to Slack channels.
Written in elm-lang.

Try it yourself or watch the video demo.

alt tag


My workplace likes to set up random groups of members for quick chats to promote communication throughout the team. This app was created to automate the process having a member specifically create channels and invite random users. Plus I wanted to build another thing with elm.

Getting started

% git clone
% cd slackm8
% open dist/index.html

Slack API authorization test token

To try this example out you'll need to have the administrator of your Slack team create an API authorization test token here.

This will allow slackm8 to make 3 types of http requests to your slack team.

slackm8 will store your test token as 'slackm8Model' in localStorage along with the rest of the model. Your token is only accessed from localStorage or the model directly.


Here are just a few things I learnt along the way.

Decoding JSON objects.

Decoding JSON objects seemed a bit daunting to me. I think it's because you have to already know the structure that's going to be returned before you can attempt to decode it. You can't just debug the response in a console like you can in JS.

To get familiar with decoding various JSON structures in elm, I created this sandbox.

Currying Http Task

I needed to perform specific Http Tasks in order, such as creating a channel and then populating this channel with users. This meant both the tasks needed to have access to the same data.

Once I had my 'group' of users I passed them to my createRoom request. I could then partially apply the CreateRoomsSuccess Task with the sames users. This meant when CreateRoomsSuccess was handled at a later stage it had access to the same data. Thank you Chad Gilbert.

createRoom : Group -> Cmd Msg
createRoom group =
    (CreateRoomsSuccess group.users)
      ("https://some_api?room=" ++ group.title)

update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
  case msg of
    CreateRoomsSuccess users roomID ->
      model ! (addUser roomID << .name) users

Splitting a list into a list of multiple lists

I won't lie. This continues to blow my mind. I wanted to split a list into lists of specific amount of values.
So for example, split a list into groups of 2.

limit = 2
myList = [1,2,3,4,5]

// desired output [[1,2], [2,3], [5]]

I've commented on how I understand this function to work. I could have got it awfully wrong, so I'm happy for anyone to correct me.


Source files located in /src

% npm install && elm package install -y
% npm run build


A great lot of thanks goes to Rob Hoelz and Chad Gilbert for their wealth of Elm knowledge.

Thanks also goes to Luke Westby for creating this elm-drum-machine project, which gave me tips on logging.  ·  GitHub @chrisbuttery  ·  Twitter @buttahz  ·  elm-lang slack @butters


Elm app to randomly shuffle & split a team into groups & invite users to Slack channels.



No releases published


No packages published
You can’t perform that action at this time.