Core Protocols Discord Bot

This open source bot integrates the structured use of the Core Protocols in a Discord server. It currently supports: Check In, Check Out, and Decider. These protocols easily map to asynchronous team work via Discord.

The source code is available on Github.

Commands

There are four slash commands available: learn, checkin, checkout, and propose.

Learn

Learn provides links to more information about the specific protocols (Check In, Check Out, and Decider), and to information about the Core Protocols.

Use the /learn command for links to more information about the Core Protocols.

Process

Just type /learn and links will be provided.

Type /learn.
The bot provides links to more information.

Check In

Team members that are present and engaged operate at a higher performance level. If you are distracted or not fully present, you can pull others off track. When you are in the team space, be “in”.

There are several commitments that team members agree to uphold when using the Check In protocol. Read the full list.

After you have selected emotions, the bot will post to the channel your Check In status.

Process

Type /checkin. The bot will provide you with a drop down to select one or more emotions. After your selection, the bot prints your Check In status to the channel.

Type /checkin to start the Check In protocol.
Choose one or more emotions from the drop down menu.
Multiple emotions can be selected.
The bot will post your Check In status to the channel.

Check Out

If you are mentally checked out, physically move out of the space so that you don’t distract those who are Checked In. Use your time away from the team space to do what you need to in order to get back “in”.

Type /checkout for the Check Out protocol.

Process

Type /checkout and click the button. The bot will post your Check Out status.

Type /checkout to start the process.
The bot will post your Check Out status to the channel.

Decider Proposal

The Decider Protocol is a quick and easy way to get a unanimous decision.

Type /propose to start the Decider protocol.

Process

Type /propose. The bot will provide a text box for you to type in your proposal. Once you have submitted the proposal the bot will post it to the channel. Your team can quickly vote for it with a thumbs up or a thumbs down.

Type /propose to start the Decider Protocol process.
Add your proposal to the textbox and submit.
The bot posts the proposal to the channel.

Why The Core Protocols?

The Core is a set of best practices distilled from over 25 years of research. It includes Core Commitments for the team to create a high functioning environment, and a set of Core Protocols to help the team better understand and support the commitments.

To learn more read the book Software For Your Head. It’s online, free, and covers The Core in depth.

Set Up Your Bot

You can create your own free bot by following Discord’s Getting Started guide. If you don’t have a server, you can use Glitch for development and short-term testing. Use the bot as is, or change The Core Protocols functionality in the app.js, commands.js, and utils.js files. You can set your own name and avatar for the bot, too.

Steps:

  • Create a Discord app. Follow the Discord’s Getting Started guide to see how to create one.
  • Setup hosting for the code (you can use Glitch for development and short-term testing for free).
  • Create a .env file for environment variables. Example variables: GUILD_ID, DISCORD_TOKEN, PUBLIC_KEY, and APP_ID.
  • Connect the app to the server you want to use it in.

Example connecting your Discord bot to your Discord server:

Customize Code

The source code is available on Github and is released under the GPLv3 license. You can add additional functionality or other improvements.

Check-In Emoji

The emoji for Check-In can be updated in app.js.

options: [
  {
    label: `Mad`,
    value: `😡 mad`,
    emoji: {
      id: null,
      name: `😡`,
    },
    default: false,
  },
  {
    label: `Sad`,
    value: `😭 sad`,
    emoji: {
      id: null,
      name: `😭`,
    },
    default: false,
  },
  {
    label: `Glad`,
    value: `😄 glad`,
    emoji: {
      id: null,
      name: `😄`,
    },
    default: false,
  },
  {
    label: `Afraid`,
    value: `😨 afraid`,
    emoji: {
      id: null,
      name: `😨`,
    },
    default: false,
  },
],

Command Descriptions

The descriptions for protocols are located in commands.js.

Example:

// -----------------------------------
// Core Protocols
// -----------------------------------
export const DECIDER_COMMAND = {
  name: "decider",
  description: "Decider: Immediately and unanimously move your team towards results",
  type: 1,
};

Learn Links

To change the sites the Learn buttons link to, edit the app.js file.

Example:

{
type: MessageComponentTypes.BUTTON,
url: "https://mccarthyshow.com/the-core/",
label: "Core Prototocols",
style: ButtonStyleTypes.LINK,
},

Additional Functionality

Edit the app.js file to change how the additional commands work.

Example:

// -----------------------------------
// Handle modal submissions
// -----------------------------------
  if (type === InteractionType.APPLICATION_MODAL_SUBMIT) {
    const modalId = data.custom_id;
    const userId = req.body.member.user.id;

    if (modalId === "decider_proposal") {
      let proposal_text = "";
       for (let action of data.components) {
        let inputComponent = action.components[0];
        proposal_text += `${inputComponent.value}\n`;
      }
      return res.send({
        type: InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE,
        data: {
          content: `@here <@${userId}> has initiated a Decider. Respond with 👍 thumbs up or 👎 thumbs down.\n\n<@${userId}> proposes ${proposal_text}`,
        },
      });
    }
  }
});