Impromp2 Discord Bot
Note: Discord now has this feature built in! So the bot has been brought down.
My friend Mellow came to me with an idea. “Hey, our discord community is getting bigger. People want to be in voice channels together for games and whatnot, but only moderators can make those. Could we have a bot make a temp channel for them”.
Seemed simple enough, and I’d never made a discord bot before, so I made Impromp2. Impromp2’s purpose was simple: When someone wants to make a temp voice channel, they’d type a chat command and one would be made. If the channel was ever empty for a few minutes, it’d be removed again.
It was not a very challenging problem. Discord’s API is really good and exceptionally well documented. Plus, there already was a npm library for interfacing with it. The bot would join a server, watch for the command, make a corresponding channel, then occasionally poll whether any it had made were in use and update a timestamp if so.
What I really learned from this project was scale, as it was the live-service first thing I made which was in use by a substantial amount of people. At peak it was in use by around 100 servers, and tracking maybe a dozen per-server at a time.
It wasn’t designed to scale, as I hadn’t any experience with that at the time. There were a few bandaids I was able to put over the issue, but this was a side project so time was limited. So limited in fact, that before I managed to implement most of the major improvements I had planned, Discord actually implemented the feature itself! So problem solved, in a way.