The discord client was missing its gateway intent. Basically meaning the
API didn't know what the bot is allowed to do, so sending messages would
fail with 'Error 401: Unauthorized'.
Added only the intent to send messages (2048) and now everything is
working as intended.