Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discord Bot For C0D3 #3

Open
7 of 8 tasks
JasirZaeem opened this issue Jun 22, 2021 · 0 comments
Open
7 of 8 tasks

Discord Bot For C0D3 #3

JasirZaeem opened this issue Jun 22, 2021 · 0 comments
Labels
Design Doc Issues with information about architectural decisions

Comments

@JasirZaeem
Copy link
Member

JasirZaeem commented Jun 22, 2021

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.

@JasirZaeem JasirZaeem added the Design Doc Issues with information about architectural decisions label Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Doc Issues with information about architectural decisions
Projects
None yet
Development

No branches or pull requests

1 participant