🔗 Discord slash command URL shortener.
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.
To run the server, run the following command:
deno task start
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.
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.
To understand the usage of the slash command, refer to the source code in
bot/app/app.ts
.
- Create a Discord application.
- Create a bot for the application.
- Copy the bot token and set it as the
DISCORD_TOKEN
environment variable. - Copy the public key and set it as the
DISCORD_PUBLIC_KEY
environment variable. - Copy the client ID and set it as the
DISCORD_CLIENT_ID
environment variable. - Spin up the server. Set the Discord interactions endpoint URL to the URL of the server (Ngrok or Deno Deploy).
Refer to .env.example
for a list of environment variables that need to be set.
The public key of the Discord application. This is used to verify that the request is coming from Discord.
The client ID of the Discord application. This is used to generate the OAuth2 URL.
The bot token of the Discord application.
The ID of the role that is allowed to use the slash command. Board members are intended to use this command.
The GitHub personal access token. This is used to access the GitHub API via Codemod.
Not required. The port that the server will listen on.
Programmed with ❤️ by @acmcsufoss.