Skip to content

Manage acmcsuf.com board data via Discord slash command.

License

Notifications You must be signed in to change notification settings

acmcsufoss/boardd

Repository files navigation

Boardd

Manage acmcsuf.com board data via Discord slash command.

Development

Run the server

NOTE

Be sure to set the environment variables before running the server.

Be sure to install Deno before running the server.

You will need to use two terminal windows; one for the HTTP server and one for Ngrok.

Terminal 1

To run the server, run the following command:

deno task start

Terminal 2

NOTE You will need to have Ngrok installed and in your path.

deno task ngrok

In Terminal 2, copy the URL that is generated under Forwarding.

  • The URL should look similar to this: https://ab01-23-456-78-910.ngrok-free.app

Set this new URL as the Interactions Endpoint URL in the General tab of your Discord application. Find your application here.

Deploy

This server is deployed on Deno Deploy. To deploy, set the entrypoint file to main.ts and set the environment variables in the Deno Deploy dashboard.

Slash command usage

To understand the usage of the slash command, refer to the source code in bot/app/app.ts.

Discord Application Command setup

  1. Create a Discord application.
  2. Create a bot for the application.
  3. Copy the bot token and set it as the DISCORD_TOKEN environment variable.
  4. Copy the public key and set it as the DISCORD_PUBLIC_KEY environment variable.
  5. Copy the client ID and set it as the DISCORD_CLIENT_ID environment variable.
  6. Spin up the server. Set the Discord interactions endpoint URL to the URL of the server (Ngrok or Deno Deploy).

Environment variables

Refer to .env.example for a list of environment variables that need to be set.

DISCORD_PUBLIC_KEY

The public key of the Discord application. This is used to verify that the request is coming from Discord.

DISCORD_CLIENT_ID

The client ID of the Discord application. This is used to generate the OAuth2 URL.

DISCORD_TOKEN

The bot token of the Discord application.

DISCORD_ROLE_ID

The ID of the role that is allowed to use the slash command. Board members are intended to use this command.

DISCORD_ADMIN_ROLES

A comma-separated list of role IDs that are allowed to use the slash command. This is intended for the executive board.

GITHUB_TOKEN

The GitHub personal access token. This is used to access the GitHub API via Codemod.

PORT

Not required. The port that the server will listen on.

DEV

Not required. If set to true, the server will spin up an Ngrok tunnel and print the URL to the console. This is intended for development. Paste this URL into the Discord application's Discord interactions endpoint URL.


Programmed with ❤️ by @acmcsufoss.

About

Manage acmcsuf.com board data via Discord slash command.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published