The current way that automod tries to create discussion groups is try to create a group, if it exists already, unarchive it and then add all the members to it. This process depends on Slack returning the full list of private channels to us every time we ask. Apparently there is a case where a channel is created but it won't be returned in the full list of private channels so we get into the issue of not being able to create it and not being able to unarchive it.
The fix
To fix this, I return a message to the user telling them to run the command again with a number at the end so that I can postfix it to the channel name and create an entirely new private channel. It follows the same create, find, unarchive logic that automod does already but for a channel with a slightly different name.
Other fixes
apparently Express 3 uses send instead of sendStatus
ignore all manners of .env files
specifically set the node and npm versions for heroku (we need node 8.6.x or higher for the object spread operator)
The issue
The current way that automod tries to create discussion groups is try to create a group, if it exists already, unarchive it and then add all the members to it. This process depends on Slack returning the full list of private channels to us every time we ask. Apparently there is a case where a channel is created but it won't be returned in the full list of private channels so we get into the issue of not being able to create it and not being able to unarchive it.
The fix
To fix this, I return a message to the user telling them to run the command again with a number at the end so that I can postfix it to the channel name and create an entirely new private channel. It follows the same create, find, unarchive logic that automod does already but for a channel with a slightly different name.
Other fixes
send
instead ofsendStatus
.env
filesnode
andnpm
versions for heroku (we need node 8.6.x or higher for the object spread operator)