Skip to content

Discord Bot For C0D3 #3

Open
Open
@JasirZaeem

Description

@JasirZaeem

Purpose

c0d3 has moved its community from a self hosted mattermost instance to a Discord server after this migration we are working to recreate the integration we had with mattermost between the c0d3 app and the c0d3 discord server. Documented here. Part of this effort is this DIscord bot.

One of the main functionality that has been absent after Discord migration is notifying Reviewers and students of new submissions and, acceptance and rejection of submissions. This functionality is important to maintain engagement and interactivity of both mentors and students.

More details about this feature are available in the linked issue

Architecture

This app is a combination of a Discord bot built with discord.js and an express to allow the both to be controlled by http requests.

The intended use is for this to be given commands by the c0d3-app with the details required and then communicate with discord to perform that action.

image

Currently available Api endpoints are documented here

Instructions to run bot locally are available in the readme

Why a separate service

Discord bot api requires a websocket connection to stay logged in and, send and receive messages. This does not work well with the serverless architecture of vercel where c0d3.com is hosted. Other way would be to use webbooks from the c0d3-app but they have some limitations which meant choosing to make a discord bot instead of using webhooks

Webhook limitations

  • Need a separate webhook for every channel we need to send messages to
  • Can't receive messages with webhooks
  • Can't do non-message sending tasks like member role management with webhooks
  • Cannot dm users with webhooks

Status

  • Create discord app
  • Create the bot node app
  • Setup deployment
  • Write docs
  • Rewrite a more restful api
  • Update api docs to the new version
  • Connect to the c0d3 app
  • Add logging #12

Potential future additions

Add endpoint and bot functions to manage roles of the c0d3 server members.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design DocIssues with information about architectural decisions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions