├── .env.sample ├── .github └── dependabot.yml ├── .gitignore ├── README.md ├── app.js ├── assets └── fake-icon.png ├── commands.js ├── game.js ├── package-lock.json ├── package.json ├── renovate.json └── utils.js /.env.sample: -------------------------------------------------------------------------------- 1 | APP_ID= 2 | DISCORD_TOKEN= 3 | PUBLIC_KEY= 4 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "npm" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | ignore: 8 | - dependency-name: "*" 9 | update-types: 10 | ["version-update:semver-patch", "version-update:semver-minor"] 11 | commit-message: 12 | prefix: fix 13 | prefix-development: chore 14 | include: scope 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # User-Installable app for Discord 2 | 3 | This project contains a basic example of a game integration for Discord written in JavaScript, built for the [Developing a User-Installable App tutorial](http://discord.com/developers/docs/tutorials/developing-a-user-installable-app). 4 | 5 | 6 | ## Project structure 7 | Below is a basic overview of the project structure: 8 | 9 | ``` 10 | ├── .env.sample -> sample .env file 11 | ├── app.js -> main entrypoint for the app 12 | ├── commands.js -> slash command payloads + helpers 13 | ├── game.js -> logic specific to the fake game 14 | ├── utils.js -> utility functions and enums 15 | |-- package-lock.json 16 | ├── package.json 17 | ├── README.md 18 | └── .gitignore 19 | ``` 20 | 21 | ## Running app locally 22 | 23 | Configuring the app is covered in detail in the [tutorial](http://discord.com/developers/docs/tutorials/developing-a-user-installable-app). 24 | 25 | Before you start, you'll need to install [NodeJS](https://nodejs.org/en/download/) and [create a Discord app](https://discord.com/developers/applications) with the proper configuration: 26 | 27 | ### Default Install Settings 28 | 29 | Click on the **Installation** page in your app's settings and go to the **Default Install Settings** section. 30 | 31 | For user install: 32 | - `applications.commands` 33 | 34 | For guild install: 35 | - `applications.commands` 36 | - `bot` (with Send Messages enabled) 37 | 38 | ### Privileged Gateway Intents 39 | 40 | This sample app uses a privilege intent to create a fake leaderboard. In production, you probably wouldn't need this. 41 | 42 | Click on the **Bot** page in your app's settings and go to the **Privileged Gateway Intents** section. 43 | 44 | Toggle **Server Members Intent**. 45 | 46 | ### Setup project 47 | 48 | First clone the project: 49 | ``` 50 | git clone https://github.com/discord/user-install-example.git 51 | ``` 52 | 53 | Then navigate to its directory and install dependencies: 54 | ``` 55 | cd user-install-example 56 | npm install 57 | ``` 58 | ### Get app credentials 59 | 60 | Fetch the credentials from your app's settings and add them to a `.env` file (see `.env.sample` for an example). You'll need your app ID (`APP_ID`), bot token (`DISCORD_TOKEN`), and public key (`PUBLIC_KEY`). 61 | 62 | Fetching credentials is covered in detail in the [tutorial](http://discord.com/developers/docs/tutorials/developing-a-user-installable-app). 63 | 64 | > 🔑 Environment variables can be added to the `.env` file in Glitch or when developing locally, and in the Secrets tab in Replit (the lock icon on the left). 65 | 66 | ### Install slash commands 67 | 68 | The commands for the example app are set up in `commands.js`. All of the commands in the `ALL_COMMANDS` array at the bottom of `commands.js` will be installed when you run the `register` command configured in `package.json`: 69 | 70 | ``` 71 | npm run register 72 | ``` 73 | 74 | ### Run the app 75 | 76 | After your credentials are added, go ahead and run the app: 77 | 78 | ``` 79 | node app.js 80 | ``` 81 | 82 | > ⚙️ A package [like `nodemon`](https://github.com/remy/nodemon), which watches for local changes and restarts your app, may be helpful while locally developing. 83 | 84 | ### Set up interactivity 85 | 86 | The project needs a public endpoint where Discord can send requests. To develop and test locally, you can use something like [`ngrok`](https://ngrok.com/) to tunnel HTTP traffic. 87 | 88 | Install ngrok if you haven't already, then start listening on port `3000`: 89 | 90 | ``` 91 | ngrok http 3000 92 | ``` 93 | 94 | You should see your connection open: 95 | 96 | ``` 97 | Tunnel Status online 98 | Version 2.0/2.0 99 | Web Interface http://127.0.0.1:4040 100 | Forwarding http://1234-someurl.ngrok.io -> localhost:3000 101 | Forwarding https://1234-someurl.ngrok.io -> localhost:3000 102 | 103 | Connections ttl opn rt1 rt5 p50 p90 104 | 0 0 0.00 0.00 0.00 0.00 105 | ``` 106 | 107 | Copy the forwarding address that starts with `https`, in this case `https://1234-someurl.ngrok.io`, then go to your [app's settings](https://discord.com/developers/applications). 108 | 109 | On the **General Information** tab, there will be an **Interactions Endpoint URL**. Paste your ngrok address there, and append `/interactions` to it (`https://1234-someurl.ngrok.io/interactions` in the example). 110 | 111 | Click **Save Changes**, and your app should be ready to run 🚀 112 | 113 | ## Other resources 114 | - Read **[the documentation](https://discord.com/developers/docs/intro)** for in-depth information about API features. 115 | - Browse the `examples/` folder in this project for smaller, feature-specific code examples 116 | - Join the **[Discord Developers server](https://discord.gg/discord-developers)** to ask questions about the API, attend events hosted by the Discord API team, and interact with other devs. 117 | - Check out **[community resources](https://discord.com/developers/docs/topics/community-resources#community-resources)** for language-specific tools maintained by community members. 118 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | import 'dotenv/config'; 2 | import express from 'express'; 3 | import { InteractionType, InteractionResponseType } from 'discord-interactions'; 4 | import { 5 | VerifyDiscordRequest, 6 | getServerLeaderboard, 7 | createPlayerEmbed, 8 | } from './utils.js'; 9 | import { getFakeProfile, getWikiItem } from './game.js'; 10 | 11 | // Create an express app 12 | const app = express(); 13 | // Get port, or default to 3000 14 | const PORT = process.env.PORT || 3000; 15 | // Parse request body and verifies incoming requests using discord-interactions package 16 | app.use(express.json({ verify: VerifyDiscordRequest(process.env.PUBLIC_KEY) })); 17 | 18 | /** 19 | * Interactions endpoint URL where Discord will send HTTP requests 20 | */ 21 | app.post('/interactions', async function (req, res) { 22 | // Interaction type and data 23 | const { type, data } = req.body; 24 | 25 | /** 26 | * Handle verification requests 27 | */ 28 | if (type === InteractionType.PING) { 29 | return res.send({ type: InteractionResponseType.PONG }); 30 | } 31 | 32 | // Log request bodies 33 | console.log(req.body); 34 | 35 | /** 36 | * Handle slash command requests 37 | * See https://discord.com/developers/docs/interactions/application-commands#slash-commands 38 | */ 39 | if (type === InteractionType.APPLICATION_COMMAND) { 40 | const { name } = data; 41 | 42 | // "leaderboard" command 43 | if (name === 'leaderboard') { 44 | // Send a message into the channel where command was triggered from 45 | return res.send({ 46 | type: InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE, 47 | data: { 48 | content: await getServerLeaderboard(req.body.guild.id), 49 | allowed_mentions: { 50 | parse: [], 51 | }, 52 | }, 53 | }); 54 | } 55 | // "profile" command 56 | if (name === 'profile') { 57 | const profile = getFakeProfile(0); 58 | const profileEmbed = createPlayerEmbed(profile); 59 | 60 | // Use interaction context that the interaction was triggered from 61 | const interactionContext = req.body.context; 62 | 63 | // Construct `data` for our interaction response. The profile embed will be included regardless of interaction context 64 | let profilePayloadData = { 65 | embeds: [profileEmbed], 66 | }; 67 | 68 | // If profile isn't run in a DM with the app, we'll make the response ephemeral and add a share button 69 | if (interactionContext !== 1) { 70 | // Make message ephemeral 71 | profilePayloadData['flags'] = 64; 72 | // Add button to components 73 | profilePayloadData['components'] = [ 74 | { 75 | type: 1, 76 | components: [ 77 | { 78 | type: 2, 79 | label: 'Share Profile', 80 | custom_id: 'share_profile', 81 | style: 2, 82 | }, 83 | ], 84 | }, 85 | ]; 86 | } 87 | 88 | // Send response 89 | return res.send({ 90 | type: InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE, 91 | data: profilePayloadData, 92 | }); 93 | } 94 | // "link" command 95 | if (name === 'link') { 96 | // Send a message into the channel where command was triggered from 97 | return res.send({ 98 | type: InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE, 99 | data: { 100 | content: 101 | 'Authorize your Quests of Wumpus account with your Discord profile.', 102 | components: [ 103 | { 104 | type: 1, 105 | components: [ 106 | { 107 | type: 2, 108 | label: 'Link Account', 109 | style: 5, 110 | // If you were building this functionality, you could guide the user through authorizing via your game/site 111 | url: 'https://discord.com/developers/docs/intro', 112 | }, 113 | ], 114 | }, 115 | ], 116 | }, 117 | }); 118 | } 119 | // "wiki" command 120 | if (name === 'wiki') { 121 | const option = data.options[0]; 122 | const selectedItem = getWikiItem(option.value); 123 | // Send a message into the channel where command was triggered from 124 | return res.send({ 125 | type: InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE, 126 | data: { 127 | content: `${selectedItem.emoji} **${selectedItem.name}**: ${selectedItem.description}`, 128 | }, 129 | }); 130 | } 131 | } 132 | 133 | // handle button interaction 134 | if (type === InteractionType.MESSAGE_COMPONENT) { 135 | const profile = getFakeProfile(0); 136 | const profileEmbed = createPlayerEmbed(profile); 137 | return res.send({ 138 | type: InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE, 139 | data: { 140 | embeds: [profileEmbed], 141 | }, 142 | }); 143 | } 144 | }); 145 | 146 | app.listen(PORT, () => { 147 | console.log('Listening on port', PORT); 148 | }); 149 | -------------------------------------------------------------------------------- /assets/fake-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/discord/user-install-example/9d09557cc6ed1a80a3e5735210b96da4264ec76b/assets/fake-icon.png -------------------------------------------------------------------------------- /commands.js: -------------------------------------------------------------------------------- 1 | import 'dotenv/config'; 2 | import { fakeGameItems } from './game.js'; 3 | import { InstallGlobalCommands } from './utils.js'; 4 | 5 | // Wiki command for game lookup 6 | const WIKI_COMMAND = { 7 | name: 'wiki', 8 | type: 1, 9 | description: 'Lookup information in wiki', 10 | options: [ 11 | { 12 | type: 3, 13 | name: 'item', 14 | description: 'Item to lookup', 15 | choices: fakeGameItems, 16 | required: true, 17 | }, 18 | ], 19 | integration_types: [0, 1], 20 | contexts: [0, 1, 2], 21 | }; 22 | 23 | // Leaderboard command, for guild install only 24 | const LEADERBOARD_COMMAND = { 25 | name: 'leaderboard', 26 | type: 1, 27 | description: 'See server leaderboard', 28 | integration_types: [0], 29 | contexts: [0], 30 | }; 31 | 32 | // Profile command 33 | const PROFILE_COMMAND = { 34 | name: 'profile', 35 | type: 1, 36 | description: 'See your game inventory and progress', 37 | integration_types: [1], 38 | contexts: [0, 1, 2], 39 | }; 40 | 41 | // Link account command 42 | const LINK_COMMAND = { 43 | name: 'link', 44 | type: 1, 45 | description: 'Link your Quests of Wumpus account with your Discord profile', 46 | integration_types: [1], 47 | contexts: [1], 48 | }; 49 | 50 | const ALL_COMMANDS = [ 51 | WIKI_COMMAND, 52 | LEADERBOARD_COMMAND, 53 | PROFILE_COMMAND, 54 | LINK_COMMAND, 55 | ]; 56 | 57 | InstallGlobalCommands(process.env.APP_ID, ALL_COMMANDS); 58 | -------------------------------------------------------------------------------- /game.js: -------------------------------------------------------------------------------- 1 | export function getFakeProfile(p) { 2 | const position = p 3 | ? p 4 | : Math.floor(Math.random() * fakePlayerProfiles.length); 5 | return fakePlayerProfiles[position]; 6 | } 7 | 8 | export function getFakeUsername(p) { 9 | const position = p 10 | ? p 11 | : Math.floor(Math.random() * fakePlayerProfiles.length); 12 | return fakePlayerProfiles[position].username; 13 | } 14 | 15 | export function getWikiItem(value) { 16 | return fakeGameItems.find((el) => el.value === value); 17 | } 18 | 19 | // fake profile data for game 20 | export const fakePlayerProfiles = [ 21 | { 22 | username: 'WumpusWhisperer', 23 | createdAt: '01/21/2023', 24 | lastPlayed: '02/28/2024', 25 | stats: { 26 | level: '14', 27 | wins: '72', 28 | losses: '28', 29 | realms: '8', 30 | rank: '1743', 31 | }, 32 | }, 33 | { 34 | username: 'PuzzledPetal22', 35 | createdAt: '06/11/2022', 36 | lastPlayed: '02/27/2024', 37 | stats: { 38 | level: '6', 39 | wins: '18', 40 | losses: '82', 41 | realms: '4', 42 | rank: '6239', 43 | }, 44 | }, 45 | { 46 | username: 'ShadowChaserX', 47 | createdAt: '09/03/2023', 48 | lastPlayed: '03/01/2024', 49 | stats: { 50 | level: '11', 51 | wins: '54', 52 | losses: '46', 53 | realms: '7', 54 | rank: '3921', 55 | }, 56 | }, 57 | { 58 | username: 'RainbowRider99', 59 | createdAt: '04/17/2022', 60 | lastPlayed: '02/26/2024', 61 | stats: { 62 | level: '3', 63 | wins: '9', 64 | losses: '91', 65 | realms: '2', 66 | rank: '8105', 67 | }, 68 | }, 69 | { 70 | username: 'MysticExplorer23', 71 | createdAt: '12/05/2023', 72 | lastPlayed: '03/02/2024', 73 | stats: { 74 | level: '17', 75 | wins: '105', 76 | losses: '15', 77 | realms: '11', 78 | rank: '2468', 79 | }, 80 | }, 81 | { 82 | username: 'VelvetVoyager', 83 | createdAt: '08/19/2022', 84 | lastPlayed: '02/29/2024', 85 | stats: { 86 | level: '9', 87 | wins: '36', 88 | losses: '64', 89 | realms: '6', 90 | rank: '5743', 91 | }, 92 | }, 93 | { 94 | username: 'LuminousLoreLad', 95 | createdAt: '10/14/2023', 96 | lastPlayed: '03/03/2024', 97 | stats: { 98 | level: '13', 99 | wins: '63', 100 | losses: '37', 101 | realms: '9', 102 | rank: '4327', 103 | }, 104 | }, 105 | ]; 106 | 107 | // fake items with descriptions for our lil game 108 | export const fakeGameItems = [ 109 | { 110 | name: 'Map', 111 | value: 'item_map', 112 | emoji: ':map:', 113 | description: 'A detailed map that reveals hidden paths and secret locations' 114 | }, 115 | { 116 | name: `Wumpus' Feather`, 117 | value: 'item_feather', 118 | emoji: ':feather:', 119 | description: 'A rare and magical feather, said to bring good luck to those who possess it' 120 | }, 121 | { 122 | name: 'Glowing Orb', 123 | value: 'item_orb', 124 | emoji: ':crystal_ball:', 125 | description: 'A mysterious orb that guides players towards their next quest' 126 | }, 127 | { 128 | name: 'Soothing Tonic', 129 | value: 'item_tonic', 130 | emoji: ':teapot:', 131 | description: 'A healing tonic that restores health and provides a brief speed boost to the player\'s character' 132 | }, 133 | { 134 | name: 'Luminous Crystal', 135 | value: 'item_crystal', 136 | emoji: ':rock:', 137 | description: 'A radiant crystal that illuminates dark areas and wards off shadows' 138 | }, 139 | { 140 | name: 'Celestial Key', 141 | value: 'item_key', 142 | emoji: ':key:', 143 | description: 'Unlocks hidden portals to secret realms' 144 | }, 145 | { 146 | name: 'Dreamcatcher Amulet', 147 | value: 'item_amulet', 148 | emoji: ':nazar_amulet:', 149 | description: 'Protects from nightmares and negative effects during rest periods' 150 | } 151 | ]; 152 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "getting-started", 3 | "version": "1.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "getting-started", 9 | "version": "1.0.0", 10 | "license": "MIT", 11 | "dependencies": { 12 | "discord-interactions": "^3.2.0", 13 | "dotenv": "^16.0.3", 14 | "express": "^4.18.2" 15 | }, 16 | "devDependencies": { 17 | "nodemon": "^3.1.0" 18 | }, 19 | "engines": { 20 | "node": ">=20.x" 21 | } 22 | }, 23 | "node_modules/abbrev": { 24 | "version": "1.1.1", 25 | "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", 26 | "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", 27 | "dev": true 28 | }, 29 | "node_modules/accepts": { 30 | "version": "1.3.8", 31 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", 32 | "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", 33 | "dependencies": { 34 | "mime-types": "~2.1.34", 35 | "negotiator": "0.6.3" 36 | }, 37 | "engines": { 38 | "node": ">= 0.6" 39 | } 40 | }, 41 | "node_modules/anymatch": { 42 | "version": "3.1.3", 43 | "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", 44 | "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", 45 | "dev": true, 46 | "dependencies": { 47 | "normalize-path": "^3.0.0", 48 | "picomatch": "^2.0.4" 49 | }, 50 | "engines": { 51 | "node": ">= 8" 52 | } 53 | }, 54 | "node_modules/array-flatten": { 55 | "version": "1.1.1", 56 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 57 | "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" 58 | }, 59 | "node_modules/balanced-match": { 60 | "version": "1.0.2", 61 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 62 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 63 | "dev": true 64 | }, 65 | "node_modules/binary-extensions": { 66 | "version": "2.3.0", 67 | "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", 68 | "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", 69 | "dev": true, 70 | "engines": { 71 | "node": ">=8" 72 | }, 73 | "funding": { 74 | "url": "https://github.com/sponsors/sindresorhus" 75 | } 76 | }, 77 | "node_modules/body-parser": { 78 | "version": "1.20.2", 79 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", 80 | "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", 81 | "dependencies": { 82 | "bytes": "3.1.2", 83 | "content-type": "~1.0.5", 84 | "debug": "2.6.9", 85 | "depd": "2.0.0", 86 | "destroy": "1.2.0", 87 | "http-errors": "2.0.0", 88 | "iconv-lite": "0.4.24", 89 | "on-finished": "2.4.1", 90 | "qs": "6.11.0", 91 | "raw-body": "2.5.2", 92 | "type-is": "~1.6.18", 93 | "unpipe": "1.0.0" 94 | }, 95 | "engines": { 96 | "node": ">= 0.8", 97 | "npm": "1.2.8000 || >= 1.4.16" 98 | } 99 | }, 100 | "node_modules/brace-expansion": { 101 | "version": "1.1.11", 102 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 103 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 104 | "dev": true, 105 | "dependencies": { 106 | "balanced-match": "^1.0.0", 107 | "concat-map": "0.0.1" 108 | } 109 | }, 110 | "node_modules/braces": { 111 | "version": "3.0.2", 112 | "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", 113 | "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", 114 | "dev": true, 115 | "dependencies": { 116 | "fill-range": "^7.0.1" 117 | }, 118 | "engines": { 119 | "node": ">=8" 120 | } 121 | }, 122 | "node_modules/bytes": { 123 | "version": "3.1.2", 124 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", 125 | "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", 126 | "engines": { 127 | "node": ">= 0.8" 128 | } 129 | }, 130 | "node_modules/call-bind": { 131 | "version": "1.0.7", 132 | "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", 133 | "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", 134 | "dependencies": { 135 | "es-define-property": "^1.0.0", 136 | "es-errors": "^1.3.0", 137 | "function-bind": "^1.1.2", 138 | "get-intrinsic": "^1.2.4", 139 | "set-function-length": "^1.2.1" 140 | }, 141 | "engines": { 142 | "node": ">= 0.4" 143 | }, 144 | "funding": { 145 | "url": "https://github.com/sponsors/ljharb" 146 | } 147 | }, 148 | "node_modules/chokidar": { 149 | "version": "3.6.0", 150 | "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", 151 | "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", 152 | "dev": true, 153 | "dependencies": { 154 | "anymatch": "~3.1.2", 155 | "braces": "~3.0.2", 156 | "glob-parent": "~5.1.2", 157 | "is-binary-path": "~2.1.0", 158 | "is-glob": "~4.0.1", 159 | "normalize-path": "~3.0.0", 160 | "readdirp": "~3.6.0" 161 | }, 162 | "engines": { 163 | "node": ">= 8.10.0" 164 | }, 165 | "funding": { 166 | "url": "https://paulmillr.com/funding/" 167 | }, 168 | "optionalDependencies": { 169 | "fsevents": "~2.3.2" 170 | } 171 | }, 172 | "node_modules/concat-map": { 173 | "version": "0.0.1", 174 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 175 | "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", 176 | "dev": true 177 | }, 178 | "node_modules/content-disposition": { 179 | "version": "0.5.4", 180 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", 181 | "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", 182 | "dependencies": { 183 | "safe-buffer": "5.2.1" 184 | }, 185 | "engines": { 186 | "node": ">= 0.6" 187 | } 188 | }, 189 | "node_modules/content-type": { 190 | "version": "1.0.5", 191 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", 192 | "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", 193 | "engines": { 194 | "node": ">= 0.6" 195 | } 196 | }, 197 | "node_modules/cookie": { 198 | "version": "0.6.0", 199 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", 200 | "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", 201 | "engines": { 202 | "node": ">= 0.6" 203 | } 204 | }, 205 | "node_modules/cookie-signature": { 206 | "version": "1.0.6", 207 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 208 | "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" 209 | }, 210 | "node_modules/debug": { 211 | "version": "2.6.9", 212 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 213 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 214 | "dependencies": { 215 | "ms": "2.0.0" 216 | } 217 | }, 218 | "node_modules/define-data-property": { 219 | "version": "1.1.4", 220 | "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", 221 | "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", 222 | "dependencies": { 223 | "es-define-property": "^1.0.0", 224 | "es-errors": "^1.3.0", 225 | "gopd": "^1.0.1" 226 | }, 227 | "engines": { 228 | "node": ">= 0.4" 229 | }, 230 | "funding": { 231 | "url": "https://github.com/sponsors/ljharb" 232 | } 233 | }, 234 | "node_modules/depd": { 235 | "version": "2.0.0", 236 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 237 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", 238 | "engines": { 239 | "node": ">= 0.8" 240 | } 241 | }, 242 | "node_modules/destroy": { 243 | "version": "1.2.0", 244 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", 245 | "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", 246 | "engines": { 247 | "node": ">= 0.8", 248 | "npm": "1.2.8000 || >= 1.4.16" 249 | } 250 | }, 251 | "node_modules/discord-interactions": { 252 | "version": "3.4.0", 253 | "resolved": "https://registry.npmjs.org/discord-interactions/-/discord-interactions-3.4.0.tgz", 254 | "integrity": "sha512-DG0Jxdd/FcK8liAPhIP4u5YHpnz50JWn9DK4OavxsLD49/WGimXtP3EdOY439MaWyCgQfsfFkA1GsTEyu63RzA==", 255 | "dependencies": { 256 | "tweetnacl": "^1.0.3" 257 | }, 258 | "engines": { 259 | "node": ">=12" 260 | } 261 | }, 262 | "node_modules/dotenv": { 263 | "version": "16.4.5", 264 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", 265 | "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", 266 | "engines": { 267 | "node": ">=12" 268 | }, 269 | "funding": { 270 | "url": "https://dotenvx.com" 271 | } 272 | }, 273 | "node_modules/ee-first": { 274 | "version": "1.1.1", 275 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 276 | "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" 277 | }, 278 | "node_modules/encodeurl": { 279 | "version": "1.0.2", 280 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 281 | "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", 282 | "engines": { 283 | "node": ">= 0.8" 284 | } 285 | }, 286 | "node_modules/es-define-property": { 287 | "version": "1.0.0", 288 | "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", 289 | "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", 290 | "dependencies": { 291 | "get-intrinsic": "^1.2.4" 292 | }, 293 | "engines": { 294 | "node": ">= 0.4" 295 | } 296 | }, 297 | "node_modules/es-errors": { 298 | "version": "1.3.0", 299 | "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", 300 | "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", 301 | "engines": { 302 | "node": ">= 0.4" 303 | } 304 | }, 305 | "node_modules/escape-html": { 306 | "version": "1.0.3", 307 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 308 | "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" 309 | }, 310 | "node_modules/etag": { 311 | "version": "1.8.1", 312 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 313 | "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", 314 | "engines": { 315 | "node": ">= 0.6" 316 | } 317 | }, 318 | "node_modules/express": { 319 | "version": "4.19.2", 320 | "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", 321 | "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", 322 | "dependencies": { 323 | "accepts": "~1.3.8", 324 | "array-flatten": "1.1.1", 325 | "body-parser": "1.20.2", 326 | "content-disposition": "0.5.4", 327 | "content-type": "~1.0.4", 328 | "cookie": "0.6.0", 329 | "cookie-signature": "1.0.6", 330 | "debug": "2.6.9", 331 | "depd": "2.0.0", 332 | "encodeurl": "~1.0.2", 333 | "escape-html": "~1.0.3", 334 | "etag": "~1.8.1", 335 | "finalhandler": "1.2.0", 336 | "fresh": "0.5.2", 337 | "http-errors": "2.0.0", 338 | "merge-descriptors": "1.0.1", 339 | "methods": "~1.1.2", 340 | "on-finished": "2.4.1", 341 | "parseurl": "~1.3.3", 342 | "path-to-regexp": "0.1.7", 343 | "proxy-addr": "~2.0.7", 344 | "qs": "6.11.0", 345 | "range-parser": "~1.2.1", 346 | "safe-buffer": "5.2.1", 347 | "send": "0.18.0", 348 | "serve-static": "1.15.0", 349 | "setprototypeof": "1.2.0", 350 | "statuses": "2.0.1", 351 | "type-is": "~1.6.18", 352 | "utils-merge": "1.0.1", 353 | "vary": "~1.1.2" 354 | }, 355 | "engines": { 356 | "node": ">= 0.10.0" 357 | } 358 | }, 359 | "node_modules/fill-range": { 360 | "version": "7.0.1", 361 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", 362 | "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", 363 | "dev": true, 364 | "dependencies": { 365 | "to-regex-range": "^5.0.1" 366 | }, 367 | "engines": { 368 | "node": ">=8" 369 | } 370 | }, 371 | "node_modules/finalhandler": { 372 | "version": "1.2.0", 373 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", 374 | "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", 375 | "dependencies": { 376 | "debug": "2.6.9", 377 | "encodeurl": "~1.0.2", 378 | "escape-html": "~1.0.3", 379 | "on-finished": "2.4.1", 380 | "parseurl": "~1.3.3", 381 | "statuses": "2.0.1", 382 | "unpipe": "~1.0.0" 383 | }, 384 | "engines": { 385 | "node": ">= 0.8" 386 | } 387 | }, 388 | "node_modules/forwarded": { 389 | "version": "0.2.0", 390 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", 391 | "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", 392 | "engines": { 393 | "node": ">= 0.6" 394 | } 395 | }, 396 | "node_modules/fresh": { 397 | "version": "0.5.2", 398 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 399 | "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", 400 | "engines": { 401 | "node": ">= 0.6" 402 | } 403 | }, 404 | "node_modules/fsevents": { 405 | "version": "2.3.3", 406 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", 407 | "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", 408 | "dev": true, 409 | "hasInstallScript": true, 410 | "optional": true, 411 | "os": [ 412 | "darwin" 413 | ], 414 | "engines": { 415 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 416 | } 417 | }, 418 | "node_modules/function-bind": { 419 | "version": "1.1.2", 420 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", 421 | "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", 422 | "funding": { 423 | "url": "https://github.com/sponsors/ljharb" 424 | } 425 | }, 426 | "node_modules/get-intrinsic": { 427 | "version": "1.2.4", 428 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", 429 | "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", 430 | "dependencies": { 431 | "es-errors": "^1.3.0", 432 | "function-bind": "^1.1.2", 433 | "has-proto": "^1.0.1", 434 | "has-symbols": "^1.0.3", 435 | "hasown": "^2.0.0" 436 | }, 437 | "engines": { 438 | "node": ">= 0.4" 439 | }, 440 | "funding": { 441 | "url": "https://github.com/sponsors/ljharb" 442 | } 443 | }, 444 | "node_modules/glob-parent": { 445 | "version": "5.1.2", 446 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 447 | "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", 448 | "dev": true, 449 | "dependencies": { 450 | "is-glob": "^4.0.1" 451 | }, 452 | "engines": { 453 | "node": ">= 6" 454 | } 455 | }, 456 | "node_modules/gopd": { 457 | "version": "1.0.1", 458 | "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", 459 | "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", 460 | "dependencies": { 461 | "get-intrinsic": "^1.1.3" 462 | }, 463 | "funding": { 464 | "url": "https://github.com/sponsors/ljharb" 465 | } 466 | }, 467 | "node_modules/has-flag": { 468 | "version": "3.0.0", 469 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 470 | "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", 471 | "dev": true, 472 | "engines": { 473 | "node": ">=4" 474 | } 475 | }, 476 | "node_modules/has-property-descriptors": { 477 | "version": "1.0.2", 478 | "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", 479 | "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", 480 | "dependencies": { 481 | "es-define-property": "^1.0.0" 482 | }, 483 | "funding": { 484 | "url": "https://github.com/sponsors/ljharb" 485 | } 486 | }, 487 | "node_modules/has-proto": { 488 | "version": "1.0.3", 489 | "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", 490 | "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", 491 | "engines": { 492 | "node": ">= 0.4" 493 | }, 494 | "funding": { 495 | "url": "https://github.com/sponsors/ljharb" 496 | } 497 | }, 498 | "node_modules/has-symbols": { 499 | "version": "1.0.3", 500 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", 501 | "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", 502 | "engines": { 503 | "node": ">= 0.4" 504 | }, 505 | "funding": { 506 | "url": "https://github.com/sponsors/ljharb" 507 | } 508 | }, 509 | "node_modules/hasown": { 510 | "version": "2.0.2", 511 | "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", 512 | "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", 513 | "dependencies": { 514 | "function-bind": "^1.1.2" 515 | }, 516 | "engines": { 517 | "node": ">= 0.4" 518 | } 519 | }, 520 | "node_modules/http-errors": { 521 | "version": "2.0.0", 522 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 523 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 524 | "dependencies": { 525 | "depd": "2.0.0", 526 | "inherits": "2.0.4", 527 | "setprototypeof": "1.2.0", 528 | "statuses": "2.0.1", 529 | "toidentifier": "1.0.1" 530 | }, 531 | "engines": { 532 | "node": ">= 0.8" 533 | } 534 | }, 535 | "node_modules/iconv-lite": { 536 | "version": "0.4.24", 537 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 538 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 539 | "dependencies": { 540 | "safer-buffer": ">= 2.1.2 < 3" 541 | }, 542 | "engines": { 543 | "node": ">=0.10.0" 544 | } 545 | }, 546 | "node_modules/ignore-by-default": { 547 | "version": "1.0.1", 548 | "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", 549 | "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", 550 | "dev": true 551 | }, 552 | "node_modules/inherits": { 553 | "version": "2.0.4", 554 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 555 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 556 | }, 557 | "node_modules/ipaddr.js": { 558 | "version": "1.9.1", 559 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 560 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", 561 | "engines": { 562 | "node": ">= 0.10" 563 | } 564 | }, 565 | "node_modules/is-binary-path": { 566 | "version": "2.1.0", 567 | "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", 568 | "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", 569 | "dev": true, 570 | "dependencies": { 571 | "binary-extensions": "^2.0.0" 572 | }, 573 | "engines": { 574 | "node": ">=8" 575 | } 576 | }, 577 | "node_modules/is-extglob": { 578 | "version": "2.1.1", 579 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 580 | "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", 581 | "dev": true, 582 | "engines": { 583 | "node": ">=0.10.0" 584 | } 585 | }, 586 | "node_modules/is-glob": { 587 | "version": "4.0.3", 588 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", 589 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 590 | "dev": true, 591 | "dependencies": { 592 | "is-extglob": "^2.1.1" 593 | }, 594 | "engines": { 595 | "node": ">=0.10.0" 596 | } 597 | }, 598 | "node_modules/is-number": { 599 | "version": "7.0.0", 600 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 601 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", 602 | "dev": true, 603 | "engines": { 604 | "node": ">=0.12.0" 605 | } 606 | }, 607 | "node_modules/lru-cache": { 608 | "version": "6.0.0", 609 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", 610 | "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", 611 | "dev": true, 612 | "dependencies": { 613 | "yallist": "^4.0.0" 614 | }, 615 | "engines": { 616 | "node": ">=10" 617 | } 618 | }, 619 | "node_modules/media-typer": { 620 | "version": "0.3.0", 621 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 622 | "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", 623 | "engines": { 624 | "node": ">= 0.6" 625 | } 626 | }, 627 | "node_modules/merge-descriptors": { 628 | "version": "1.0.1", 629 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 630 | "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" 631 | }, 632 | "node_modules/methods": { 633 | "version": "1.1.2", 634 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 635 | "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", 636 | "engines": { 637 | "node": ">= 0.6" 638 | } 639 | }, 640 | "node_modules/mime": { 641 | "version": "1.6.0", 642 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 643 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", 644 | "bin": { 645 | "mime": "cli.js" 646 | }, 647 | "engines": { 648 | "node": ">=4" 649 | } 650 | }, 651 | "node_modules/mime-db": { 652 | "version": "1.52.0", 653 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 654 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", 655 | "engines": { 656 | "node": ">= 0.6" 657 | } 658 | }, 659 | "node_modules/mime-types": { 660 | "version": "2.1.35", 661 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 662 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 663 | "dependencies": { 664 | "mime-db": "1.52.0" 665 | }, 666 | "engines": { 667 | "node": ">= 0.6" 668 | } 669 | }, 670 | "node_modules/minimatch": { 671 | "version": "3.1.2", 672 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 673 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 674 | "dev": true, 675 | "dependencies": { 676 | "brace-expansion": "^1.1.7" 677 | }, 678 | "engines": { 679 | "node": "*" 680 | } 681 | }, 682 | "node_modules/ms": { 683 | "version": "2.0.0", 684 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 685 | "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" 686 | }, 687 | "node_modules/negotiator": { 688 | "version": "0.6.3", 689 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", 690 | "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", 691 | "engines": { 692 | "node": ">= 0.6" 693 | } 694 | }, 695 | "node_modules/nodemon": { 696 | "version": "3.1.0", 697 | "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.0.tgz", 698 | "integrity": "sha512-xqlktYlDMCepBJd43ZQhjWwMw2obW/JRvkrLxq5RCNcuDDX1DbcPT+qT1IlIIdf+DhnWs90JpTMe+Y5KxOchvA==", 699 | "dev": true, 700 | "dependencies": { 701 | "chokidar": "^3.5.2", 702 | "debug": "^4", 703 | "ignore-by-default": "^1.0.1", 704 | "minimatch": "^3.1.2", 705 | "pstree.remy": "^1.1.8", 706 | "semver": "^7.5.3", 707 | "simple-update-notifier": "^2.0.0", 708 | "supports-color": "^5.5.0", 709 | "touch": "^3.1.0", 710 | "undefsafe": "^2.0.5" 711 | }, 712 | "bin": { 713 | "nodemon": "bin/nodemon.js" 714 | }, 715 | "engines": { 716 | "node": ">=10" 717 | }, 718 | "funding": { 719 | "type": "opencollective", 720 | "url": "https://opencollective.com/nodemon" 721 | } 722 | }, 723 | "node_modules/nodemon/node_modules/debug": { 724 | "version": "4.3.4", 725 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", 726 | "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", 727 | "dev": true, 728 | "dependencies": { 729 | "ms": "2.1.2" 730 | }, 731 | "engines": { 732 | "node": ">=6.0" 733 | }, 734 | "peerDependenciesMeta": { 735 | "supports-color": { 736 | "optional": true 737 | } 738 | } 739 | }, 740 | "node_modules/nodemon/node_modules/ms": { 741 | "version": "2.1.2", 742 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 743 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", 744 | "dev": true 745 | }, 746 | "node_modules/nopt": { 747 | "version": "1.0.10", 748 | "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", 749 | "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", 750 | "dev": true, 751 | "dependencies": { 752 | "abbrev": "1" 753 | }, 754 | "bin": { 755 | "nopt": "bin/nopt.js" 756 | }, 757 | "engines": { 758 | "node": "*" 759 | } 760 | }, 761 | "node_modules/normalize-path": { 762 | "version": "3.0.0", 763 | "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", 764 | "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", 765 | "dev": true, 766 | "engines": { 767 | "node": ">=0.10.0" 768 | } 769 | }, 770 | "node_modules/object-inspect": { 771 | "version": "1.13.1", 772 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", 773 | "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", 774 | "funding": { 775 | "url": "https://github.com/sponsors/ljharb" 776 | } 777 | }, 778 | "node_modules/on-finished": { 779 | "version": "2.4.1", 780 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", 781 | "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", 782 | "dependencies": { 783 | "ee-first": "1.1.1" 784 | }, 785 | "engines": { 786 | "node": ">= 0.8" 787 | } 788 | }, 789 | "node_modules/parseurl": { 790 | "version": "1.3.3", 791 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 792 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", 793 | "engines": { 794 | "node": ">= 0.8" 795 | } 796 | }, 797 | "node_modules/path-to-regexp": { 798 | "version": "0.1.7", 799 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 800 | "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" 801 | }, 802 | "node_modules/picomatch": { 803 | "version": "2.3.1", 804 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 805 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", 806 | "dev": true, 807 | "engines": { 808 | "node": ">=8.6" 809 | }, 810 | "funding": { 811 | "url": "https://github.com/sponsors/jonschlinkert" 812 | } 813 | }, 814 | "node_modules/proxy-addr": { 815 | "version": "2.0.7", 816 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", 817 | "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", 818 | "dependencies": { 819 | "forwarded": "0.2.0", 820 | "ipaddr.js": "1.9.1" 821 | }, 822 | "engines": { 823 | "node": ">= 0.10" 824 | } 825 | }, 826 | "node_modules/pstree.remy": { 827 | "version": "1.1.8", 828 | "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", 829 | "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", 830 | "dev": true 831 | }, 832 | "node_modules/qs": { 833 | "version": "6.11.0", 834 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", 835 | "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", 836 | "dependencies": { 837 | "side-channel": "^1.0.4" 838 | }, 839 | "engines": { 840 | "node": ">=0.6" 841 | }, 842 | "funding": { 843 | "url": "https://github.com/sponsors/ljharb" 844 | } 845 | }, 846 | "node_modules/range-parser": { 847 | "version": "1.2.1", 848 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 849 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", 850 | "engines": { 851 | "node": ">= 0.6" 852 | } 853 | }, 854 | "node_modules/raw-body": { 855 | "version": "2.5.2", 856 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", 857 | "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", 858 | "dependencies": { 859 | "bytes": "3.1.2", 860 | "http-errors": "2.0.0", 861 | "iconv-lite": "0.4.24", 862 | "unpipe": "1.0.0" 863 | }, 864 | "engines": { 865 | "node": ">= 0.8" 866 | } 867 | }, 868 | "node_modules/readdirp": { 869 | "version": "3.6.0", 870 | "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", 871 | "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", 872 | "dev": true, 873 | "dependencies": { 874 | "picomatch": "^2.2.1" 875 | }, 876 | "engines": { 877 | "node": ">=8.10.0" 878 | } 879 | }, 880 | "node_modules/safe-buffer": { 881 | "version": "5.2.1", 882 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 883 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 884 | "funding": [ 885 | { 886 | "type": "github", 887 | "url": "https://github.com/sponsors/feross" 888 | }, 889 | { 890 | "type": "patreon", 891 | "url": "https://www.patreon.com/feross" 892 | }, 893 | { 894 | "type": "consulting", 895 | "url": "https://feross.org/support" 896 | } 897 | ] 898 | }, 899 | "node_modules/safer-buffer": { 900 | "version": "2.1.2", 901 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 902 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 903 | }, 904 | "node_modules/semver": { 905 | "version": "7.6.0", 906 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", 907 | "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", 908 | "dev": true, 909 | "dependencies": { 910 | "lru-cache": "^6.0.0" 911 | }, 912 | "bin": { 913 | "semver": "bin/semver.js" 914 | }, 915 | "engines": { 916 | "node": ">=10" 917 | } 918 | }, 919 | "node_modules/send": { 920 | "version": "0.18.0", 921 | "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", 922 | "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", 923 | "dependencies": { 924 | "debug": "2.6.9", 925 | "depd": "2.0.0", 926 | "destroy": "1.2.0", 927 | "encodeurl": "~1.0.2", 928 | "escape-html": "~1.0.3", 929 | "etag": "~1.8.1", 930 | "fresh": "0.5.2", 931 | "http-errors": "2.0.0", 932 | "mime": "1.6.0", 933 | "ms": "2.1.3", 934 | "on-finished": "2.4.1", 935 | "range-parser": "~1.2.1", 936 | "statuses": "2.0.1" 937 | }, 938 | "engines": { 939 | "node": ">= 0.8.0" 940 | } 941 | }, 942 | "node_modules/send/node_modules/ms": { 943 | "version": "2.1.3", 944 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 945 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 946 | }, 947 | "node_modules/serve-static": { 948 | "version": "1.15.0", 949 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", 950 | "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", 951 | "dependencies": { 952 | "encodeurl": "~1.0.2", 953 | "escape-html": "~1.0.3", 954 | "parseurl": "~1.3.3", 955 | "send": "0.18.0" 956 | }, 957 | "engines": { 958 | "node": ">= 0.8.0" 959 | } 960 | }, 961 | "node_modules/set-function-length": { 962 | "version": "1.2.2", 963 | "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", 964 | "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", 965 | "dependencies": { 966 | "define-data-property": "^1.1.4", 967 | "es-errors": "^1.3.0", 968 | "function-bind": "^1.1.2", 969 | "get-intrinsic": "^1.2.4", 970 | "gopd": "^1.0.1", 971 | "has-property-descriptors": "^1.0.2" 972 | }, 973 | "engines": { 974 | "node": ">= 0.4" 975 | } 976 | }, 977 | "node_modules/setprototypeof": { 978 | "version": "1.2.0", 979 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 980 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" 981 | }, 982 | "node_modules/side-channel": { 983 | "version": "1.0.6", 984 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", 985 | "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", 986 | "dependencies": { 987 | "call-bind": "^1.0.7", 988 | "es-errors": "^1.3.0", 989 | "get-intrinsic": "^1.2.4", 990 | "object-inspect": "^1.13.1" 991 | }, 992 | "engines": { 993 | "node": ">= 0.4" 994 | }, 995 | "funding": { 996 | "url": "https://github.com/sponsors/ljharb" 997 | } 998 | }, 999 | "node_modules/simple-update-notifier": { 1000 | "version": "2.0.0", 1001 | "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", 1002 | "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", 1003 | "dev": true, 1004 | "dependencies": { 1005 | "semver": "^7.5.3" 1006 | }, 1007 | "engines": { 1008 | "node": ">=10" 1009 | } 1010 | }, 1011 | "node_modules/statuses": { 1012 | "version": "2.0.1", 1013 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 1014 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", 1015 | "engines": { 1016 | "node": ">= 0.8" 1017 | } 1018 | }, 1019 | "node_modules/supports-color": { 1020 | "version": "5.5.0", 1021 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 1022 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 1023 | "dev": true, 1024 | "dependencies": { 1025 | "has-flag": "^3.0.0" 1026 | }, 1027 | "engines": { 1028 | "node": ">=4" 1029 | } 1030 | }, 1031 | "node_modules/to-regex-range": { 1032 | "version": "5.0.1", 1033 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 1034 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 1035 | "dev": true, 1036 | "dependencies": { 1037 | "is-number": "^7.0.0" 1038 | }, 1039 | "engines": { 1040 | "node": ">=8.0" 1041 | } 1042 | }, 1043 | "node_modules/toidentifier": { 1044 | "version": "1.0.1", 1045 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", 1046 | "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", 1047 | "engines": { 1048 | "node": ">=0.6" 1049 | } 1050 | }, 1051 | "node_modules/touch": { 1052 | "version": "3.1.0", 1053 | "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", 1054 | "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", 1055 | "dev": true, 1056 | "dependencies": { 1057 | "nopt": "~1.0.10" 1058 | }, 1059 | "bin": { 1060 | "nodetouch": "bin/nodetouch.js" 1061 | } 1062 | }, 1063 | "node_modules/tweetnacl": { 1064 | "version": "1.0.3", 1065 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", 1066 | "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" 1067 | }, 1068 | "node_modules/type-is": { 1069 | "version": "1.6.18", 1070 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 1071 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 1072 | "dependencies": { 1073 | "media-typer": "0.3.0", 1074 | "mime-types": "~2.1.24" 1075 | }, 1076 | "engines": { 1077 | "node": ">= 0.6" 1078 | } 1079 | }, 1080 | "node_modules/undefsafe": { 1081 | "version": "2.0.5", 1082 | "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", 1083 | "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", 1084 | "dev": true 1085 | }, 1086 | "node_modules/unpipe": { 1087 | "version": "1.0.0", 1088 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 1089 | "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", 1090 | "engines": { 1091 | "node": ">= 0.8" 1092 | } 1093 | }, 1094 | "node_modules/utils-merge": { 1095 | "version": "1.0.1", 1096 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 1097 | "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", 1098 | "engines": { 1099 | "node": ">= 0.4.0" 1100 | } 1101 | }, 1102 | "node_modules/vary": { 1103 | "version": "1.1.2", 1104 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 1105 | "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", 1106 | "engines": { 1107 | "node": ">= 0.8" 1108 | } 1109 | }, 1110 | "node_modules/yallist": { 1111 | "version": "4.0.0", 1112 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", 1113 | "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", 1114 | "dev": true 1115 | } 1116 | } 1117 | } 1118 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "getting-started", 3 | "version": "1.0.0", 4 | "description": "Discord example app", 5 | "main": "app.js", 6 | "type": "module", 7 | "engines": { 8 | "node": ">=20.x" 9 | }, 10 | "scripts": { 11 | "start": "node app.js", 12 | "register": "node commands.js", 13 | "dev": "nodemon app.js" 14 | }, 15 | "author": "Shay DeWael", 16 | "license": "MIT", 17 | "dependencies": { 18 | "discord-interactions": "^3.2.0", 19 | "dotenv": "^16.0.3", 20 | "express": "^4.18.2" 21 | }, 22 | "devDependencies": { 23 | "nodemon": "^3.1.0" 24 | } 25 | } -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:recommended", 5 | ":disableDependencyDashboard", 6 | ":preserveSemverRanges" 7 | ], 8 | "ignorePaths": [ 9 | "**/node_modules/**" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /utils.js: -------------------------------------------------------------------------------- 1 | import 'dotenv/config'; 2 | import { verifyKey } from 'discord-interactions'; 3 | import { getFakeUsername } from './game.js'; 4 | 5 | export function VerifyDiscordRequest(clientKey) { 6 | return function (req, res, buf) { 7 | const signature = req.get('X-Signature-Ed25519'); 8 | const timestamp = req.get('X-Signature-Timestamp'); 9 | console.log(signature, timestamp, clientKey); 10 | 11 | const isValidRequest = verifyKey(buf, signature, timestamp, clientKey); 12 | if (!isValidRequest) { 13 | res.status(401).send('Bad request signature'); 14 | throw new Error('Bad request signature'); 15 | } 16 | }; 17 | } 18 | 19 | export async function DiscordRequest(endpoint, options) { 20 | // append endpoint to root API URL 21 | const url = 'https://discord.com/api/v10/' + endpoint; 22 | // Stringify payloads 23 | if (options.body) options.body = JSON.stringify(options.body); 24 | const res = await fetch(url, { 25 | headers: { 26 | Authorization: `Bot ${process.env.DISCORD_TOKEN}`, 27 | 'Content-Type': 'application/json; charset=UTF-8', 28 | 'User-Agent': 29 | 'DiscordBot (https://github.com/discord/discord-example-app, 1.0.0)', 30 | }, 31 | ...options, 32 | }); 33 | // throw API errors 34 | if (!res.ok) { 35 | const data = await res.json(); 36 | console.log(res.status); 37 | throw new Error(JSON.stringify(data)); 38 | } 39 | // return original response 40 | return res; 41 | } 42 | 43 | export async function InstallGlobalCommands(appId, commands) { 44 | // API endpoint to overwrite global commands 45 | const endpoint = `applications/${appId}/commands`; 46 | 47 | try { 48 | // This is calling the bulk overwrite endpoint: https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands 49 | await DiscordRequest(endpoint, { method: 'PUT', body: commands }); 50 | } catch (err) { 51 | console.error(err); 52 | } 53 | } 54 | 55 | export function capitalize(str) { 56 | return str.charAt(0).toUpperCase() + str.slice(1); 57 | } 58 | 59 | export async function getServerLeaderboard(guildId) { 60 | let members = await getServerMembers(guildId, 3); 61 | members = members 62 | .map((id, i) => `${i + 1}. <@${id}> (\`${getFakeUsername(i)}\`)`) 63 | .join('\n'); 64 | return `## :trophy: Server Leaderboard\n*This is a very fake leaderboard that just pulls random server members. Pretend it's pulling real game data and it's much more fun* :zany_face:\n\n### This week\n${members}\n\n### All time\n${members}`; 65 | } 66 | 67 | async function getServerMembers(guildId, limit) { 68 | const endpoint = `guilds/${guildId}/members?limit=${limit}`; 69 | 70 | try { 71 | const res = await DiscordRequest(endpoint, { method: 'GET' }); 72 | const parsedRes = await res.json(); 73 | return parsedRes.map((member) => member.user.id); 74 | } catch (err) { 75 | return console.error(err); 76 | } 77 | } 78 | 79 | export function createPlayerEmbed(profile) { 80 | return { 81 | type: 'rich', 82 | title: `${profile.username} Profile (lvl ${profile.stats.level})`, 83 | color: 0x968b9f, 84 | fields: [ 85 | { 86 | name: `Account created`, 87 | value: profile.createdAt, 88 | inline: true, 89 | }, 90 | { 91 | name: `Last played`, 92 | value: profile.lastPlayed, 93 | inline: true, 94 | }, 95 | { 96 | name: `Global rank`, 97 | value: profile.stats.rank, 98 | inline: true, 99 | }, 100 | { 101 | name: `Combat stats`, 102 | value: `:smiley: ${profile.stats.wins} wins / :pensive: ${profile.stats.losses} losses`, 103 | }, 104 | { 105 | name: `Realms explored`, 106 | value: profile.stats.realms, 107 | inline: true, 108 | }, 109 | ], 110 | url: 'https://discord.com/developers/docs/intro', 111 | thumbnail: { 112 | url: 'https://raw.githubusercontent.com/shaydewael/example-app/main/assets/fake-icon.png', 113 | }, 114 | }; 115 | } 116 | --------------------------------------------------------------------------------