Skip to main content
  1. projects/

UniChan

·401 words·2 mins
Samuel Cattini-Schultz
Author
Samuel Cattini-Schultz
Software engineering, exploring the world and whatever else tickles my fancy.
My introduction to the wonderful world of programming.

UniChan was my first real project.

I had just started playing osu! earlier in the year and Discord had also just launched a few months earlier. There weren’t many, if any, public and well known osu! discord bots at this time, so like most of my projects, UniChan was born out a desire to create something I wanted that didn’t already exist.

I used IRC before discord and my friends had built IRC bots for our channels so I thought it was my turn to join the club.

I used the newly started discord.py framework, played around with the osu! API and later that day, UniChan was created!

A discord chat screenshot
2015-12-23: A screenshot of me testing UniChan’s =stats command for the first time

At first I only implemented simple commands which we’re pretty much just a discord bot interface for the osu! API, such as =stats above. But over time I implemented some more interesting commands.

=pp filtered player scores by mods, fitted a curve and extrapolated what their total pp might be if they only had scores with those mods.

A discord chat screenshot
2016-04-02: A screenshot of me testing UniChan’s =pp command

=ppchart took data points for multiple players and visualised them with matplotlib.

A discord chat screenshot
2016-05-14: A screenshot of me testing UniChan’s =ppchart command

=nochoke classified player scores by whether they were a choke or not, then “unchoked” those scores to calculate what pp a player might have if they had nerves of steel.

A discord chat screenshot
2016-05-14: A screenshot of me testing UniChan’s =nochoke command

As this was my first real project, unsurprisingly the code is largely the result of hacking things together and seeing what worked. It’s full of commented blocks (because obviously I didn’t use source control!), mad ramblings, duplicated code and an almost intentional seeming lack of consistent formatting, largely all in one multi-thousand line commands.py file! We all started somewhere and should be able to look back and celebrate how far we’ve come.

comment reading "THIS BLOCK IS BROKEN AND I DONT KNOW WHY"
Really takes me back…

At her peak UniChan was added to over 500 discord servers.

To this day I still keep UniChan running for the few discord servers that still use her although most of her commands have been disabled at this point as discord’s API changes have slowly broken her over time.

Source: The code is sitting in a repo ready to be made public after I check for any security issues.