👾 A Discord API Wrapper — A Little Kidogo Proposal

On the road to leveraging automation as a team player in our day to day activities.

MountainGoat
Little Kidogo
4 min readOct 6, 2018

--

Do you run a remote community?

Well we do and we’d like to show you what we’ve learned so far.

‘Quick Bites’ — by Carla Inez Espost Productions, 2016 (https://medium.com/@carlaespost).

At Little Kidogo where we make Tools for African Artisans, we are always looking for ways of leveraging automation as a team player in our daily activities.

Over the last few months, we have been observing, reviewing and revising our daily work and during this course we have learnt a lot through a few low fidelity experiments we’ve conducted so far.

Here’s the ways we plan to leverage automation through bots to enable our engineering team to work better:

  1. Automate daily stand up reporting processes by employing a conversational bot and mentions to alert others of potential collaboration opportunities and blockers, this also enables us to run our stand up reporting asynchronously
  2. At Little Kidogo over the last two months, our citizenship has more than doubled we have noticed how much automation we can employ in getting new members up and running in our ecosystem — it being so unconventional, makes getting a new member orientated quite the task.
  3. At Little Kidogo we are a remote first, asynchronous and distributed team — hence it is difficult to have a standard work day or even meeting time! Team scheduling is very difficult as the team is distributed across disparate time zones. The biggest challenge here is to create ‘saner’ times for everyone to meet. So in order to enable our team to move faster we are automating the scheduling of meetings between members by enabling our bot to conduct meeting time negotiations.
  4. As Little Kidogo is a remote team we have to follow (at best) unconventional meeting procedures, thus leveraging automation to help with meeting orchestration is our main concern at the moment. We will do this mainly in order to run our planning and retrospective meetings and our experiments have shown that our bot will definitely make these sessions much shorter and clearer.

As you can see this is just the tip of the iceberg for how we can use automation as a team player.

*Please follow this blog series to uncover the rest. You can do that by following Quick Bytes on Medium here.

Here’s how we plan to automate our office environment on Discord:

* At the end of this article is a document from Stripe describing a market opportunity for enabling developers (and by extension teams) to perform better.

The Discord API is made up of two major parts.

  1. A REST API for general operations
  2. WebSockets for sending and subscribing to real-time events

In order to interact with the API, we need to consider the following —

Authentication and Authorization

Authentication to the Discord API happens using an authorization token which could be one of 2 types

A bot token —

A bearer token —

Identification

Discord uses Twitters Snowflake ID for unique descriptors.

HTTPS/REST API —

Whenever using the REST API with Discord ensure to include a User-Agent header identifying the resource connecting.

RATE Limits —

Due to Discords size and scale, we should ensure to respect the rate limits imposed by their API especially since we are letting other people use a service through our keys. *Which may be expelled from Discord if we disobey the Rate Limits 🙀!

Gateway API —

The discord gateway API enables clients to maintain a persistent WebSocket connection to discord, listen for and publish real-time events.

Webhooks —

If your use case only require sending messages into a guild consider using webhooks as bots have to connect at least once to a guild before they can use the createMessage endpoint.

Message Formatting —

Discord uses a subset of Markdown to render messages in clients and provides for strategies enabling a client to mention a channel, roles, users, bots.

Image Formatting —

Discords uses a combination of ids and hashes to display images in clients various endpoints can provide hashes of images in different formats and custom sizes.

We would need to cater for the above contexts in order to create a wrapper for the Discord API that we can use to power our automation and productivity bots.

Keen to work with us on this?

Let us know on our Discord Channel :)

Research:

Now, back to code 😜

--

--

MountainGoat
Little Kidogo

Yoga Teacher, I like Adding Bugs To Code and Getting flicked off Motorcycles. Fork Me: http://github.com/zacck