Blog: Building a Discord Bot

30 Nov 2022

Bot logo

Whilst browsing HackerNews I spotted a quirky API by Avi Mamenko. This API serves one simple but crucial function, to deliver random clips of Owen Wilson saying ‘wow’ directly into your hands.

So why not stick a Discord bot in front of that API to ensure proper supply of random ‘wows’? OwenWowson is that bot.

Anatomy of a bot

OwenWowson has some fairly simple requirements, he must:

To power this, we lean heavily into Cogs. These are modular sets of functions that can be used across multiple bots.

In this case, ours cogs are:

These arm OwenWowson with the following commands:

Anatomy of a wow

Example !wow

When the !wow command is called, a number of things will happen:

  1. OwenWowson requests a random wow via the API
  2. A text response is built containing all crucial metadata
  3. That voice clip is played in the relevant voice channels

You can find OwenWowson’s source code on GitHub.