Discord Bots: What I Learnt

My key takeaways from over 3 years of managing a project

🧑‍💻

Written by Josh Humphriss

🗓️

Posted: 16 Sep 2024

🗓️

Modified: 01 Oct 2024

⏱️

9 min read

👁️

73 views

Introduction

To say I've learnt a lot would be an understatement. Making discord bots has given me a space to experiment with managing a project, and most importantly, getting things wrong. Here's the biggest things that I've learnt along the way.

What's a Discord Bot?

A bot functions like a user on a messaging platform however it responds to automated commands. For example, I can type ".weather" and it will immediately send a reply containing the current weather forecast. I can also have more complicated commands that do things inside the messaging platform Discord, such as ".ban @mrpenguin123" which would ban the user @mrpenguin123 from the server. Discord bots are a well established niche, with millions of discord bots in total, some focusing on useful features and others offering fun games to play, all directly inside of a messaging app.

Which bots have you created?

Originally SmileyBot and since split into four separate bots, I have made:

You can find more about my discord bots on the website I created for them, currently hosted right here on this domain!

Coding

The technical side of things - after deciding what needs doing, making it happen as quickly and effectively as possible.

Writing Functional Code

This project is, quite simply, how I learnt to code. When I started, I was very new to programming but a few years later I would say I'm fairly experienced with Python, which has significantly helped picking up new languages. There's not really much in particular to say here as coding is just something you learn by doing.

A stand out feature of this project to me has been the sheer amount of code I've been able to write. Without having to collaborate with other people on a team, look for assets or do much QA, I've been able to write over 120,000 lines of code over 3 years. While these things are important, they're not as fun as just writing loads of code!

Writing Maintainable Code

While writing functional code can be learnt quickly, the importance of writing maintainable code is learnt over a much longer period of time. Knowing why maintainable code is important only happens once you've written enough code that you look back on the old stuff and wonder "what on earth does this do?". Knowing how is something I am still learning, but I have got much better at while writing so much code, and, more importantly, going back and reading it!

Working at Scale

When I started, I would release a substantial feature, or even multiple, in a single day! As the project grew, everything just took longer. I don't even know why - it's not like I had any staff or anything, things just took longer the more time went past. Use the time at the beginning of a project to implement the big ambitious features while everything is moving faster - the longer you leave it, the longer it'll take.

Managing a Project

By the end, I was only spending around half of my time actually coding. Managing a project also involves choosing what to make, engaging with the community and marketing

Listening to Feedback

Listening to feedback is important, but you shouldn't do everything people suggest. Having a strong vision and sticking to it is just as important. I've often focused on the former at the expense of the latter in order to try and please everyone and it's led to me wasting a lot of time making features that only one person wants rather than making the product as good as it can be. An example is google sheets integration, added at the request of a user. However, it doesn't matter how it's implemented, google sheets on discord is always going to be clunky! This feature was cool, but never really used as it's just not well suited to the platform. I think it's better to listen to customers too much rather than too little, but neither are ideal.

The Importance of Marketing

I always wonder how many people would've used my bots if I had invested in marketing. I had a great product but nobody knew about it. Don't rely on organic growth - a bad product with good marketing will always beat a good product with poor marketing. I did eventually invest a little bit towards the end of development but it was too little and too late.

Quality Over Quantity

There becomes a point where you have made so many features that nobody really cares if you add more. SmileyBot was so broad that it meant I struggled to market it as it didn't really focus on anything! Focusing on a narrower range of features and doing them better than everybody else is better than doing lots of things that lots of other bots also do. Not everything needs to be completely unique, but ensuring that each feature is well made goes a long way, even if it comes at the expense of new features. When I slowed down with new features and focused on fixing bugs I found it made the bots much better overall (although it was less fun...).

Moderating a Discord Server

I've been responsible for structuring the server appropriately, keeping members engaged and using punishments where necessary. I've found that servers should be as simple as possible (with only the channels that are necessary), otherwise new users can find it overwhelming. It's not necessary to have a sophisticated warnings system or lots of roles, just make sure things are clear and that people use it. Using punishments appropriately requires good judgement, and something that I have developed over time through past experiences of making the wrong call.

Feature Design

After knowing which features need implementing, you need to decide on the details with each individual feature.

Ease-of-use Matters

A lot! I already knew that making things easy to use was important, but I didn't realise quite how little patience most users have. Remember that new users are not invested in your product and therefore don't really care enough to fiddle around with unintuitive design. I've found a lot of users have tried to use a feature, and instead of simply typing ".help [feature]", they've given up and used a different bot instead. There's a reason companies spend so much money making major design changes to make things slightly easier to use, even when it comes at the expense of functionality.

Simplicity vs Ease-of-use & Consistency

On the topic of ease-of-use, this is not the same as simplicity! Some designs I've made have been very elegant and required very little typing from the user, however users have found it unintuitive compared to more cumbersome designs requiring more typing/clicks. The "would you rather" feature is an example - you can add a new prompt by just typing ".wyr cheese or biscuits". But users are used to subcommands, and expect the command to be ".wyr create cheese or biscuits". Furthermore, if they enter a subcommand wrong (let's say they type ".wyr remove 6" instead of ".wyr delete 6"), they would be given an error message as they have entered a new prompt but only given one option. For some other subcommands, an argument is given before the subcommand, making it inconsistent with other similar features. A simpler example is warn cooldown. Typing ".warncooldown" resets the cooldown and typing ".warncooldown 2m" would set it to 2 minutes. This is elegant and requires less typing than if you had to do ".warncooldown set 2m" or ".warncooldown reset", but it's ultimately more difficult for users to use. Making a design simple and elegant should not come at the expense of consistency - people expect similar features to behave in similar ways, and would rather it took a couple more clicks if they can already know how it works rather than have to figure out a whole new thing.

Customisability

I was a little bit obsessed with making absolutely everything customisable, when in reality, nobody really cared. People appreciated it, but it didn't lead to any additional users. For example, the giveaways feature allows you to choose the icon, winner format and emoji to enter. The permissions feature is powerful but more than any user could realistically need. I don't regret making any of these features, one or two people used them and they didn't take long to make, but don't expect lots of customisability to meaningfully improve user experience.

Designing on a Platform

Always keep the platform you're designing for in mind. In this case, I was designing a bot for Discord, a messaging app. An inherently social platform where people are only interested in spending short amounts of time using bots. It's important to develop all features within this context.

An example of a poorly designed feature is the notes command. Overall, it's a well developed feature that allows you to store and view notes directly inside discord, including adding attachments. The only problem is, there's just no benefit over a traditional notes app. The inherently text-based nature of interacting with the bot makes editing notes clunky and, although you can share notes with other discord users, fails to utilise the strengths of being inside a discord bot. Another such example is "good morning forecast", which sends you a DM every morning at a time you choose with today's forecast. Sounds handy, until you realise that if you really wanted that feature then you could just download a weather app that would do it better than a discord bot ever could.

Some other features were really well designed, like connect 4, allowing you to play immediately, without having to invite friends to a lobby and without even having to switch windows. This feature utilises the strengths of Discord and does not encounter many of the weaknesses. It's so important to recognise the strengths and weaknesses of the platform you're designing for and choose features appropriately.

Games Design

Some more stuff about design, but this time specific to my games, Economy and PokéVenture.

Multiplayer. Multiplayer. Multiplayer.

I really underestimated the importance of multiplayer when designing the games. As the bots started, people appreciated multiplayer features but didn't really care about them that much and nobody said it was essential to them. This is until I advertised the pokemon bot to thousands of people, with many of them asking for PvP battles. This seemed strange - as far as I was concerned I had made a good game and PvP was outside of that core game hence non-essential. However, I had really underestimated the need for multiplayer. People enjoy fighting their friends and it'll get more people into the game. What use is there in a leaderboard if you can't fight each other? This also ties in with the comments above about designing for the platform you're on - discord is a social platform, and designing a singleplayer game with limited social features was a mistake.

Fun vs Cool

A game is meant to be fun. Nobody cares how many different features you have, people keep playing a game if it's fun. Cool features are a very small part of an engaging gameplay loop. People consistently said how impressive my games were and how they had so many interesting features, but ultimately they just weren't that fun so most users stopped playing quickly. The games would've performed better if there were fewer features that were designed with a bit more thought and with fun at the centre.

Web Development

The last skill that I want to feature here is web development. I'm a big fan of how this website turned out, but this only happened because I had previous experience making the discord bots website (which is much worse).

Light Mode vs Dark Mode

Designing for light mode and dark mode is completely different! You can't just swap out the colours or it will look stupid. For example, in a dark mode, UI elements with higher elevation are typically done in a lighter shade of grey. In a light mode, everything should have a white background. There's a reason I haven't added a light theme to this website - it's a lot more work than it seems!

Re-Using Things

If there's no reason for one button to look different to another one, make them the same. Just re-use the CSS file. It saves development time but also gives a coherent look and familiar feeling across the whole site.

A Backend

Please think about your backend before starting and don't just make a static website and strap on a really dodgy backend later! For /commands, I ended up manually disabling https on that page so that when it loaded it could fetch a database dump from my node.js server running on port 3000 without getting a browser error. This meant there was an extra round trip loading the page and it was also insecure. I should've found out more about how to make a backend and done it properly from the beginning.

Don't Use All The Space

On a desktop, don't go right to the edges. You only need to use the bit in the middle - the outsides can just be blank space and that's fine, it makes it easier to look at. Of course, if you've got enough stuff to fill the screen then go for it, but if you're just displaying text, make those margins nice and wide so it's easier to read.

Conclusion

The final tip I have is to just give it a go! It might not work out (it probably won't in the way you expect), but what if it did? I never expected to spend so long on what started as such a simple project and I had so much fun and learnt so much along the way. While they never 'blew up' the way I thought they might, these bots are a key part of where I am today and without them I'd be much less experienced for the future. Ultimately, the you can only get things right by either getting really lucky first time, or by doing it wrong the first time and then going back and doing it differently. Neither of these will happen unless you give it a go!

More About My Discord Bots

I've also written articles about:

Feel free to check them out if you're interested!