From 829d1601641cacf53467e220991e829276c55c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Prie=C3=9Fnitz?= Date: Tue, 2 Dec 2025 23:52:10 +0100 Subject: [PATCH] Add events module with dashboard UI, scheduling, signups, and settings updates; extend env/readme. --- .env.example | 15 +- .gitignore | 1 + TODO_OVERVIEW.md | 15 + node_modules/.bin/acorn | 17 +- node_modules/.bin/mime | 17 +- node_modules/.bin/mkdirp | 17 +- node_modules/.bin/prisma | 17 +- node_modules/.bin/resolve | 17 +- node_modules/.bin/rimraf | 17 +- node_modules/.bin/tree-kill | 17 +- node_modules/.bin/ts-node | 17 +- node_modules/.bin/ts-node-cwd | 17 +- node_modules/.bin/ts-node-dev | 17 +- node_modules/.bin/ts-node-esm | 17 +- node_modules/.bin/ts-node-script | 17 +- node_modules/.bin/ts-node-transpile-only | 17 +- node_modules/.bin/ts-script | 17 +- node_modules/.bin/tsc | 17 +- node_modules/.bin/tsnd | 17 +- node_modules/.bin/tsserver | 17 +- node_modules/.package-lock.json | 772 +- node_modules/.prisma/client/default.d.ts | 111 +- node_modules/.prisma/client/default.js | 66 +- node_modules/.prisma/client/edge.d.ts | 111 +- node_modules/.prisma/client/edge.js | 359 +- node_modules/.prisma/client/index-browser.js | 347 +- node_modules/.prisma/client/index.d.ts | 12204 +++++++++++++++- node_modules/.prisma/client/index.js | 380 +- node_modules/.prisma/client/wasm.d.ts | 111 +- node_modules/.prisma/client/wasm.js | 347 +- node_modules/@discordjs/voice/README.md | 19 +- .../@discordjs/voice/dist/index.d.mts | 320 +- node_modules/@discordjs/voice/dist/index.d.ts | 320 +- node_modules/@discordjs/voice/dist/index.js | 2319 +-- .../@discordjs/voice/dist/index.js.map | 2 +- node_modules/@discordjs/voice/dist/index.mjs | 2319 +-- .../@discordjs/voice/dist/index.mjs.map | 2 +- .../node_modules/discord-api-types/README.md | 23 +- .../discord-api-types/gateway/common.d.ts | 2 +- .../discord-api-types/gateway/index.mjs | 1 + .../discord-api-types/gateway/v10.d.ts | 1128 +- .../discord-api-types/gateway/v10.d.ts.map | 2 +- .../discord-api-types/gateway/v10.js | 114 +- .../discord-api-types/gateway/v10.js.map | 2 +- .../discord-api-types/gateway/v10.mjs | 1 + .../discord-api-types/gateway/v6.d.ts | 2 +- .../discord-api-types/gateway/v6.d.ts.map | 2 +- .../discord-api-types/gateway/v6.js | 15 - .../discord-api-types/gateway/v6.js.map | 2 +- .../discord-api-types/gateway/v8.d.ts | 6 +- .../discord-api-types/gateway/v8.d.ts.map | 2 +- .../discord-api-types/gateway/v8.js | 15 - .../discord-api-types/gateway/v8.js.map | 2 +- .../discord-api-types/gateway/v9.d.ts | 1129 +- .../discord-api-types/gateway/v9.d.ts.map | 2 +- .../discord-api-types/gateway/v9.js | 114 +- .../discord-api-types/gateway/v9.js.map | 2 +- .../discord-api-types/gateway/v9.mjs | 1 + .../discord-api-types/globals.d.ts | 20 +- .../discord-api-types/globals.d.ts.map | 2 +- .../node_modules/discord-api-types/globals.js | 25 +- .../discord-api-types/globals.js.map | 2 +- .../discord-api-types/package.json | 417 +- .../discord-api-types/payloads/common.d.ts | 32 +- .../payloads/common.d.ts.map | 2 +- .../discord-api-types/payloads/common.js | 25 +- .../discord-api-types/payloads/common.js.map | 2 +- .../discord-api-types/payloads/index.mjs | 16 + .../_chatInput/channel.d.ts | 2 +- .../_chatInput/channel.d.ts.map | 2 +- .../_chatInput/integer.d.ts | 6 +- .../_chatInput/integer.d.ts.map | 2 +- .../_chatInput/number.d.ts | 6 +- .../_chatInput/number.d.ts.map | 2 +- .../_chatInput/shared.d.ts | 4 +- .../_applicationCommands/_chatInput/shared.js | 2 +- .../_chatInput/string.d.ts | 3 +- .../_chatInput/string.d.ts.map | 2 +- .../_chatInput/subcommand.d.ts | 5 +- .../_chatInput/subcommand.d.ts.map | 2 +- .../_chatInput/subcommandGroup.d.ts | 5 +- .../_chatInput/subcommandGroup.d.ts.map | 2 +- .../_applicationCommands/chatInput.d.ts | 53 +- .../_applicationCommands/chatInput.d.ts.map | 2 +- .../_applicationCommands/chatInput.js | 12 - .../_applicationCommands/chatInput.js.map | 2 +- .../_applicationCommands/contextMenu.d.ts | 28 +- .../_applicationCommands/permissions.d.ts | 8 +- .../_applicationCommands/permissions.js | 4 +- .../_interactions/applicationCommands.d.ts | 113 +- .../applicationCommands.d.ts.map | 2 +- .../v10/_interactions/applicationCommands.js | 65 +- .../_interactions/applicationCommands.js.map | 2 +- .../v10/_interactions/autocomplete.d.ts | 8 +- .../v10/_interactions/autocomplete.d.ts.map | 2 +- .../payloads/v10/_interactions/base.d.ts | 108 +- .../payloads/v10/_interactions/base.d.ts.map | 2 +- .../v10/_interactions/messageComponents.d.ts | 2 +- .../_interactions/messageComponents.d.ts.map | 2 +- .../v10/_interactions/modalSubmit.d.ts | 54 +- .../v10/_interactions/modalSubmit.d.ts.map | 2 +- .../payloads/v10/_interactions/responses.d.ts | 39 +- .../v10/_interactions/responses.d.ts.map | 2 +- .../payloads/v10/_interactions/responses.js | 14 +- .../v10/_interactions/responses.js.map | 2 +- .../payloads/v10/application.d.ts | 82 +- .../payloads/v10/application.d.ts.map | 2 +- .../payloads/v10/application.js | 36 +- .../payloads/v10/application.js.map | 2 +- .../payloads/v10/auditLog.d.ts | 258 +- .../payloads/v10/auditLog.d.ts.map | 2 +- .../payloads/v10/auditLog.js | 8 +- .../payloads/v10/auditLog.js.map | 2 +- .../payloads/v10/autoModeration.d.ts | 46 +- .../payloads/v10/autoModeration.d.ts.map | 2 +- .../payloads/v10/autoModeration.js | 20 +- .../payloads/v10/autoModeration.js.map | 2 +- .../payloads/v10/channel.d.ts | 1295 +- .../payloads/v10/channel.d.ts.map | 2 +- .../discord-api-types/payloads/v10/channel.js | 275 +- .../payloads/v10/channel.js.map | 2 +- .../discord-api-types/payloads/v10/emoji.d.ts | 32 +- .../payloads/v10/emoji.d.ts.map | 2 +- .../payloads/v10/gateway.d.ts | 123 +- .../payloads/v10/gateway.d.ts.map | 2 +- .../discord-api-types/payloads/v10/gateway.js | 40 +- .../payloads/v10/gateway.js.map | 2 +- .../discord-api-types/payloads/v10/guild.d.ts | 369 +- .../payloads/v10/guild.d.ts.map | 2 +- .../discord-api-types/payloads/v10/guild.js | 86 +- .../payloads/v10/guild.js.map | 2 +- .../payloads/v10/guildScheduledEvent.d.ts | 121 +- .../payloads/v10/guildScheduledEvent.d.ts.map | 2 +- .../payloads/v10/guildScheduledEvent.js | 49 +- .../payloads/v10/guildScheduledEvent.js.map | 2 +- .../discord-api-types/payloads/v10/index.d.ts | 12 +- .../payloads/v10/index.d.ts.map | 2 +- .../discord-api-types/payloads/v10/index.js | 8 +- .../payloads/v10/index.js.map | 2 +- .../discord-api-types/payloads/v10/index.mjs | 16 + .../payloads/v10/interactions.d.ts | 16 +- .../payloads/v10/interactions.d.ts.map | 2 +- .../payloads/v10/interactions.js | 5 - .../payloads/v10/interactions.js.map | 2 +- .../payloads/v10/invite.d.ts | 44 +- .../payloads/v10/invite.d.ts.map | 2 +- .../discord-api-types/payloads/v10/invite.js | 13 +- .../payloads/v10/invite.js.map | 2 +- .../payloads/v10/monetization.d.ts | 83 +- .../payloads/v10/monetization.d.ts.map | 2 +- .../payloads/v10/monetization.js | 27 +- .../payloads/v10/monetization.js.map | 2 +- .../payloads/v10/oauth2.d.ts | 46 +- .../payloads/v10/oauth2.d.ts.map | 2 +- .../discord-api-types/payloads/v10/oauth2.js | 46 +- .../payloads/v10/oauth2.js.map | 2 +- .../payloads/v10/permissions.d.ts | 33 +- .../payloads/v10/permissions.d.ts.map | 2 +- .../payloads/v10/permissions.js | 2 +- .../payloads/v10/permissions.js.map | 2 +- .../discord-api-types/payloads/v10/poll.d.ts | 58 +- .../payloads/v10/poll.d.ts.map | 2 +- .../discord-api-types/payloads/v10/poll.js | 2 +- .../payloads/v10/poll.js.map | 2 +- .../payloads/v10/stageInstance.d.ts | 14 +- .../payloads/v10/stageInstance.d.ts.map | 2 +- .../payloads/v10/stageInstance.js | 3 +- .../payloads/v10/stageInstance.js.map | 2 +- .../payloads/v10/sticker.d.ts | 17 +- .../payloads/v10/sticker.d.ts.map | 2 +- .../discord-api-types/payloads/v10/sticker.js | 4 +- .../payloads/v10/sticker.js.map | 2 +- .../discord-api-types/payloads/v10/teams.d.ts | 16 +- .../discord-api-types/payloads/v10/teams.js | 4 +- .../payloads/v10/template.d.ts | 7 +- .../payloads/v10/template.d.ts.map | 2 +- .../discord-api-types/payloads/v10/user.d.ts | 157 +- .../payloads/v10/user.d.ts.map | 2 +- .../discord-api-types/payloads/v10/user.js | 44 +- .../payloads/v10/user.js.map | 2 +- .../discord-api-types/payloads/v10/voice.d.ts | 27 +- .../payloads/v10/voice.d.ts.map | 2 +- .../payloads/v10/webhook.d.ts | 135 +- .../payloads/v10/webhook.d.ts.map | 2 +- .../discord-api-types/payloads/v10/webhook.js | 53 +- .../payloads/v10/webhook.js.map | 2 +- .../payloads/v6/channel.d.ts | 4 - .../payloads/v6/channel.d.ts.map | 2 +- .../discord-api-types/payloads/v6/channel.js | 1 - .../payloads/v6/channel.js.map | 2 +- .../payloads/v8/channel.d.ts | 5 - .../payloads/v8/channel.d.ts.map | 2 +- .../discord-api-types/payloads/v8/channel.js | 1 - .../payloads/v8/channel.js.map | 2 +- .../_chatInput/channel.d.ts | 2 +- .../_chatInput/channel.d.ts.map | 2 +- .../_chatInput/integer.d.ts | 6 +- .../_chatInput/integer.d.ts.map | 2 +- .../_chatInput/number.d.ts | 6 +- .../_chatInput/number.d.ts.map | 2 +- .../_chatInput/shared.d.ts | 4 +- .../_applicationCommands/_chatInput/shared.js | 2 +- .../_chatInput/string.d.ts | 3 +- .../_chatInput/string.d.ts.map | 2 +- .../_chatInput/subcommand.d.ts | 5 +- .../_chatInput/subcommand.d.ts.map | 2 +- .../_chatInput/subcommandGroup.d.ts | 5 +- .../_chatInput/subcommandGroup.d.ts.map | 2 +- .../_applicationCommands/chatInput.d.ts | 53 +- .../_applicationCommands/chatInput.d.ts.map | 2 +- .../_applicationCommands/chatInput.js | 12 - .../_applicationCommands/chatInput.js.map | 2 +- .../_applicationCommands/contextMenu.d.ts | 28 +- .../_applicationCommands/permissions.d.ts | 8 +- .../_applicationCommands/permissions.js | 4 +- .../v9/_interactions/applicationCommands.d.ts | 111 +- .../applicationCommands.d.ts.map | 2 +- .../v9/_interactions/applicationCommands.js | 65 +- .../_interactions/applicationCommands.js.map | 2 +- .../v9/_interactions/autocomplete.d.ts | 8 +- .../v9/_interactions/autocomplete.d.ts.map | 2 +- .../payloads/v9/_interactions/base.d.ts | 111 +- .../payloads/v9/_interactions/base.d.ts.map | 2 +- .../v9/_interactions/messageComponents.d.ts | 2 +- .../_interactions/messageComponents.d.ts.map | 2 +- .../v9/_interactions/modalSubmit.d.ts | 54 +- .../v9/_interactions/modalSubmit.d.ts.map | 2 +- .../payloads/v9/_interactions/responses.d.ts | 39 +- .../v9/_interactions/responses.d.ts.map | 2 +- .../payloads/v9/_interactions/responses.js | 14 +- .../v9/_interactions/responses.js.map | 2 +- .../payloads/v9/application.d.ts | 82 +- .../payloads/v9/application.d.ts.map | 2 +- .../payloads/v9/application.js | 36 +- .../payloads/v9/application.js.map | 2 +- .../payloads/v9/auditLog.d.ts | 258 +- .../payloads/v9/auditLog.d.ts.map | 2 +- .../discord-api-types/payloads/v9/auditLog.js | 8 +- .../payloads/v9/auditLog.js.map | 2 +- .../payloads/v9/autoModeration.d.ts | 46 +- .../payloads/v9/autoModeration.d.ts.map | 2 +- .../payloads/v9/autoModeration.js | 20 +- .../payloads/v9/autoModeration.js.map | 2 +- .../payloads/v9/channel.d.ts | 1270 +- .../payloads/v9/channel.d.ts.map | 2 +- .../discord-api-types/payloads/v9/channel.js | 277 +- .../payloads/v9/channel.js.map | 2 +- .../discord-api-types/payloads/v9/emoji.d.ts | 32 +- .../payloads/v9/emoji.d.ts.map | 2 +- .../payloads/v9/gateway.d.ts | 123 +- .../payloads/v9/gateway.d.ts.map | 2 +- .../discord-api-types/payloads/v9/gateway.js | 40 +- .../payloads/v9/gateway.js.map | 2 +- .../discord-api-types/payloads/v9/guild.d.ts | 369 +- .../payloads/v9/guild.d.ts.map | 2 +- .../discord-api-types/payloads/v9/guild.js | 86 +- .../payloads/v9/guild.js.map | 2 +- .../payloads/v9/guildScheduledEvent.d.ts | 121 +- .../payloads/v9/guildScheduledEvent.d.ts.map | 2 +- .../payloads/v9/guildScheduledEvent.js | 49 +- .../payloads/v9/guildScheduledEvent.js.map | 2 +- .../discord-api-types/payloads/v9/index.d.ts | 12 +- .../payloads/v9/index.d.ts.map | 2 +- .../discord-api-types/payloads/v9/index.js | 8 +- .../payloads/v9/index.js.map | 2 +- .../discord-api-types/payloads/v9/index.mjs | 16 + .../payloads/v9/interactions.d.ts | 16 +- .../payloads/v9/interactions.d.ts.map | 2 +- .../payloads/v9/interactions.js | 5 - .../payloads/v9/interactions.js.map | 2 +- .../discord-api-types/payloads/v9/invite.d.ts | 44 +- .../payloads/v9/invite.d.ts.map | 2 +- .../discord-api-types/payloads/v9/invite.js | 13 +- .../payloads/v9/invite.js.map | 2 +- .../payloads/v9/monetization.d.ts | 83 +- .../payloads/v9/monetization.d.ts.map | 2 +- .../payloads/v9/monetization.js | 27 +- .../payloads/v9/monetization.js.map | 2 +- .../discord-api-types/payloads/v9/oauth2.d.ts | 34 +- .../discord-api-types/payloads/v9/oauth2.js | 34 +- .../payloads/v9/permissions.d.ts | 33 +- .../payloads/v9/permissions.d.ts.map | 2 +- .../payloads/v9/permissions.js | 2 +- .../payloads/v9/permissions.js.map | 2 +- .../discord-api-types/payloads/v9/poll.d.ts | 58 +- .../payloads/v9/poll.d.ts.map | 2 +- .../discord-api-types/payloads/v9/poll.js | 2 +- .../discord-api-types/payloads/v9/poll.js.map | 2 +- .../payloads/v9/stageInstance.d.ts | 14 +- .../payloads/v9/stageInstance.d.ts.map | 2 +- .../payloads/v9/stageInstance.js | 3 +- .../payloads/v9/stageInstance.js.map | 2 +- .../payloads/v9/sticker.d.ts | 17 +- .../payloads/v9/sticker.d.ts.map | 2 +- .../discord-api-types/payloads/v9/sticker.js | 4 +- .../payloads/v9/sticker.js.map | 2 +- .../discord-api-types/payloads/v9/teams.d.ts | 16 +- .../discord-api-types/payloads/v9/teams.js | 4 +- .../payloads/v9/template.d.ts | 7 +- .../payloads/v9/template.d.ts.map | 2 +- .../discord-api-types/payloads/v9/user.d.ts | 159 +- .../payloads/v9/user.d.ts.map | 2 +- .../discord-api-types/payloads/v9/user.js | 46 +- .../discord-api-types/payloads/v9/user.js.map | 2 +- .../discord-api-types/payloads/v9/voice.d.ts | 24 +- .../payloads/v9/voice.d.ts.map | 2 +- .../payloads/v9/webhook.d.ts | 135 +- .../payloads/v9/webhook.d.ts.map | 2 +- .../discord-api-types/payloads/v9/webhook.js | 53 +- .../payloads/v9/webhook.js.map | 2 +- .../discord-api-types/rest/common.d.ts | 21 +- .../discord-api-types/rest/common.d.ts.map | 2 +- .../discord-api-types/rest/common.js | 18 +- .../discord-api-types/rest/common.js.map | 2 +- .../discord-api-types/rest/index.mjs | 1 + .../rest/v10/application.d.ts | 16 +- .../rest/v10/application.d.ts.map | 2 +- .../discord-api-types/rest/v10/auditLog.d.ts | 4 +- .../rest/v10/autoModeration.d.ts | 18 +- .../discord-api-types/rest/v10/channel.d.ts | 275 +- .../rest/v10/channel.d.ts.map | 2 +- .../discord-api-types/rest/v10/channel.js | 9 + .../discord-api-types/rest/v10/channel.js.map | 2 +- .../discord-api-types/rest/v10/emoji.d.ts | 48 +- .../discord-api-types/rest/v10/emoji.d.ts.map | 2 +- .../discord-api-types/rest/v10/gateway.d.ts | 4 +- .../discord-api-types/rest/v10/guild.d.ts | 394 +- .../discord-api-types/rest/v10/guild.d.ts.map | 2 +- .../rest/v10/guildScheduledEvent.d.ts | 44 +- .../rest/v10/guildScheduledEvent.d.ts.map | 2 +- .../discord-api-types/rest/v10/index.d.ts | 839 +- .../discord-api-types/rest/v10/index.d.ts.map | 2 +- .../discord-api-types/rest/v10/index.js | 220 +- .../discord-api-types/rest/v10/index.js.map | 2 +- .../discord-api-types/rest/v10/index.mjs | 1 + .../rest/v10/interactions.d.ts | 193 +- .../rest/v10/interactions.d.ts.map | 2 +- .../discord-api-types/rest/v10/invite.d.ts | 7 +- .../rest/v10/invite.d.ts.map | 2 +- .../rest/v10/monetization.d.ts | 69 +- .../rest/v10/monetization.d.ts.map | 2 +- .../rest/v10/monetization.js | 2 +- .../rest/v10/monetization.js.map | 2 +- .../discord-api-types/rest/v10/oauth2.d.ts | 72 +- .../rest/v10/oauth2.d.ts.map | 2 +- .../discord-api-types/rest/v10/poll.d.ts | 30 +- .../discord-api-types/rest/v10/poll.d.ts.map | 2 +- .../rest/v10/stageInstance.d.ts | 16 +- .../discord-api-types/rest/v10/sticker.d.ts | 31 +- .../rest/v10/sticker.d.ts.map | 2 +- .../discord-api-types/rest/v10/template.d.ts | 28 +- .../rest/v10/template.d.ts.map | 2 +- .../discord-api-types/rest/v10/user.d.ts | 33 +- .../discord-api-types/rest/v10/user.d.ts.map | 2 +- .../discord-api-types/rest/v10/voice.d.ts | 53 +- .../discord-api-types/rest/v10/voice.d.ts.map | 2 +- .../discord-api-types/rest/v10/webhook.d.ts | 110 +- .../rest/v10/webhook.d.ts.map | 2 +- .../discord-api-types/rest/v6/index.d.ts | 2 +- .../discord-api-types/rest/v6/index.d.ts.map | 2 +- .../discord-api-types/rest/v6/index.js | 19 + .../discord-api-types/rest/v6/index.js.map | 2 +- .../discord-api-types/rest/v8/channel.d.ts | 4 +- .../rest/v8/channel.d.ts.map | 2 +- .../discord-api-types/rest/v8/guild.d.ts | 10 +- .../discord-api-types/rest/v8/guild.d.ts.map | 2 +- .../rest/v8/guildScheduledEvent.d.ts | 4 +- .../rest/v8/guildScheduledEvent.d.ts.map | 2 +- .../discord-api-types/rest/v8/index.d.ts | 12 +- .../discord-api-types/rest/v8/index.d.ts.map | 2 +- .../discord-api-types/rest/v8/index.js | 19 + .../discord-api-types/rest/v8/index.js.map | 2 +- .../rest/v8/interactions.d.ts | 8 +- .../rest/v8/interactions.d.ts.map | 2 +- .../discord-api-types/rest/v8/template.d.ts | 4 +- .../rest/v8/template.d.ts.map | 2 +- .../discord-api-types/rest/v8/webhook.d.ts | 4 +- .../rest/v8/webhook.d.ts.map | 2 +- .../rest/v9/application.d.ts | 16 +- .../rest/v9/application.d.ts.map | 2 +- .../discord-api-types/rest/v9/auditLog.d.ts | 4 +- .../rest/v9/autoModeration.d.ts | 18 +- .../discord-api-types/rest/v9/channel.d.ts | 287 +- .../rest/v9/channel.d.ts.map | 2 +- .../discord-api-types/rest/v9/channel.js | 9 + .../discord-api-types/rest/v9/channel.js.map | 2 +- .../discord-api-types/rest/v9/emoji.d.ts | 48 +- .../discord-api-types/rest/v9/emoji.d.ts.map | 2 +- .../discord-api-types/rest/v9/gateway.d.ts | 4 +- .../discord-api-types/rest/v9/guild.d.ts | 390 +- .../discord-api-types/rest/v9/guild.d.ts.map | 2 +- .../rest/v9/guildScheduledEvent.d.ts | 44 +- .../rest/v9/guildScheduledEvent.d.ts.map | 2 +- .../discord-api-types/rest/v9/index.d.ts | 843 +- .../discord-api-types/rest/v9/index.d.ts.map | 2 +- .../discord-api-types/rest/v9/index.js | 213 +- .../discord-api-types/rest/v9/index.js.map | 2 +- .../discord-api-types/rest/v9/index.mjs | 1 + .../rest/v9/interactions.d.ts | 193 +- .../rest/v9/interactions.d.ts.map | 2 +- .../discord-api-types/rest/v9/invite.d.ts | 7 +- .../discord-api-types/rest/v9/invite.d.ts.map | 2 +- .../rest/v9/monetization.d.ts | 69 +- .../rest/v9/monetization.d.ts.map | 2 +- .../discord-api-types/rest/v9/monetization.js | 2 +- .../rest/v9/monetization.js.map | 2 +- .../discord-api-types/rest/v9/oauth2.d.ts | 72 +- .../discord-api-types/rest/v9/oauth2.d.ts.map | 2 +- .../discord-api-types/rest/v9/poll.d.ts | 30 +- .../discord-api-types/rest/v9/poll.d.ts.map | 2 +- .../rest/v9/stageInstance.d.ts | 16 +- .../discord-api-types/rest/v9/sticker.d.ts | 31 +- .../rest/v9/sticker.d.ts.map | 2 +- .../discord-api-types/rest/v9/template.d.ts | 28 +- .../rest/v9/template.d.ts.map | 2 +- .../discord-api-types/rest/v9/user.d.ts | 33 +- .../discord-api-types/rest/v9/user.d.ts.map | 2 +- .../discord-api-types/rest/v9/voice.d.ts | 53 +- .../discord-api-types/rest/v9/voice.d.ts.map | 2 +- .../discord-api-types/rest/v9/webhook.d.ts | 110 +- .../rest/v9/webhook.d.ts.map | 2 +- .../discord-api-types/rpc/common.d.ts | 458 +- .../discord-api-types/rpc/common.d.ts.map | 2 +- .../discord-api-types/rpc/common.js | 208 +- .../discord-api-types/rpc/common.js.map | 2 +- .../discord-api-types/rpc/index.mjs | 8 + .../discord-api-types/rpc/v10.d.ts | 2189 +++ .../discord-api-types/rpc/v10.d.ts.map | 2 +- .../node_modules/discord-api-types/rpc/v10.js | 281 + .../discord-api-types/rpc/v10.js.map | 2 +- .../discord-api-types/rpc/v10.mjs | 8 + .../discord-api-types/rpc/v8.d.ts | 37 + .../discord-api-types/rpc/v8.d.ts.map | 2 +- .../discord-api-types/rpc/v8.js.map | 2 +- .../node_modules/discord-api-types/rpc/v8.mjs | 5 + .../discord-api-types/rpc/v9.d.ts | 37 + .../discord-api-types/rpc/v9.d.ts.map | 2 +- .../discord-api-types/rpc/v9.js.map | 2 +- .../node_modules/discord-api-types/rpc/v9.mjs | 5 + .../discord-api-types/utils/index.mjs | 1 + .../discord-api-types/utils/internals.d.ts | 35 +- .../utils/internals.d.ts.map | 2 +- .../discord-api-types/utils/internals.js | 10 + .../discord-api-types/utils/internals.js.map | 2 +- .../discord-api-types/utils/v10.d.ts | 61 +- .../discord-api-types/utils/v10.d.ts.map | 2 +- .../discord-api-types/utils/v10.js | 92 +- .../discord-api-types/utils/v10.js.map | 2 +- .../discord-api-types/utils/v10.mjs | 1 + .../discord-api-types/utils/v8.d.ts | 16 +- .../discord-api-types/utils/v8.js | 33 +- .../discord-api-types/utils/v8.js.map | 2 +- .../discord-api-types/utils/v9.d.ts | 61 +- .../discord-api-types/utils/v9.d.ts.map | 2 +- .../discord-api-types/utils/v9.js | 92 +- .../discord-api-types/utils/v9.js.map | 2 +- .../discord-api-types/utils/v9.mjs | 1 + .../node_modules/discord-api-types/v10.d.ts | 1 + .../discord-api-types/v10.d.ts.map | 2 +- .../node_modules/discord-api-types/v10.js | 1 + .../node_modules/discord-api-types/v10.js.map | 2 +- .../node_modules/discord-api-types/v10.mjs | 27 + .../node_modules/discord-api-types/v8.mjs | 5 + .../node_modules/discord-api-types/v9.d.ts | 1 + .../discord-api-types/v9.d.ts.map | 2 +- .../node_modules/discord-api-types/v9.js | 1 + .../node_modules/discord-api-types/v9.js.map | 2 +- .../node_modules/discord-api-types/v9.mjs | 24 + .../discord-api-types/voice/index.d.ts | 2 +- .../discord-api-types/voice/index.js | 2 +- .../discord-api-types/voice/index.mjs | 2 + .../discord-api-types/voice/v4.d.ts | 72 +- .../discord-api-types/voice/v4.d.ts.map | 2 +- .../discord-api-types/voice/v4.js | 68 +- .../discord-api-types/voice/v4.js.map | 2 +- node_modules/@discordjs/voice/package.json | 51 +- package-lock.json | 1042 +- package.json | 22 +- prisma/schema.prisma | 134 + readme.md | 103 +- src/commands/admin/ban.ts | 4 +- src/commands/admin/clear.ts | 2 +- src/commands/admin/kick.ts | 4 +- src/commands/admin/mute.ts | 4 +- src/commands/admin/tempban.ts | 4 +- src/commands/admin/timeout.ts | 4 +- src/commands/admin/unmute.ts | 4 +- src/commands/music/loop.ts | 6 +- src/commands/music/pause.ts | 4 +- src/commands/music/play.ts | 5 +- src/commands/music/queue.ts | 4 +- src/commands/music/resume.ts | 4 +- src/commands/music/skip.ts | 4 +- src/commands/music/stop.ts | 4 +- src/commands/tickets/claim.ts | 4 +- src/commands/tickets/close.ts | 4 +- src/commands/tickets/panel.ts | 4 +- src/commands/tickets/priority.ts | 4 +- src/commands/tickets/status.ts | 4 +- src/commands/tickets/ticket.ts | 4 +- src/commands/tickets/transcript.ts | 6 +- src/commands/utility/birthday.ts | 35 + src/commands/utility/configure.ts | 65 +- src/commands/utility/event.ts | 29 + src/commands/utility/help.ts | 2 +- src/commands/utility/ping.ts | 2 +- src/commands/utility/rank.ts | 4 +- src/commands/utility/serverinfo.ts | 2 +- src/commands/utility/statuspage.ts | 33 + src/commands/utility/welcome.ts | 63 + src/config/context.ts | 62 +- src/config/env.ts | 18 +- src/config/state.ts | 219 +- .../20251201111117_init/migration.sql | 29 + .../migration.sql | 12 + .../migration.sql | 2 + .../migration.sql | 2 + .../migration.sql | 2 + .../migration.sql | 3 + .../migration.sql | 2 + .../migration.sql | 2 + .../migration.sql | 3 + .../migration.sql | 46 + .../migration.sql | 66 + src/database/migrations/migration_lock.toml | 3 + src/database/schema.prisma | 102 + src/events/channelCreate.ts | 13 + src/events/channelDelete.ts | 13 + src/events/channelUpdate.ts | 19 + src/events/guildBanAdd.ts | 4 +- src/events/guildCreate.ts | 6 +- src/events/guildMemberAdd.ts | 45 +- src/events/guildMemberRemove.ts | 4 +- src/events/guildMemberUpdate.ts | 18 + src/events/interactionCreate.ts | 11 +- src/events/messageCreate.ts | 11 +- src/events/messageDelete.ts | 4 +- src/events/messageReactionAdd.ts | 17 + src/events/messageReactionRemove.ts | 17 + src/events/messageUpdate.ts | 4 +- src/events/ready.ts | 32 +- src/events/voiceStateUpdate.ts | 12 + src/index.ts | 37 +- src/services/adminService.ts | 125 + src/services/automodService.ts | 114 +- src/services/birthdayService.ts | 160 + src/services/commandHandler.ts | 50 +- src/services/dynamicVoiceService.ts | 152 + src/services/eventHandler.ts | 27 +- src/services/eventService.ts | 177 + src/services/forumService.ts | 5 +- src/services/levelService.ts | 50 +- src/services/loggingService.ts | 125 +- src/services/moduleService.ts | 80 + src/services/musicService.ts | 165 +- src/services/reactionRoleService.ts | 202 + src/services/statuspageService.ts | 225 + src/services/ticketService.ts | 355 +- src/types/express-session.d.ts | 13 + src/utils/logger.ts | 26 +- src/web/routes/api.ts | 627 +- src/web/routes/auth.ts | 64 +- src/web/routes/dashboard.ts | 2416 ++- src/web/server.ts | 63 +- tmp_check.py | 9 + tmp_head.txt | 40 + transcripts/cmin6k6qs0000fz1y82j9d2d8.txt | 3 + transcripts/cmin7k85w000010sxtrxafrit.txt | 1 + transcripts/cmin9xqx900005joh3ztrmwn4.txt | 2 + transcripts/cmina48d100015joh0qjv0eja.txt | 1 + transcripts/cminblikc0000fenokt2wl2cx.txt | 11 + transcripts/cmineub1d00001204if0u3ewx.txt | 1 + transcripts/cmioi0v590000q4s1la66bakh.txt | 1 + transcripts/cmip0g1kd0003jd4ncryl33k6.txt | 1 + transcripts/cmip0njb60004jd4ntg16a165.txt | 1 + transcripts/cmip0pxlr0006jd4n69szoolr.txt | 1 + transcripts/cmip0s0ec0007jd4nf22xg5s0.txt | 1 + tsconfig.json | 4 +- 578 files changed, 37647 insertions(+), 11590 deletions(-) create mode 100644 TODO_OVERVIEW.md create mode 100644 prisma/schema.prisma create mode 100644 src/commands/utility/birthday.ts create mode 100644 src/commands/utility/event.ts create mode 100644 src/commands/utility/statuspage.ts create mode 100644 src/commands/utility/welcome.ts create mode 100644 src/database/migrations/20251201111117_init/migration.sql create mode 100644 src/database/migrations/20251201114634_add_guild_settings/migration.sql create mode 100644 src/database/migrations/20251201121513_add_tickets_enabled/migration.sql create mode 100644 src/database/migrations/20251201134541_add_support_role_and_flags/migration.sql create mode 100644 src/database/migrations/20251201141926_add_ticket_fields/migration.sql create mode 100644 src/database/migrations/20251202120000_add_automod_music_fields/migration.sql create mode 100644 src/database/migrations/20251202120500_add_level_unique_constraint/migration.sql create mode 100644 src/database/migrations/20251202140000_add_welcome_module/migration.sql create mode 100644 src/database/migrations/20251202150000_add_dynamic_voice/migration.sql create mode 100644 src/database/migrations/20251202162524_add_birthday_reactionroles/migration.sql create mode 100644 src/database/migrations/20251202224446_add_events_module/migration.sql create mode 100644 src/database/migrations/migration_lock.toml create mode 100644 src/events/channelCreate.ts create mode 100644 src/events/channelDelete.ts create mode 100644 src/events/channelUpdate.ts create mode 100644 src/events/guildMemberUpdate.ts create mode 100644 src/events/messageReactionAdd.ts create mode 100644 src/events/messageReactionRemove.ts create mode 100644 src/events/voiceStateUpdate.ts create mode 100644 src/services/adminService.ts create mode 100644 src/services/birthdayService.ts create mode 100644 src/services/dynamicVoiceService.ts create mode 100644 src/services/eventService.ts create mode 100644 src/services/moduleService.ts create mode 100644 src/services/reactionRoleService.ts create mode 100644 src/services/statuspageService.ts create mode 100644 src/types/express-session.d.ts create mode 100644 tmp_check.py create mode 100644 tmp_head.txt create mode 100644 transcripts/cmin6k6qs0000fz1y82j9d2d8.txt create mode 100644 transcripts/cmin7k85w000010sxtrxafrit.txt create mode 100644 transcripts/cmin9xqx900005joh3ztrmwn4.txt create mode 100644 transcripts/cmina48d100015joh0qjv0eja.txt create mode 100644 transcripts/cminblikc0000fenokt2wl2cx.txt create mode 100644 transcripts/cmineub1d00001204if0u3ewx.txt create mode 100644 transcripts/cmioi0v590000q4s1la66bakh.txt create mode 100644 transcripts/cmip0g1kd0003jd4ncryl33k6.txt create mode 100644 transcripts/cmip0njb60004jd4ntg16a165.txt create mode 100644 transcripts/cmip0pxlr0006jd4n69szoolr.txt create mode 100644 transcripts/cmip0s0ec0007jd4nf22xg5s0.txt diff --git a/.env.example b/.env.example index 427bf2b..f203b1f 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,12 @@ -DISCORD_TOKEN= -DISCORD_CLIENT_ID= -DISCORD_GUILD_ID= -DISCORD_GUILD_IDS= -DATABASE_URL= +DISCORD_TOKEN=your_bot_token +DISCORD_CLIENT_ID=your_client_id +DISCORD_CLIENT_SECRET=your_client_secret +DISCORD_GUILD_ID=single_guild_id_optional +DISCORD_GUILD_IDS=comma,separated,guild,ids +DATABASE_URL=postgresql://user:pass@host:5432/dbname?schema=public PORT=3000 SESSION_SECRET=change_me +DASHBOARD_BASE_URL=http://localhost:3000 +SUPPORT_ROLE_ID= +WEB_BASE_PATH=/ucp +OWNER_IDS=comma,separated,owner,ids diff --git a/.gitignore b/.gitignore index 3c3629e..6ed48a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +.env node_modules diff --git a/TODO_OVERVIEW.md b/TODO_OVERVIEW.md new file mode 100644 index 0000000..81c29e3 --- /dev/null +++ b/TODO_OVERVIEW.md @@ -0,0 +1,15 @@ +Papo TODO Übersicht (Module/Automod/Tickets) +============================================ + +- Module-System + - Ergänze weitere Modul-Keys (inkl. Musik, Forum-Sync) und lade Metadaten dynamisch (`src/services/moduleService.ts`, `src/config/context.ts`). + - Commands vor Ausführung an Modul-Status binden (`src/services/commandHandler.ts`, `src/commands/music/play.ts`). + - Musik-Status/Toggles im Dashboard und API ausspielen (`src/services/musicService.ts`, `src/web/routes/api.ts`, `src/web/routes/dashboard.ts`). + +- Automod + - Pro-Guild Konfiguration (Schwellen, Filterlisten, Whitelists, Aktionen/Logs) persistieren und im Dashboard editierbar machen (`src/services/automodService.ts`, `src/config/state.ts`, `src/events/messageCreate.ts`, `src/commands/utility/configure.ts`, `src/web/routes/api.ts`, `src/web/routes/dashboard.ts`). + +- Tickets/Dashboard + - Ticket-Modul sauber ans Modul-System hängen und Panel/Buttons aus Dashboard-Konfig speisen (`src/services/ticketService.ts`, `src/commands/tickets/panel.ts`). + - Dashboard-UI neu strukturieren (Filter, Suche, Live-Ansicht, Status-Sync) und API für Streams/Filter erweitern (`src/web/routes/dashboard.ts`, `src/web/routes/api.ts`). + - Transcript/Log/Storage vereinheitlichen und an Dashboard/Forum koppeln (`src/services/ticketService.ts`, `src/services/forumService.ts`). diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn index cf76760..679bd16 120000 --- a/node_modules/.bin/acorn +++ b/node_modules/.bin/acorn @@ -1 +1,16 @@ -../acorn/bin/acorn \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../acorn/bin/acorn" "$@" +else + exec node "$basedir/../acorn/bin/acorn" "$@" +fi diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime index fbb7ee0..7751de3 120000 --- a/node_modules/.bin/mime +++ b/node_modules/.bin/mime @@ -1 +1,16 @@ -../mime/cli.js \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../mime/cli.js" "$@" +else + exec node "$basedir/../mime/cli.js" "$@" +fi diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp index 017896c..1ab9c81 120000 --- a/node_modules/.bin/mkdirp +++ b/node_modules/.bin/mkdirp @@ -1 +1,16 @@ -../mkdirp/bin/cmd.js \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@" +else + exec node "$basedir/../mkdirp/bin/cmd.js" "$@" +fi diff --git a/node_modules/.bin/prisma b/node_modules/.bin/prisma index af8b4c8..d770cd3 120000 --- a/node_modules/.bin/prisma +++ b/node_modules/.bin/prisma @@ -1 +1,16 @@ -../prisma/build/index.js \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../prisma/build/index.js" "$@" +else + exec node "$basedir/../prisma/build/index.js" "$@" +fi diff --git a/node_modules/.bin/resolve b/node_modules/.bin/resolve index b6afda6..c043cba 120000 --- a/node_modules/.bin/resolve +++ b/node_modules/.bin/resolve @@ -1 +1,16 @@ -../resolve/bin/resolve \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../resolve/bin/resolve" "$@" +else + exec node "$basedir/../resolve/bin/resolve" "$@" +fi diff --git a/node_modules/.bin/rimraf b/node_modules/.bin/rimraf index 4cd49a4..6d6240a 120000 --- a/node_modules/.bin/rimraf +++ b/node_modules/.bin/rimraf @@ -1 +1,16 @@ -../rimraf/bin.js \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../rimraf/bin.js" "$@" +else + exec node "$basedir/../rimraf/bin.js" "$@" +fi diff --git a/node_modules/.bin/tree-kill b/node_modules/.bin/tree-kill index 26dcd2c..6bcf984 120000 --- a/node_modules/.bin/tree-kill +++ b/node_modules/.bin/tree-kill @@ -1 +1,16 @@ -../tree-kill/cli.js \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../tree-kill/cli.js" "$@" +else + exec node "$basedir/../tree-kill/cli.js" "$@" +fi diff --git a/node_modules/.bin/ts-node b/node_modules/.bin/ts-node index b3ff94b..f3d4fab 120000 --- a/node_modules/.bin/ts-node +++ b/node_modules/.bin/ts-node @@ -1 +1,16 @@ -../ts-node/dist/bin.js \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../ts-node/dist/bin.js" "$@" +else + exec node "$basedir/../ts-node/dist/bin.js" "$@" +fi diff --git a/node_modules/.bin/ts-node-cwd b/node_modules/.bin/ts-node-cwd index 54984a4..ae68e85 120000 --- a/node_modules/.bin/ts-node-cwd +++ b/node_modules/.bin/ts-node-cwd @@ -1 +1,16 @@ -../ts-node/dist/bin-cwd.js \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../ts-node/dist/bin-cwd.js" "$@" +else + exec node "$basedir/../ts-node/dist/bin-cwd.js" "$@" +fi diff --git a/node_modules/.bin/ts-node-dev b/node_modules/.bin/ts-node-dev index 4683cb2..8897fed 120000 --- a/node_modules/.bin/ts-node-dev +++ b/node_modules/.bin/ts-node-dev @@ -1 +1,16 @@ -../ts-node-dev/lib/bin.js \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../ts-node-dev/lib/bin.js" "$@" +else + exec node "$basedir/../ts-node-dev/lib/bin.js" "$@" +fi diff --git a/node_modules/.bin/ts-node-esm b/node_modules/.bin/ts-node-esm index a19d9ed..19ea759 120000 --- a/node_modules/.bin/ts-node-esm +++ b/node_modules/.bin/ts-node-esm @@ -1 +1,16 @@ -../ts-node/dist/bin-esm.js \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../ts-node/dist/bin-esm.js" "$@" +else + exec node "$basedir/../ts-node/dist/bin-esm.js" "$@" +fi diff --git a/node_modules/.bin/ts-node-script b/node_modules/.bin/ts-node-script index edc40b3..14c2f67 120000 --- a/node_modules/.bin/ts-node-script +++ b/node_modules/.bin/ts-node-script @@ -1 +1,16 @@ -../ts-node/dist/bin-script.js \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../ts-node/dist/bin-script.js" "$@" +else + exec node "$basedir/../ts-node/dist/bin-script.js" "$@" +fi diff --git a/node_modules/.bin/ts-node-transpile-only b/node_modules/.bin/ts-node-transpile-only index 173710d..d3d4c0c 120000 --- a/node_modules/.bin/ts-node-transpile-only +++ b/node_modules/.bin/ts-node-transpile-only @@ -1 +1,16 @@ -../ts-node/dist/bin-transpile.js \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../ts-node/dist/bin-transpile.js" "$@" +else + exec node "$basedir/../ts-node/dist/bin-transpile.js" "$@" +fi diff --git a/node_modules/.bin/ts-script b/node_modules/.bin/ts-script index 7382912..8f65f36 120000 --- a/node_modules/.bin/ts-script +++ b/node_modules/.bin/ts-script @@ -1 +1,16 @@ -../ts-node/dist/bin-script-deprecated.js \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../ts-node/dist/bin-script-deprecated.js" "$@" +else + exec node "$basedir/../ts-node/dist/bin-script-deprecated.js" "$@" +fi diff --git a/node_modules/.bin/tsc b/node_modules/.bin/tsc index 0863208..c4864b9 120000 --- a/node_modules/.bin/tsc +++ b/node_modules/.bin/tsc @@ -1 +1,16 @@ -../typescript/bin/tsc \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@" +else + exec node "$basedir/../typescript/bin/tsc" "$@" +fi diff --git a/node_modules/.bin/tsnd b/node_modules/.bin/tsnd index 4683cb2..8897fed 120000 --- a/node_modules/.bin/tsnd +++ b/node_modules/.bin/tsnd @@ -1 +1,16 @@ -../ts-node-dev/lib/bin.js \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../ts-node-dev/lib/bin.js" "$@" +else + exec node "$basedir/../ts-node-dev/lib/bin.js" "$@" +fi diff --git a/node_modules/.bin/tsserver b/node_modules/.bin/tsserver index f8f8f1a..6c19ce3 120000 --- a/node_modules/.bin/tsserver +++ b/node_modules/.bin/tsserver @@ -1 +1,16 @@ -../typescript/bin/tsserver \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@" +else + exec node "$basedir/../typescript/bin/tsserver" "$@" +fi diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 790f294..fb7fe7c 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -17,6 +17,21 @@ "node": ">=12" } }, + "node_modules/@derhuerst/http-basic": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@derhuerst/http-basic/-/http-basic-8.2.4.tgz", + "integrity": "sha512-F9rL9k9Xjf5blCz8HsJRO4diy111cayL2vkY2XE4r4t3n0yPXVYy3KD3nJ1qbrSn9743UWSXH4IwuCa/HWlGFw==", + "license": "MIT", + "dependencies": { + "caseless": "^0.12.0", + "concat-stream": "^2.0.0", + "http-response-object": "^3.0.1", + "parse-cache-control": "^1.0.1" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@discordjs/builders": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.13.0.tgz", @@ -83,6 +98,56 @@ "scripts/actions/documentation" ] }, + "node_modules/@discordjs/node-pre-gyp": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/@discordjs/node-pre-gyp/-/node-pre-gyp-0.4.5.tgz", + "integrity": "sha512-YJOVVZ545x24mHzANfYoy0BJX5PDyeZlpiJjDkUBM/V/Ao7TFX9lcUvCN4nr0tbr5ubeaXxtEBILUrHtTphVeQ==", + "license": "BSD-3-Clause", + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@discordjs/node-pre-gyp/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@discordjs/opus": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.9.0.tgz", + "integrity": "sha512-NEE76A96FtQ5YuoAVlOlB3ryMPrkXbUCTQICHGKb8ShtjXyubGicjRMouHtP1RpuDdm16cDa+oI3aAMo1zQRUQ==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@discordjs/node-pre-gyp": "^0.4.5", + "node-addon-api": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/@discordjs/rest": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.6.0.tgz", @@ -140,30 +205,32 @@ ] }, "node_modules/@discordjs/voice": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.17.0.tgz", - "integrity": "sha512-hArn9FF5ZYi1IkxdJEVnJi+OxlwLV0NJYWpKXsmNOojtGtAZHxmsELA+MZlu2KW1F/K1/nt7lFOfcMXNYweq9w==", - "deprecated": "This version uses deprecated encryption modes. Please use a newer version.", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.19.0.tgz", + "integrity": "sha512-UyX6rGEXzVyPzb1yvjHtPfTlnLvB5jX/stAMdiytHhfoydX+98hfympdOwsnTktzr+IRvphxTbdErgYDJkEsvw==", "license": "Apache-2.0", "dependencies": { - "@types/ws": "^8.5.10", - "discord-api-types": "0.37.83", + "@types/ws": "^8.18.1", + "discord-api-types": "^0.38.16", "prism-media": "^1.3.5", - "tslib": "^2.6.2", - "ws": "^8.16.0" + "tslib": "^2.8.1", + "ws": "^8.18.3" }, "engines": { - "node": ">=16.11.0" + "node": ">=22.12.0" }, "funding": { "url": "https://github.com/discordjs/discord.js?sponsor" } }, "node_modules/@discordjs/voice/node_modules/discord-api-types": { - "version": "0.37.83", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.83.tgz", - "integrity": "sha512-urGGYeWtWNYMKnYlZnOnDHm8fVRffQs3U0SpE8RHeiuLKb/u92APS8HoQnPTFbnXmY1vVnXjXO4dOxcAn3J+DA==", - "license": "MIT" + "version": "0.38.36", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.38.36.tgz", + "integrity": "sha512-qrbUbjjwtyeBg5HsAlm1C859epfOyiLjPqAOzkdWlCNsZCWJrertnETF/NwM8H+waMFU58xGSc5eXUfXah+WTQ==", + "license": "MIT", + "workspaces": [ + "scripts/actions/documentation" + ] }, "node_modules/@discordjs/ws": { "version": "1.2.3", @@ -326,6 +393,50 @@ "npm": ">=7.0.0" } }, + "node_modules/@snazzah/davey": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@snazzah/davey/-/davey-0.1.8.tgz", + "integrity": "sha512-f4NkCtU/4r9DUohp636qkZkxCF19v8Xq6W/1m4IKY2emZm+M2IdhWIv4GQxog2bQBWLNRRLD4DNM/UXEUb8W/A==", + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "funding": { + "url": "https://github.com/sponsors/Snazzah" + }, + "optionalDependencies": { + "@snazzah/davey-android-arm-eabi": "0.1.8", + "@snazzah/davey-android-arm64": "0.1.8", + "@snazzah/davey-darwin-arm64": "0.1.8", + "@snazzah/davey-darwin-x64": "0.1.8", + "@snazzah/davey-freebsd-x64": "0.1.8", + "@snazzah/davey-linux-arm-gnueabihf": "0.1.8", + "@snazzah/davey-linux-arm64-gnu": "0.1.8", + "@snazzah/davey-linux-arm64-musl": "0.1.8", + "@snazzah/davey-linux-x64-gnu": "0.1.8", + "@snazzah/davey-linux-x64-musl": "0.1.8", + "@snazzah/davey-wasm32-wasi": "0.1.8", + "@snazzah/davey-win32-arm64-msvc": "0.1.8", + "@snazzah/davey-win32-ia32-msvc": "0.1.8", + "@snazzah/davey-win32-x64-msvc": "0.1.8" + } + }, + "node_modules/@snazzah/davey-win32-x64-msvc": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@snazzah/davey-win32-x64-msvc/-/davey-win32-x64-msvc-0.1.8.tgz", + "integrity": "sha512-JKIco1miwtM4NgVwU/H9TJdUaSlJ+kdtydy3+tiV9cmJv0u1SM2NpwjV85H44xAQWW2zcRBHP0ZDriciHw09qQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@tsconfig/node10": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz", @@ -524,6 +635,12 @@ "npm": ">=7.0.0" } }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "license": "ISC" + }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -563,6 +680,50 @@ "node": ">=0.4.0" } }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -577,6 +738,26 @@ "node": ">= 8" } }, + "node_modules/aproba": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.1.0.tgz", + "integrity": "sha512-tLIEcj5GuR2RSTnxNKdkK0dJ/GrC7P38sUkiDmDuHfsHmbagTFAxDVIBltoklXEVIQ/f14IL8IMJ5pn9Hez1Ew==", + "license": "ISC" + }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -594,9 +775,49 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, "license": "MIT" }, + "node_modules/bare-addon-resolve": { + "version": "1.9.6", + "resolved": "https://registry.npmjs.org/bare-addon-resolve/-/bare-addon-resolve-1.9.6.tgz", + "integrity": "sha512-hvOQY1zDK6u0rSr27T6QlULoVLwi8J2k8HHHJlxSfT7XQdQ/7bsS+AnjYkHtu/TkL+gm3aMXAKucJkJAbrDG/g==", + "license": "Apache-2.0", + "dependencies": { + "bare-module-resolve": "^1.10.0", + "bare-semver": "^1.0.0" + }, + "peerDependencies": { + "bare-url": "*" + }, + "peerDependenciesMeta": { + "bare-url": { + "optional": true + } + } + }, + "node_modules/bare-module-resolve": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/bare-module-resolve/-/bare-module-resolve-1.12.0.tgz", + "integrity": "sha512-JrzrqlC3Tds0iKRwQs8xIIJ+FRieKA9ll0jaqpotDLZtjJPVevzRoeuUYZ5GIo1t1z7/pIRdk85Q3i/2xQLfEQ==", + "license": "Apache-2.0", + "dependencies": { + "bare-semver": "^1.0.0" + }, + "peerDependencies": { + "bare-url": "*" + }, + "peerDependenciesMeta": { + "bare-url": { + "optional": true + } + } + }, + "node_modules/bare-semver": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bare-semver/-/bare-semver-1.0.2.tgz", + "integrity": "sha512-ESVaN2nzWhcI5tf3Zzcq9aqCZ676VWzqw07eEZ0qxAcEOAFYBa0pWq8sK34OQeHLY3JsfKXZS9mDyzyxGjeLzA==", + "license": "Apache-2.0" + }, "node_modules/binary-extensions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", @@ -638,7 +859,6 @@ "version": "1.1.12", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -662,7 +882,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, "license": "MIT" }, "node_modules/bytes": { @@ -703,6 +922,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", + "license": "Apache-2.0" + }, "node_modules/chokidar": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", @@ -728,13 +953,51 @@ "fsevents": "~2.3.2" } }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "license": "ISC", + "bin": { + "color-support": "bin.js" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, "license": "MIT" }, + "node_modules/concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "engines": [ + "node >= 6.0" + ], + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "license": "ISC" + }, "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -800,6 +1063,12 @@ "ms": "2.0.0" } }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT" + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -819,6 +1088,15 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, "node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -932,6 +1210,12 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", "license": "MIT" }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, "node_modules/encodeurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", @@ -941,6 +1225,15 @@ "node": ">= 0.8" } }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/es-define-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", @@ -1072,6 +1365,22 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "license": "MIT" }, + "node_modules/ffmpeg-static": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ffmpeg-static/-/ffmpeg-static-5.3.0.tgz", + "integrity": "sha512-H+K6sW6TiIX6VGend0KQwthe+kaceeH/luE8dIZyOP35ik7ahYojDuqlTV1bOrtEwl01sy2HFNGQfi5IDJvotg==", + "hasInstallScript": true, + "license": "GPL-3.0-or-later", + "dependencies": { + "@derhuerst/http-basic": "^8.2.0", + "env-paths": "^2.2.0", + "https-proxy-agent": "^5.0.0", + "progress": "^2.0.3" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -1121,11 +1430,34 @@ "node": ">= 0.6" } }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, "license": "ISC" }, "node_modules/function-bind": { @@ -1137,6 +1469,27 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/get-intrinsic": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", @@ -1179,7 +1532,6 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", - "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -1233,6 +1585,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "license": "ISC" + }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", @@ -1261,6 +1619,57 @@ "node": ">= 0.8" } }, + "node_modules/http-response-object": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz", + "integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==", + "license": "MIT", + "dependencies": { + "@types/node": "^10.0.3" + } + }, + "node_modules/http-response-object/node_modules/@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", + "license": "MIT" + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -1278,7 +1687,6 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dev": true, "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -1339,6 +1747,15 @@ "node": ">=0.10.0" } }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -1362,6 +1779,21 @@ "node": ">=0.12.0" } }, + "node_modules/libsodium": { + "version": "0.7.15", + "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.15.tgz", + "integrity": "sha512-sZwRknt/tUpE2AwzHq3jEyUU5uvIZHtSssktXq7owd++3CSgn8RGrv6UZJJBpP7+iBghBqe7Z06/2M31rI2NKw==", + "license": "ISC" + }, + "node_modules/libsodium-wrappers": { + "version": "0.7.15", + "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.15.tgz", + "integrity": "sha512-E4anqJQwcfiC6+Yrl01C1m8p99wEhLmJSs0VQqST66SbQXXBoaJY0pF4BNjRYa/sOQAxx6lXAaAFIlx+15tXJQ==", + "license": "ISC", + "dependencies": { + "libsodium": "^0.7.15" + } + }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -1380,6 +1812,30 @@ "integrity": "sha512-ThQLOhN86ZkJ7qemtVRGYM+gRgR8GEXNli9H/PMvpnZsE44Xfh3wx9kGJaldg314v85m+bFW6WBMaVHJc/c3zA==", "license": "MIT" }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "license": "MIT", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -1460,7 +1916,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -1479,11 +1934,44 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true, "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" @@ -1507,6 +1995,47 @@ "node": ">= 0.6" } }, + "node_modules/node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", + "license": "MIT" + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "license": "ISC", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -1517,6 +2046,28 @@ "node": ">=0.10.0" } }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/object-inspect": { "version": "1.13.4", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", @@ -1554,12 +2105,16 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, "license": "ISC", "dependencies": { "wrappy": "1" } }, + "node_modules/parse-cache-control": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", + "integrity": "sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg==" + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -1573,7 +2128,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -1669,6 +2223,15 @@ "fsevents": "2.3.3" } }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -1730,6 +2293,20 @@ "node": ">= 0.8" } }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -1743,6 +2320,18 @@ "node": ">=8.10.0" } }, + "node_modules/require-addon": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/require-addon/-/require-addon-1.2.0.tgz", + "integrity": "sha512-VNPDZlYgIYQwWp9jMTzljx+k0ZtatKlcvOhktZ/anNPI3dQ9NXk7cq2U4iJ1wd9IrytRnYhyEocFWbkdPb+MYA==", + "license": "Apache-2.0", + "dependencies": { + "bare-addon-resolve": "^1.3.0" + }, + "engines": { + "bare": ">=1.10.0" + } + }, "node_modules/resolve": { "version": "1.22.11", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", @@ -1804,6 +2393,18 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "license": "MIT" }, + "node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/send": { "version": "0.19.0", "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", @@ -1858,6 +2459,12 @@ "node": ">= 0.8.0" } }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC" + }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -1936,6 +2543,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" + }, + "node_modules/sodium-native": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/sodium-native/-/sodium-native-4.3.3.tgz", + "integrity": "sha512-OnxSlN3uyY8D0EsLHpmm2HOFmKddQVvEMmsakCrXUzSd8kjjbzL413t4ZNF3n0UxSwNgwTyUvkmZHTfuCeiYSw==", + "license": "MIT", + "dependencies": { + "require-addon": "^1.1.0" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -1966,6 +2588,41 @@ "node": ">= 0.8" } }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -1999,6 +2656,23 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -2021,6 +2695,12 @@ "node": ">=0.6" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", @@ -2148,6 +2828,12 @@ "node": ">= 0.6" } }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "license": "MIT" + }, "node_modules/typescript": { "version": "5.9.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", @@ -2198,6 +2884,12 @@ "node": ">= 0.8" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -2223,11 +2915,35 @@ "node": ">= 0.8" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "license": "ISC", + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, "license": "ISC" }, "node_modules/ws": { @@ -2261,6 +2977,12 @@ "node": ">=0.4" } }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", diff --git a/node_modules/.prisma/client/default.d.ts b/node_modules/.prisma/client/default.d.ts index bac7a5c..bc20c6c 100644 --- a/node_modules/.prisma/client/default.d.ts +++ b/node_modules/.prisma/client/default.d.ts @@ -1,110 +1 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ - -import * as runtime from '@prisma/client/runtime/library' - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare const PrismaClient: any - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare type PrismaClient = any - -export declare class PrismaClientExtends< - ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, -> { - $extends: { extArgs: ExtArgs } & (< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ) => PrismaClientExtends & Args['client']) - - $transaction( - fn: (prisma: Omit) => Promise, - options?: { maxWait?: number; timeout?: number; isolationLevel?: string }, - ): Promise - $transaction

[]>( - arg: [...P], - options?: { isolationLevel?: string }, - ): Promise> -} - -export declare const dmmf: any -export declare type dmmf = any - -/** - * Get the type of the value, that the Promise holds. - */ -export declare type PromiseType> = T extends PromiseLike ? U : T - -/** - * Get the return type of a function which returns a Promise. - */ -export declare type PromiseReturnType Promise> = PromiseType> - -export namespace Prisma { - export type TransactionClient = any - - export function defineExtension< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ): (client: any) => PrismaClientExtends - - export type Extension = runtime.Types.Extensions.UserArgs - export import getExtensionContext = runtime.Extensions.getExtensionContext - export import Args = runtime.Types.Public.Args - export import Payload = runtime.Types.Public.Payload - export import Result = runtime.Types.Public.Result - export import Exact = runtime.Types.Public.Exact - export import PrismaPromise = runtime.Types.Public.PrismaPromise - - export const prismaVersion: { - client: string - engine: string - } -} +export * from "./index" \ No newline at end of file diff --git a/node_modules/.prisma/client/default.js b/node_modules/.prisma/client/default.js index 1938e5c..fa52f0c 100644 --- a/node_modules/.prisma/client/default.js +++ b/node_modules/.prisma/client/default.js @@ -1,65 +1 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/scripts/default-index.ts -var default_index_exports = {}; -__export(default_index_exports, { - Prisma: () => Prisma, - PrismaClient: () => PrismaClient, - default: () => default_index_default -}); -module.exports = __toCommonJS(default_index_exports); - -// ../../node_modules/.pnpm/@prisma+engines-version@5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2/node_modules/@prisma/engines-version/package.json -var prisma = { - enginesVersion: "605197351a3c8bdd595af2d2a9bc3025bca48ea2" -}; - -// package.json -var version = "5.22.0"; - -// src/runtime/utils/clientVersion.ts -var clientVersion = version; - -// src/scripts/default-index.ts -var PrismaClient = class { - constructor() { - throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.'); - } -}; -function defineExtension(ext) { - if (typeof ext === "function") { - return ext; - } - return (client) => client.$extends(ext); -} -function getExtensionContext(that) { - return that; -} -var Prisma = { - defineExtension, - getExtensionContext, - prismaVersion: { client: clientVersion, engine: prisma.enginesVersion } -}; -var default_index_default = { Prisma }; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Prisma, - PrismaClient -}); +module.exports = { ...require('.') } \ No newline at end of file diff --git a/node_modules/.prisma/client/edge.d.ts b/node_modules/.prisma/client/edge.d.ts index bac7a5c..274b8fa 100644 --- a/node_modules/.prisma/client/edge.d.ts +++ b/node_modules/.prisma/client/edge.d.ts @@ -1,110 +1 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ - -import * as runtime from '@prisma/client/runtime/library' - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare const PrismaClient: any - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare type PrismaClient = any - -export declare class PrismaClientExtends< - ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, -> { - $extends: { extArgs: ExtArgs } & (< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ) => PrismaClientExtends & Args['client']) - - $transaction( - fn: (prisma: Omit) => Promise, - options?: { maxWait?: number; timeout?: number; isolationLevel?: string }, - ): Promise - $transaction

[]>( - arg: [...P], - options?: { isolationLevel?: string }, - ): Promise> -} - -export declare const dmmf: any -export declare type dmmf = any - -/** - * Get the type of the value, that the Promise holds. - */ -export declare type PromiseType> = T extends PromiseLike ? U : T - -/** - * Get the return type of a function which returns a Promise. - */ -export declare type PromiseReturnType Promise> = PromiseType> - -export namespace Prisma { - export type TransactionClient = any - - export function defineExtension< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ): (client: any) => PrismaClientExtends - - export type Extension = runtime.Types.Extensions.UserArgs - export import getExtensionContext = runtime.Extensions.getExtensionContext - export import Args = runtime.Types.Public.Args - export import Payload = runtime.Types.Public.Payload - export import Result = runtime.Types.Public.Result - export import Exact = runtime.Types.Public.Exact - export import PrismaPromise = runtime.Types.Public.PrismaPromise - - export const prismaVersion: { - client: string - engine: string - } -} +export * from "./default" \ No newline at end of file diff --git a/node_modules/.prisma/client/edge.js b/node_modules/.prisma/client/edge.js index 1938e5c..9558902 100644 --- a/node_modules/.prisma/client/edge.js +++ b/node_modules/.prisma/client/edge.js @@ -1,65 +1,310 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -// src/scripts/default-index.ts -var default_index_exports = {}; -__export(default_index_exports, { - Prisma: () => Prisma, - PrismaClient: () => PrismaClient, - default: () => default_index_default -}); -module.exports = __toCommonJS(default_index_exports); +Object.defineProperty(exports, "__esModule", { value: true }); -// ../../node_modules/.pnpm/@prisma+engines-version@5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2/node_modules/@prisma/engines-version/package.json -var prisma = { - enginesVersion: "605197351a3c8bdd595af2d2a9bc3025bca48ea2" -}; +const { + PrismaClientKnownRequestError, + PrismaClientUnknownRequestError, + PrismaClientRustPanicError, + PrismaClientInitializationError, + PrismaClientValidationError, + NotFoundError, + getPrismaClient, + sqltag, + empty, + join, + raw, + skip, + Decimal, + Debug, + objectEnumValues, + makeStrictEnum, + Extensions, + warnOnce, + defineDmmfProperty, + Public, + getRuntime +} = require('@prisma/client/runtime/edge.js') -// package.json -var version = "5.22.0"; -// src/runtime/utils/clientVersion.ts -var clientVersion = version; +const Prisma = {} -// src/scripts/default-index.ts -var PrismaClient = class { - constructor() { - throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.'); - } -}; -function defineExtension(ext) { - if (typeof ext === "function") { - return ext; - } - return (client) => client.$extends(ext); +exports.Prisma = Prisma +exports.$Enums = {} + +/** + * Prisma Client JS version: 5.22.0 + * Query Engine version: 605197351a3c8bdd595af2d2a9bc3025bca48ea2 + */ +Prisma.prismaVersion = { + client: "5.22.0", + engine: "605197351a3c8bdd595af2d2a9bc3025bca48ea2" } -function getExtensionContext(that) { - return that; + +Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError; +Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError +Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError +Prisma.PrismaClientInitializationError = PrismaClientInitializationError +Prisma.PrismaClientValidationError = PrismaClientValidationError +Prisma.NotFoundError = NotFoundError +Prisma.Decimal = Decimal + +/** + * Re-export of sql-template-tag + */ +Prisma.sql = sqltag +Prisma.empty = empty +Prisma.join = join +Prisma.raw = raw +Prisma.validator = Public.validator + +/** +* Extensions +*/ +Prisma.getExtensionContext = Extensions.getExtensionContext +Prisma.defineExtension = Extensions.defineExtension + +/** + * Shorthand utilities for JSON filtering + */ +Prisma.DbNull = objectEnumValues.instances.DbNull +Prisma.JsonNull = objectEnumValues.instances.JsonNull +Prisma.AnyNull = objectEnumValues.instances.AnyNull + +Prisma.NullTypes = { + DbNull: objectEnumValues.classes.DbNull, + JsonNull: objectEnumValues.classes.JsonNull, + AnyNull: objectEnumValues.classes.AnyNull } -var Prisma = { - defineExtension, - getExtensionContext, - prismaVersion: { client: clientVersion, engine: prisma.enginesVersion } -}; -var default_index_default = { Prisma }; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Prisma, - PrismaClient + + + + + +/** + * Enums + */ +exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' }); + +exports.Prisma.GuildSettingsScalarFieldEnum = { + guildId: 'guildId', + welcomeChannelId: 'welcomeChannelId', + logChannelId: 'logChannelId', + automodEnabled: 'automodEnabled', + automodConfig: 'automodConfig', + levelingEnabled: 'levelingEnabled', + ticketsEnabled: 'ticketsEnabled', + musicEnabled: 'musicEnabled', + statuspageEnabled: 'statuspageEnabled', + statuspageConfig: 'statuspageConfig', + dynamicVoiceEnabled: 'dynamicVoiceEnabled', + dynamicVoiceConfig: 'dynamicVoiceConfig', + supportLoginConfig: 'supportLoginConfig', + birthdayEnabled: 'birthdayEnabled', + birthdayConfig: 'birthdayConfig', + reactionRolesEnabled: 'reactionRolesEnabled', + reactionRolesConfig: 'reactionRolesConfig', + eventsEnabled: 'eventsEnabled', + supportRoleId: 'supportRoleId', + updatedAt: 'updatedAt', + createdAt: 'createdAt' +}; + +exports.Prisma.TicketScalarFieldEnum = { + id: 'id', + ticketNumber: 'ticketNumber', + userId: 'userId', + channelId: 'channelId', + guildId: 'guildId', + topic: 'topic', + priority: 'priority', + status: 'status', + claimedBy: 'claimedBy', + transcript: 'transcript', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.LevelScalarFieldEnum = { + id: 'id', + userId: 'userId', + guildId: 'guildId', + xp: 'xp', + level: 'level', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.TicketSupportSessionScalarFieldEnum = { + id: 'id', + guildId: 'guildId', + userId: 'userId', + roleId: 'roleId', + startedAt: 'startedAt', + endedAt: 'endedAt', + durationSeconds: 'durationSeconds' +}; + +exports.Prisma.BirthdayScalarFieldEnum = { + id: 'id', + userId: 'userId', + guildId: 'guildId', + birthDate: 'birthDate', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.ReactionRoleSetScalarFieldEnum = { + id: 'id', + guildId: 'guildId', + channelId: 'channelId', + messageId: 'messageId', + title: 'title', + description: 'description', + entries: 'entries', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.EventScalarFieldEnum = { + id: 'id', + guildId: 'guildId', + title: 'title', + description: 'description', + channelId: 'channelId', + startTime: 'startTime', + repeatType: 'repeatType', + repeatConfig: 'repeatConfig', + reminderOffsetMinutes: 'reminderOffsetMinutes', + roleId: 'roleId', + isActive: 'isActive', + lastReminderAt: 'lastReminderAt', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.EventSignupScalarFieldEnum = { + id: 'id', + eventId: 'eventId', + guildId: 'guildId', + userId: 'userId', + createdAt: 'createdAt', + canceledAt: 'canceledAt' +}; + +exports.Prisma.SortOrder = { + asc: 'asc', + desc: 'desc' +}; + +exports.Prisma.NullableJsonNullValueInput = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull +}; + +exports.Prisma.JsonNullValueInput = { + JsonNull: Prisma.JsonNull +}; + +exports.Prisma.QueryMode = { + default: 'default', + insensitive: 'insensitive' +}; + +exports.Prisma.JsonNullValueFilter = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull, + AnyNull: Prisma.AnyNull +}; + +exports.Prisma.NullsOrder = { + first: 'first', + last: 'last' +}; + + +exports.Prisma.ModelName = { + GuildSettings: 'GuildSettings', + Ticket: 'Ticket', + Level: 'Level', + TicketSupportSession: 'TicketSupportSession', + Birthday: 'Birthday', + ReactionRoleSet: 'ReactionRoleSet', + Event: 'Event', + EventSignup: 'EventSignup' +}; +/** + * Create the Client + */ +const config = { + "generator": { + "name": "client", + "provider": { + "fromEnvVar": null, + "value": "prisma-client-js" + }, + "output": { + "value": "C:\\Users\\Pascal.Priessnitz\\Documents\\Development\\PapoV2\\Papo\\node_modules\\@prisma\\client", + "fromEnvVar": null + }, + "config": { + "engineType": "library" + }, + "binaryTargets": [ + { + "fromEnvVar": null, + "value": "windows", + "native": true + } + ], + "previewFeatures": [], + "sourceFilePath": "C:\\Users\\Pascal.Priessnitz\\Documents\\Development\\PapoV2\\Papo\\src\\database\\schema.prisma" + }, + "relativeEnvPaths": { + "rootEnvPath": null, + "schemaEnvPath": "../../../.env" + }, + "relativePath": "../../../src/database", + "clientVersion": "5.22.0", + "engineVersion": "605197351a3c8bdd595af2d2a9bc3025bca48ea2", + "datasourceNames": [ + "db" + ], + "activeProvider": "postgresql", + "postinstall": false, + "inlineDatasources": { + "db": { + "url": { + "fromEnvVar": "DATABASE_URL", + "value": null + } + } + }, + "inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel GuildSettings {\n guildId String @id\n welcomeChannelId String?\n logChannelId String?\n automodEnabled Boolean?\n automodConfig Json?\n levelingEnabled Boolean?\n ticketsEnabled Boolean?\n musicEnabled Boolean?\n statuspageEnabled Boolean?\n statuspageConfig Json?\n dynamicVoiceEnabled Boolean?\n dynamicVoiceConfig Json?\n supportLoginConfig Json?\n birthdayEnabled Boolean?\n birthdayConfig Json?\n reactionRolesEnabled Boolean?\n reactionRolesConfig Json?\n eventsEnabled Boolean?\n supportRoleId String?\n updatedAt DateTime @updatedAt\n createdAt DateTime @default(now())\n}\n\nmodel Ticket {\n id String @id @default(cuid())\n ticketNumber Int @default(autoincrement())\n userId String\n channelId String\n guildId String\n topic String?\n priority String @default(\"normal\")\n status String\n claimedBy String?\n transcript String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n}\n\nmodel Level {\n id String @id @default(cuid())\n userId String\n guildId String\n xp Int @default(0)\n level Int @default(0)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([userId, guildId], name: \"userId_guildId\")\n}\n\nmodel TicketSupportSession {\n id String @id @default(cuid())\n guildId String\n userId String\n roleId String\n startedAt DateTime @default(now())\n endedAt DateTime?\n durationSeconds Int?\n\n @@index([guildId, userId, endedAt])\n}\n\nmodel Birthday {\n id String @id @default(cuid())\n userId String\n guildId String\n birthDate String\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([userId, guildId], name: \"birthday_user_guild\")\n @@index([guildId])\n}\n\nmodel ReactionRoleSet {\n id String @id @default(cuid())\n guildId String\n channelId String\n messageId String?\n title String?\n description String?\n entries Json\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([guildId])\n @@index([guildId, messageId])\n}\n\nmodel Event {\n id String @id @default(cuid())\n guildId String\n title String\n description String?\n channelId String\n startTime DateTime\n repeatType String @default(\"none\")\n repeatConfig Json?\n reminderOffsetMinutes Int @default(60)\n roleId String?\n isActive Boolean @default(true)\n lastReminderAt DateTime?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n signups EventSignup[]\n\n @@index([guildId])\n @@index([guildId, startTime])\n}\n\nmodel EventSignup {\n id String @id @default(cuid())\n eventId String\n guildId String\n userId String\n createdAt DateTime @default(now())\n canceledAt DateTime?\n\n event Event @relation(fields: [eventId], references: [id])\n\n @@unique([eventId, userId])\n @@index([guildId, eventId])\n}\n", + "inlineSchemaHash": "568c90a02123b5936efbb0bcba9292354eae27a5022567e88b12cb219e10d706", + "copyEngine": true +} +config.dirname = '/' + +config.runtimeDataModel = JSON.parse("{\"models\":{\"GuildSettings\":{\"dbName\":null,\"fields\":[{\"name\":\"guildId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"welcomeChannelId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"logChannelId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"automodEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"automodConfig\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"levelingEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ticketsEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"musicEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"statuspageEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"statuspageConfig\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"dynamicVoiceEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"dynamicVoiceConfig\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"supportLoginConfig\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"birthdayEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"birthdayConfig\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"reactionRolesEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"reactionRolesConfig\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"eventsEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"supportRoleId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Ticket\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ticketNumber\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"channelId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"guildId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"topic\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"priority\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":\"normal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"claimedBy\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"transcript\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Level\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"guildId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"xp\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"level\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[[\"userId\",\"guildId\"]],\"uniqueIndexes\":[{\"name\":\"userId_guildId\",\"fields\":[\"userId\",\"guildId\"]}],\"isGenerated\":false},\"TicketSupportSession\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"guildId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"roleId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"startedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"endedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"durationSeconds\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Birthday\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"guildId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"birthDate\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[[\"userId\",\"guildId\"]],\"uniqueIndexes\":[{\"name\":\"birthday_user_guild\",\"fields\":[\"userId\",\"guildId\"]}],\"isGenerated\":false},\"ReactionRoleSet\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"guildId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"channelId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"messageId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entries\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Event\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"guildId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"channelId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"startTime\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"repeatType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":\"none\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"repeatConfig\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"reminderOffsetMinutes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":60,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"roleId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastReminderAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"signups\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"EventSignup\",\"relationName\":\"EventToEventSignup\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"EventSignup\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"eventId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"guildId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"canceledAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"event\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Event\",\"relationName\":\"EventToEventSignup\",\"relationFromFields\":[\"eventId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"eventId\",\"userId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"eventId\",\"userId\"]}],\"isGenerated\":false}},\"enums\":{},\"types\":{}}") +defineDmmfProperty(exports.Prisma, config.runtimeDataModel) +config.engineWasm = undefined + +config.injectableEdgeEnv = () => ({ + parsed: { + DATABASE_URL: typeof globalThis !== 'undefined' && globalThis['DATABASE_URL'] || typeof process !== 'undefined' && process.env && process.env.DATABASE_URL || undefined + } +}) + +if (typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined) { + Debug.enable(typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined) +} + +const PrismaClient = getPrismaClient(config) +exports.PrismaClient = PrismaClient +Object.assign(exports, Prisma) + diff --git a/node_modules/.prisma/client/index-browser.js b/node_modules/.prisma/client/index-browser.js index 1938e5c..ecb40d9 100644 --- a/node_modules/.prisma/client/index-browser.js +++ b/node_modules/.prisma/client/index-browser.js @@ -1,65 +1,302 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -// src/scripts/default-index.ts -var default_index_exports = {}; -__export(default_index_exports, { - Prisma: () => Prisma, - PrismaClient: () => PrismaClient, - default: () => default_index_default +Object.defineProperty(exports, "__esModule", { value: true }); + +const { + Decimal, + objectEnumValues, + makeStrictEnum, + Public, + getRuntime, + skip +} = require('@prisma/client/runtime/index-browser.js') + + +const Prisma = {} + +exports.Prisma = Prisma +exports.$Enums = {} + +/** + * Prisma Client JS version: 5.22.0 + * Query Engine version: 605197351a3c8bdd595af2d2a9bc3025bca48ea2 + */ +Prisma.prismaVersion = { + client: "5.22.0", + engine: "605197351a3c8bdd595af2d2a9bc3025bca48ea2" +} + +Prisma.PrismaClientKnownRequestError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)}; +Prisma.PrismaClientUnknownRequestError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.PrismaClientRustPanicError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.PrismaClientInitializationError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.PrismaClientValidationError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.NotFoundError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.Decimal = Decimal + +/** + * Re-export of sql-template-tag + */ +Prisma.sql = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.empty = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.join = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.raw = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.validator = Public.validator + +/** +* Extensions +*/ +Prisma.getExtensionContext = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.defineExtension = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} + +/** + * Shorthand utilities for JSON filtering + */ +Prisma.DbNull = objectEnumValues.instances.DbNull +Prisma.JsonNull = objectEnumValues.instances.JsonNull +Prisma.AnyNull = objectEnumValues.instances.AnyNull + +Prisma.NullTypes = { + DbNull: objectEnumValues.classes.DbNull, + JsonNull: objectEnumValues.classes.JsonNull, + AnyNull: objectEnumValues.classes.AnyNull +} + + + +/** + * Enums + */ + +exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' }); -module.exports = __toCommonJS(default_index_exports); -// ../../node_modules/.pnpm/@prisma+engines-version@5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2/node_modules/@prisma/engines-version/package.json -var prisma = { - enginesVersion: "605197351a3c8bdd595af2d2a9bc3025bca48ea2" +exports.Prisma.GuildSettingsScalarFieldEnum = { + guildId: 'guildId', + welcomeChannelId: 'welcomeChannelId', + logChannelId: 'logChannelId', + automodEnabled: 'automodEnabled', + automodConfig: 'automodConfig', + levelingEnabled: 'levelingEnabled', + ticketsEnabled: 'ticketsEnabled', + musicEnabled: 'musicEnabled', + statuspageEnabled: 'statuspageEnabled', + statuspageConfig: 'statuspageConfig', + dynamicVoiceEnabled: 'dynamicVoiceEnabled', + dynamicVoiceConfig: 'dynamicVoiceConfig', + supportLoginConfig: 'supportLoginConfig', + birthdayEnabled: 'birthdayEnabled', + birthdayConfig: 'birthdayConfig', + reactionRolesEnabled: 'reactionRolesEnabled', + reactionRolesConfig: 'reactionRolesConfig', + eventsEnabled: 'eventsEnabled', + supportRoleId: 'supportRoleId', + updatedAt: 'updatedAt', + createdAt: 'createdAt' }; -// package.json -var version = "5.22.0"; +exports.Prisma.TicketScalarFieldEnum = { + id: 'id', + ticketNumber: 'ticketNumber', + userId: 'userId', + channelId: 'channelId', + guildId: 'guildId', + topic: 'topic', + priority: 'priority', + status: 'status', + claimedBy: 'claimedBy', + transcript: 'transcript', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; -// src/runtime/utils/clientVersion.ts -var clientVersion = version; +exports.Prisma.LevelScalarFieldEnum = { + id: 'id', + userId: 'userId', + guildId: 'guildId', + xp: 'xp', + level: 'level', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; -// src/scripts/default-index.ts -var PrismaClient = class { +exports.Prisma.TicketSupportSessionScalarFieldEnum = { + id: 'id', + guildId: 'guildId', + userId: 'userId', + roleId: 'roleId', + startedAt: 'startedAt', + endedAt: 'endedAt', + durationSeconds: 'durationSeconds' +}; + +exports.Prisma.BirthdayScalarFieldEnum = { + id: 'id', + userId: 'userId', + guildId: 'guildId', + birthDate: 'birthDate', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.ReactionRoleSetScalarFieldEnum = { + id: 'id', + guildId: 'guildId', + channelId: 'channelId', + messageId: 'messageId', + title: 'title', + description: 'description', + entries: 'entries', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.EventScalarFieldEnum = { + id: 'id', + guildId: 'guildId', + title: 'title', + description: 'description', + channelId: 'channelId', + startTime: 'startTime', + repeatType: 'repeatType', + repeatConfig: 'repeatConfig', + reminderOffsetMinutes: 'reminderOffsetMinutes', + roleId: 'roleId', + isActive: 'isActive', + lastReminderAt: 'lastReminderAt', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.EventSignupScalarFieldEnum = { + id: 'id', + eventId: 'eventId', + guildId: 'guildId', + userId: 'userId', + createdAt: 'createdAt', + canceledAt: 'canceledAt' +}; + +exports.Prisma.SortOrder = { + asc: 'asc', + desc: 'desc' +}; + +exports.Prisma.NullableJsonNullValueInput = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull +}; + +exports.Prisma.JsonNullValueInput = { + JsonNull: Prisma.JsonNull +}; + +exports.Prisma.QueryMode = { + default: 'default', + insensitive: 'insensitive' +}; + +exports.Prisma.JsonNullValueFilter = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull, + AnyNull: Prisma.AnyNull +}; + +exports.Prisma.NullsOrder = { + first: 'first', + last: 'last' +}; + + +exports.Prisma.ModelName = { + GuildSettings: 'GuildSettings', + Ticket: 'Ticket', + Level: 'Level', + TicketSupportSession: 'TicketSupportSession', + Birthday: 'Birthday', + ReactionRoleSet: 'ReactionRoleSet', + Event: 'Event', + EventSignup: 'EventSignup' +}; + +/** + * This is a stub Prisma Client that will error at runtime if called. + */ +class PrismaClient { constructor() { - throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.'); + return new Proxy(this, { + get(target, prop) { + let message + const runtime = getRuntime() + if (runtime.isEdge) { + message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either: +- Use Prisma Accelerate: https://pris.ly/d/accelerate +- Use Driver Adapters: https://pris.ly/d/driver-adapters +`; + } else { + message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).' + } + + message += ` +If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report` + + throw new Error(message) + } + }) } -}; -function defineExtension(ext) { - if (typeof ext === "function") { - return ext; - } - return (client) => client.$extends(ext); } -function getExtensionContext(that) { - return that; -} -var Prisma = { - defineExtension, - getExtensionContext, - prismaVersion: { client: clientVersion, engine: prisma.enginesVersion } -}; -var default_index_default = { Prisma }; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Prisma, - PrismaClient -}); + +exports.PrismaClient = PrismaClient + +Object.assign(exports, Prisma) diff --git a/node_modules/.prisma/client/index.d.ts b/node_modules/.prisma/client/index.d.ts index bac7a5c..912c403 100644 --- a/node_modules/.prisma/client/index.d.ts +++ b/node_modules/.prisma/client/index.d.ts @@ -1,110 +1,12136 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import * as runtime from '@prisma/client/runtime/library' +/** + * Client +**/ + +import * as runtime from '@prisma/client/runtime/library.js'; +import $Types = runtime.Types // general types +import $Public = runtime.Types.Public +import $Utils = runtime.Types.Utils +import $Extensions = runtime.Types.Extensions +import $Result = runtime.Types.Result + +export type PrismaPromise = $Public.PrismaPromise + + +/** + * Model GuildSettings + * + */ +export type GuildSettings = $Result.DefaultSelection +/** + * Model Ticket + * + */ +export type Ticket = $Result.DefaultSelection +/** + * Model Level + * + */ +export type Level = $Result.DefaultSelection +/** + * Model TicketSupportSession + * + */ +export type TicketSupportSession = $Result.DefaultSelection +/** + * Model Birthday + * + */ +export type Birthday = $Result.DefaultSelection +/** + * Model ReactionRoleSet + * + */ +export type ReactionRoleSet = $Result.DefaultSelection +/** + * Model Event + * + */ +export type Event = $Result.DefaultSelection +/** + * Model EventSignup + * + */ +export type EventSignup = $Result.DefaultSelection /** * ## Prisma Client ʲˢ - * + * * Type-safe database client for TypeScript & Node.js * @example * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() + * const prisma = new PrismaClient() + * // Fetch zero or more GuildSettings + * const guildSettings = await prisma.guildSettings.findMany() * ``` * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). */ -export declare const PrismaClient: any - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare type PrismaClient = any - -export declare class PrismaClientExtends< - ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, +export class PrismaClient< + ClientOptions extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, + U = 'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array ? Prisma.GetEvents : never : never, + ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs > { - $extends: { extArgs: ExtArgs } & (< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ) => PrismaClientExtends & Args['client']) + [K: symbol]: { types: Prisma.TypeMap['other'] } - $transaction( - fn: (prisma: Omit) => Promise, - options?: { maxWait?: number; timeout?: number; isolationLevel?: string }, - ): Promise - $transaction

[]>( - arg: [...P], - options?: { isolationLevel?: string }, - ): Promise> + /** + * ## Prisma Client ʲˢ + * + * Type-safe database client for TypeScript & Node.js + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more GuildSettings + * const guildSettings = await prisma.guildSettings.findMany() + * ``` + * + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ + + constructor(optionsArg ?: Prisma.Subset); + $on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): void; + + /** + * Connect with the database + */ + $connect(): $Utils.JsPromise; + + /** + * Disconnect from the database + */ + $disconnect(): $Utils.JsPromise; + + /** + * Add a middleware + * @deprecated since 4.16.0. For new code, prefer client extensions instead. + * @see https://pris.ly/d/extensions + */ + $use(cb: Prisma.Middleware): void + +/** + * Executes a prepared raw query and returns the number of affected rows. + * @example + * ``` + * const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};` + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). + */ + $executeRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; + + /** + * Executes a raw query and returns the number of affected rows. + * Susceptible to SQL injections, see documentation. + * @example + * ``` + * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com') + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). + */ + $executeRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; + + /** + * Performs a prepared raw query and returns the `SELECT` data. + * @example + * ``` + * const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};` + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). + */ + $queryRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; + + /** + * Performs a raw query and returns the `SELECT` data. + * Susceptible to SQL injections, see documentation. + * @example + * ``` + * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com') + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). + */ + $queryRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; + + + /** + * Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole. + * @example + * ``` + * const [george, bob, alice] = await prisma.$transaction([ + * prisma.user.create({ data: { name: 'George' } }), + * prisma.user.create({ data: { name: 'Bob' } }), + * prisma.user.create({ data: { name: 'Alice' } }), + * ]) + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client/transactions). + */ + $transaction

[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): $Utils.JsPromise> + + $transaction(fn: (prisma: Omit) => $Utils.JsPromise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): $Utils.JsPromise + + + $extends: $Extensions.ExtendsHook<"extends", Prisma.TypeMapCb, ExtArgs> + + /** + * `prisma.guildSettings`: Exposes CRUD operations for the **GuildSettings** model. + * Example usage: + * ```ts + * // Fetch zero or more GuildSettings + * const guildSettings = await prisma.guildSettings.findMany() + * ``` + */ + get guildSettings(): Prisma.GuildSettingsDelegate; + + /** + * `prisma.ticket`: Exposes CRUD operations for the **Ticket** model. + * Example usage: + * ```ts + * // Fetch zero or more Tickets + * const tickets = await prisma.ticket.findMany() + * ``` + */ + get ticket(): Prisma.TicketDelegate; + + /** + * `prisma.level`: Exposes CRUD operations for the **Level** model. + * Example usage: + * ```ts + * // Fetch zero or more Levels + * const levels = await prisma.level.findMany() + * ``` + */ + get level(): Prisma.LevelDelegate; + + /** + * `prisma.ticketSupportSession`: Exposes CRUD operations for the **TicketSupportSession** model. + * Example usage: + * ```ts + * // Fetch zero or more TicketSupportSessions + * const ticketSupportSessions = await prisma.ticketSupportSession.findMany() + * ``` + */ + get ticketSupportSession(): Prisma.TicketSupportSessionDelegate; + + /** + * `prisma.birthday`: Exposes CRUD operations for the **Birthday** model. + * Example usage: + * ```ts + * // Fetch zero or more Birthdays + * const birthdays = await prisma.birthday.findMany() + * ``` + */ + get birthday(): Prisma.BirthdayDelegate; + + /** + * `prisma.reactionRoleSet`: Exposes CRUD operations for the **ReactionRoleSet** model. + * Example usage: + * ```ts + * // Fetch zero or more ReactionRoleSets + * const reactionRoleSets = await prisma.reactionRoleSet.findMany() + * ``` + */ + get reactionRoleSet(): Prisma.ReactionRoleSetDelegate; + + /** + * `prisma.event`: Exposes CRUD operations for the **Event** model. + * Example usage: + * ```ts + * // Fetch zero or more Events + * const events = await prisma.event.findMany() + * ``` + */ + get event(): Prisma.EventDelegate; + + /** + * `prisma.eventSignup`: Exposes CRUD operations for the **EventSignup** model. + * Example usage: + * ```ts + * // Fetch zero or more EventSignups + * const eventSignups = await prisma.eventSignup.findMany() + * ``` + */ + get eventSignup(): Prisma.EventSignupDelegate; } -export declare const dmmf: any -export declare type dmmf = any - -/** - * Get the type of the value, that the Promise holds. - */ -export declare type PromiseType> = T extends PromiseLike ? U : T - -/** - * Get the return type of a function which returns a Promise. - */ -export declare type PromiseReturnType Promise> = PromiseType> - export namespace Prisma { - export type TransactionClient = any + export import DMMF = runtime.DMMF - export function defineExtension< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ): (client: any) => PrismaClientExtends + export type PrismaPromise = $Public.PrismaPromise - export type Extension = runtime.Types.Extensions.UserArgs + /** + * Validator + */ + export import validator = runtime.Public.validator + + /** + * Prisma Errors + */ + export import PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError + export import PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError + export import PrismaClientRustPanicError = runtime.PrismaClientRustPanicError + export import PrismaClientInitializationError = runtime.PrismaClientInitializationError + export import PrismaClientValidationError = runtime.PrismaClientValidationError + export import NotFoundError = runtime.NotFoundError + + /** + * Re-export of sql-template-tag + */ + export import sql = runtime.sqltag + export import empty = runtime.empty + export import join = runtime.join + export import raw = runtime.raw + export import Sql = runtime.Sql + + + + /** + * Decimal.js + */ + export import Decimal = runtime.Decimal + + export type DecimalJsLike = runtime.DecimalJsLike + + /** + * Metrics + */ + export type Metrics = runtime.Metrics + export type Metric = runtime.Metric + export type MetricHistogram = runtime.MetricHistogram + export type MetricHistogramBucket = runtime.MetricHistogramBucket + + /** + * Extensions + */ + export import Extension = $Extensions.UserArgs export import getExtensionContext = runtime.Extensions.getExtensionContext - export import Args = runtime.Types.Public.Args - export import Payload = runtime.Types.Public.Payload - export import Result = runtime.Types.Public.Result - export import Exact = runtime.Types.Public.Exact - export import PrismaPromise = runtime.Types.Public.PrismaPromise + export import Args = $Public.Args + export import Payload = $Public.Payload + export import Result = $Public.Result + export import Exact = $Public.Exact - export const prismaVersion: { + /** + * Prisma Client JS version: 5.22.0 + * Query Engine version: 605197351a3c8bdd595af2d2a9bc3025bca48ea2 + */ + export type PrismaVersion = { client: string - engine: string } -} + + export const prismaVersion: PrismaVersion + + /** + * Utility Types + */ + + + export import JsonObject = runtime.JsonObject + export import JsonArray = runtime.JsonArray + export import JsonValue = runtime.JsonValue + export import InputJsonObject = runtime.InputJsonObject + export import InputJsonArray = runtime.InputJsonArray + export import InputJsonValue = runtime.InputJsonValue + + /** + * Types of the values used to represent different kinds of `null` values when working with JSON fields. + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + namespace NullTypes { + /** + * Type of `Prisma.DbNull`. + * + * You cannot use other instances of this class. Please use the `Prisma.DbNull` value. + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + class DbNull { + private DbNull: never + private constructor() + } + + /** + * Type of `Prisma.JsonNull`. + * + * You cannot use other instances of this class. Please use the `Prisma.JsonNull` value. + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + class JsonNull { + private JsonNull: never + private constructor() + } + + /** + * Type of `Prisma.AnyNull`. + * + * You cannot use other instances of this class. Please use the `Prisma.AnyNull` value. + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + class AnyNull { + private AnyNull: never + private constructor() + } + } + + /** + * Helper for filtering JSON entries that have `null` on the database (empty on the db) + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + export const DbNull: NullTypes.DbNull + + /** + * Helper for filtering JSON entries that have JSON `null` values (not empty on the db) + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + export const JsonNull: NullTypes.JsonNull + + /** + * Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull` + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + export const AnyNull: NullTypes.AnyNull + + type SelectAndInclude = { + select: any + include: any + } + + type SelectAndOmit = { + select: any + omit: any + } + + /** + * Get the type of the value, that the Promise holds. + */ + export type PromiseType> = T extends PromiseLike ? U : T; + + /** + * Get the return type of a function which returns a Promise. + */ + export type PromiseReturnType $Utils.JsPromise> = PromiseType> + + /** + * From T, pick a set of properties whose keys are in the union K + */ + type Prisma__Pick = { + [P in K]: T[P]; + }; + + + export type Enumerable = T | Array; + + export type RequiredKeys = { + [K in keyof T]-?: {} extends Prisma__Pick ? never : K + }[keyof T] + + export type TruthyKeys = keyof { + [K in keyof T as T[K] extends false | undefined | null ? never : K]: K + } + + export type TrueKeys = TruthyKeys>> + + /** + * Subset + * @desc From `T` pick properties that exist in `U`. Simple version of Intersection + */ + export type Subset = { + [key in keyof T]: key extends keyof U ? T[key] : never; + }; + + /** + * SelectSubset + * @desc From `T` pick properties that exist in `U`. Simple version of Intersection. + * Additionally, it validates, if both select and include are present. If the case, it errors. + */ + export type SelectSubset = { + [key in keyof T]: key extends keyof U ? T[key] : never + } & + (T extends SelectAndInclude + ? 'Please either choose `select` or `include`.' + : T extends SelectAndOmit + ? 'Please either choose `select` or `omit`.' + : {}) + + /** + * Subset + Intersection + * @desc From `T` pick properties that exist in `U` and intersect `K` + */ + export type SubsetIntersection = { + [key in keyof T]: key extends keyof U ? T[key] : never + } & + K + + type Without = { [P in Exclude]?: never }; + + /** + * XOR is needed to have a real mutually exclusive union type + * https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types + */ + type XOR = + T extends object ? + U extends object ? + (Without & U) | (Without & T) + : U : T + + + /** + * Is T a Record? + */ + type IsObject = T extends Array + ? False + : T extends Date + ? False + : T extends Uint8Array + ? False + : T extends BigInt + ? False + : T extends object + ? True + : False + + + /** + * If it's T[], return T + */ + export type UnEnumerate = T extends Array ? U : T + + /** + * From ts-toolbelt + */ + + type __Either = Omit & + { + // Merge all but K + [P in K]: Prisma__Pick // With K possibilities + }[K] + + type EitherStrict = Strict<__Either> + + type EitherLoose = ComputeRaw<__Either> + + type _Either< + O extends object, + K extends Key, + strict extends Boolean + > = { + 1: EitherStrict + 0: EitherLoose + }[strict] + + type Either< + O extends object, + K extends Key, + strict extends Boolean = 1 + > = O extends unknown ? _Either : never + + export type Union = any + + type PatchUndefined = { + [K in keyof O]: O[K] extends undefined ? At : O[K] + } & {} + + /** Helper Types for "Merge" **/ + export type IntersectOf = ( + U extends unknown ? (k: U) => void : never + ) extends (k: infer I) => void + ? I + : never + + export type Overwrite = { + [K in keyof O]: K extends keyof O1 ? O1[K] : O[K]; + } & {}; + + type _Merge = IntersectOf; + }>>; + + type Key = string | number | symbol; + type AtBasic = K extends keyof O ? O[K] : never; + type AtStrict = O[K & keyof O]; + type AtLoose = O extends unknown ? AtStrict : never; + export type At = { + 1: AtStrict; + 0: AtLoose; + }[strict]; + + export type ComputeRaw = A extends Function ? A : { + [K in keyof A]: A[K]; + } & {}; + + export type OptionalFlat = { + [K in keyof O]?: O[K]; + } & {}; + + type _Record = { + [P in K]: T; + }; + + // cause typescript not to expand types and preserve names + type NoExpand = T extends unknown ? T : never; + + // this type assumes the passed object is entirely optional + type AtLeast = NoExpand< + O extends unknown + ? | (K extends keyof O ? { [P in K]: O[P] } & O : O) + | {[P in keyof O as P extends K ? K : never]-?: O[P]} & O + : never>; + + type _Strict = U extends unknown ? U & OptionalFlat<_Record, keyof U>, never>> : never; + + export type Strict = ComputeRaw<_Strict>; + /** End Helper Types for "Merge" **/ + + export type Merge = ComputeRaw<_Merge>>; + + /** + A [[Boolean]] + */ + export type Boolean = True | False + + // /** + // 1 + // */ + export type True = 1 + + /** + 0 + */ + export type False = 0 + + export type Not = { + 0: 1 + 1: 0 + }[B] + + export type Extends = [A1] extends [never] + ? 0 // anything `never` is false + : A1 extends A2 + ? 1 + : 0 + + export type Has = Not< + Extends, U1> + > + + export type Or = { + 0: { + 0: 0 + 1: 1 + } + 1: { + 0: 1 + 1: 1 + } + }[B1][B2] + + export type Keys = U extends unknown ? keyof U : never + + type Cast = A extends B ? A : B; + + export const type: unique symbol; + + + + /** + * Used by group by + */ + + export type GetScalarType = O extends object ? { + [P in keyof T]: P extends keyof O + ? O[P] + : never + } : never + + type FieldPaths< + T, + U = Omit + > = IsObject extends True ? U : T + + type GetHavingFields = { + [K in keyof T]: Or< + Or, Extends<'AND', K>>, + Extends<'NOT', K> + > extends True + ? // infer is only needed to not hit TS limit + // based on the brilliant idea of Pierre-Antoine Mills + // https://github.com/microsoft/TypeScript/issues/30188#issuecomment-478938437 + T[K] extends infer TK + ? GetHavingFields extends object ? Merge> : never> + : never + : {} extends FieldPaths + ? never + : K + }[keyof T] + + /** + * Convert tuple to union + */ + type _TupleToUnion = T extends (infer E)[] ? E : never + type TupleToUnion = _TupleToUnion + type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T + + /** + * Like `Pick`, but additionally can also accept an array of keys + */ + type PickEnumerable | keyof T> = Prisma__Pick> + + /** + * Exclude all keys with underscores + */ + type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T + + + export type FieldRef = runtime.FieldRef + + type FieldRefInputType = Model extends never ? never : FieldRef + + + export const ModelName: { + GuildSettings: 'GuildSettings', + Ticket: 'Ticket', + Level: 'Level', + TicketSupportSession: 'TicketSupportSession', + Birthday: 'Birthday', + ReactionRoleSet: 'ReactionRoleSet', + Event: 'Event', + EventSignup: 'EventSignup' + }; + + export type ModelName = (typeof ModelName)[keyof typeof ModelName] + + + export type Datasources = { + db?: Datasource + } + + interface TypeMapCb extends $Utils.Fn<{extArgs: $Extensions.InternalArgs, clientOptions: PrismaClientOptions }, $Utils.Record> { + returns: Prisma.TypeMap + } + + export type TypeMap = { + meta: { + modelProps: "guildSettings" | "ticket" | "level" | "ticketSupportSession" | "birthday" | "reactionRoleSet" | "event" | "eventSignup" + txIsolationLevel: Prisma.TransactionIsolationLevel + } + model: { + GuildSettings: { + payload: Prisma.$GuildSettingsPayload + fields: Prisma.GuildSettingsFieldRefs + operations: { + findUnique: { + args: Prisma.GuildSettingsFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.GuildSettingsFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.GuildSettingsFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.GuildSettingsFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.GuildSettingsFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.GuildSettingsCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.GuildSettingsCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.GuildSettingsCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.GuildSettingsDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.GuildSettingsUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.GuildSettingsDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.GuildSettingsUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.GuildSettingsUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.GuildSettingsAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.GuildSettingsGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.GuildSettingsCountArgs + result: $Utils.Optional | number + } + } + } + Ticket: { + payload: Prisma.$TicketPayload + fields: Prisma.TicketFieldRefs + operations: { + findUnique: { + args: Prisma.TicketFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.TicketFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.TicketFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.TicketFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.TicketFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.TicketCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.TicketCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.TicketCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.TicketDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.TicketUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.TicketDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.TicketUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.TicketUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.TicketAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.TicketGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.TicketCountArgs + result: $Utils.Optional | number + } + } + } + Level: { + payload: Prisma.$LevelPayload + fields: Prisma.LevelFieldRefs + operations: { + findUnique: { + args: Prisma.LevelFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.LevelFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.LevelFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.LevelFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.LevelFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.LevelCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.LevelCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.LevelCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.LevelDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.LevelUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.LevelDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.LevelUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.LevelUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.LevelAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.LevelGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.LevelCountArgs + result: $Utils.Optional | number + } + } + } + TicketSupportSession: { + payload: Prisma.$TicketSupportSessionPayload + fields: Prisma.TicketSupportSessionFieldRefs + operations: { + findUnique: { + args: Prisma.TicketSupportSessionFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.TicketSupportSessionFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.TicketSupportSessionFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.TicketSupportSessionFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.TicketSupportSessionFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.TicketSupportSessionCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.TicketSupportSessionCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.TicketSupportSessionCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.TicketSupportSessionDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.TicketSupportSessionUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.TicketSupportSessionDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.TicketSupportSessionUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.TicketSupportSessionUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.TicketSupportSessionAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.TicketSupportSessionGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.TicketSupportSessionCountArgs + result: $Utils.Optional | number + } + } + } + Birthday: { + payload: Prisma.$BirthdayPayload + fields: Prisma.BirthdayFieldRefs + operations: { + findUnique: { + args: Prisma.BirthdayFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.BirthdayFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.BirthdayFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.BirthdayFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.BirthdayFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.BirthdayCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.BirthdayCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.BirthdayCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.BirthdayDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.BirthdayUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.BirthdayDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.BirthdayUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.BirthdayUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.BirthdayAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.BirthdayGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.BirthdayCountArgs + result: $Utils.Optional | number + } + } + } + ReactionRoleSet: { + payload: Prisma.$ReactionRoleSetPayload + fields: Prisma.ReactionRoleSetFieldRefs + operations: { + findUnique: { + args: Prisma.ReactionRoleSetFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.ReactionRoleSetFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.ReactionRoleSetFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.ReactionRoleSetFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.ReactionRoleSetFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.ReactionRoleSetCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.ReactionRoleSetCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.ReactionRoleSetCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.ReactionRoleSetDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.ReactionRoleSetUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.ReactionRoleSetDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.ReactionRoleSetUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.ReactionRoleSetUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.ReactionRoleSetAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.ReactionRoleSetGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.ReactionRoleSetCountArgs + result: $Utils.Optional | number + } + } + } + Event: { + payload: Prisma.$EventPayload + fields: Prisma.EventFieldRefs + operations: { + findUnique: { + args: Prisma.EventFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.EventFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.EventFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.EventFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.EventFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.EventCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.EventCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.EventCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.EventDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.EventUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.EventDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.EventUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.EventUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.EventAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.EventGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.EventCountArgs + result: $Utils.Optional | number + } + } + } + EventSignup: { + payload: Prisma.$EventSignupPayload + fields: Prisma.EventSignupFieldRefs + operations: { + findUnique: { + args: Prisma.EventSignupFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.EventSignupFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.EventSignupFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.EventSignupFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.EventSignupFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.EventSignupCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.EventSignupCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.EventSignupCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.EventSignupDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.EventSignupUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.EventSignupDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.EventSignupUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.EventSignupUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.EventSignupAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.EventSignupGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.EventSignupCountArgs + result: $Utils.Optional | number + } + } + } + } + } & { + other: { + payload: any + operations: { + $executeRaw: { + args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]], + result: any + } + $executeRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + $queryRaw: { + args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]], + result: any + } + $queryRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + } + } + } + export const defineExtension: $Extensions.ExtendsHook<"define", Prisma.TypeMapCb, $Extensions.DefaultArgs> + export type DefaultPrismaClient = PrismaClient + export type ErrorFormat = 'pretty' | 'colorless' | 'minimal' + export interface PrismaClientOptions { + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasources?: Datasources + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasourceUrl?: string + /** + * @default "colorless" + */ + errorFormat?: ErrorFormat + /** + * @example + * ``` + * // Defaults to stdout + * log: ['query', 'info', 'warn', 'error'] + * + * // Emit as events + * log: [ + * { emit: 'stdout', level: 'query' }, + * { emit: 'stdout', level: 'info' }, + * { emit: 'stdout', level: 'warn' } + * { emit: 'stdout', level: 'error' } + * ] + * ``` + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). + */ + log?: (LogLevel | LogDefinition)[] + /** + * The default values for transactionOptions + * maxWait ?= 2000 + * timeout ?= 5000 + */ + transactionOptions?: { + maxWait?: number + timeout?: number + isolationLevel?: Prisma.TransactionIsolationLevel + } + } + + + /* Types for Logging */ + export type LogLevel = 'info' | 'query' | 'warn' | 'error' + export type LogDefinition = { + level: LogLevel + emit: 'stdout' | 'event' + } + + export type GetLogType = T extends LogDefinition ? T['emit'] extends 'event' ? T['level'] : never : never + export type GetEvents = T extends Array ? + GetLogType | GetLogType | GetLogType | GetLogType + : never + + export type QueryEvent = { + timestamp: Date + query: string + params: string + duration: number + target: string + } + + export type LogEvent = { + timestamp: Date + message: string + target: string + } + /* End Types for Logging */ + + + export type PrismaAction = + | 'findUnique' + | 'findUniqueOrThrow' + | 'findMany' + | 'findFirst' + | 'findFirstOrThrow' + | 'create' + | 'createMany' + | 'createManyAndReturn' + | 'update' + | 'updateMany' + | 'upsert' + | 'delete' + | 'deleteMany' + | 'executeRaw' + | 'queryRaw' + | 'aggregate' + | 'count' + | 'runCommandRaw' + | 'findRaw' + | 'groupBy' + + /** + * These options are being passed into the middleware as "params" + */ + export type MiddlewareParams = { + model?: ModelName + action: PrismaAction + args: any + dataPath: string[] + runInTransaction: boolean + } + + /** + * The `T` type makes sure, that the `return proceed` is not forgotten in the middleware implementation + */ + export type Middleware = ( + params: MiddlewareParams, + next: (params: MiddlewareParams) => $Utils.JsPromise, + ) => $Utils.JsPromise + + // tested in getLogLevel.test.ts + export function getLogLevel(log: Array): LogLevel | undefined; + + /** + * `PrismaClient` proxy available in interactive transactions. + */ + export type TransactionClient = Omit + + export type Datasource = { + url?: string + } + + /** + * Count Types + */ + + + /** + * Count Type EventCountOutputType + */ + + export type EventCountOutputType = { + signups: number + } + + export type EventCountOutputTypeSelect = { + signups?: boolean | EventCountOutputTypeCountSignupsArgs + } + + // Custom InputTypes + /** + * EventCountOutputType without action + */ + export type EventCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the EventCountOutputType + */ + select?: EventCountOutputTypeSelect | null + } + + /** + * EventCountOutputType without action + */ + export type EventCountOutputTypeCountSignupsArgs = { + where?: EventSignupWhereInput + } + + + /** + * Models + */ + + /** + * Model GuildSettings + */ + + export type AggregateGuildSettings = { + _count: GuildSettingsCountAggregateOutputType | null + _min: GuildSettingsMinAggregateOutputType | null + _max: GuildSettingsMaxAggregateOutputType | null + } + + export type GuildSettingsMinAggregateOutputType = { + guildId: string | null + welcomeChannelId: string | null + logChannelId: string | null + automodEnabled: boolean | null + levelingEnabled: boolean | null + ticketsEnabled: boolean | null + musicEnabled: boolean | null + statuspageEnabled: boolean | null + dynamicVoiceEnabled: boolean | null + birthdayEnabled: boolean | null + reactionRolesEnabled: boolean | null + eventsEnabled: boolean | null + supportRoleId: string | null + updatedAt: Date | null + createdAt: Date | null + } + + export type GuildSettingsMaxAggregateOutputType = { + guildId: string | null + welcomeChannelId: string | null + logChannelId: string | null + automodEnabled: boolean | null + levelingEnabled: boolean | null + ticketsEnabled: boolean | null + musicEnabled: boolean | null + statuspageEnabled: boolean | null + dynamicVoiceEnabled: boolean | null + birthdayEnabled: boolean | null + reactionRolesEnabled: boolean | null + eventsEnabled: boolean | null + supportRoleId: string | null + updatedAt: Date | null + createdAt: Date | null + } + + export type GuildSettingsCountAggregateOutputType = { + guildId: number + welcomeChannelId: number + logChannelId: number + automodEnabled: number + automodConfig: number + levelingEnabled: number + ticketsEnabled: number + musicEnabled: number + statuspageEnabled: number + statuspageConfig: number + dynamicVoiceEnabled: number + dynamicVoiceConfig: number + supportLoginConfig: number + birthdayEnabled: number + birthdayConfig: number + reactionRolesEnabled: number + reactionRolesConfig: number + eventsEnabled: number + supportRoleId: number + updatedAt: number + createdAt: number + _all: number + } + + + export type GuildSettingsMinAggregateInputType = { + guildId?: true + welcomeChannelId?: true + logChannelId?: true + automodEnabled?: true + levelingEnabled?: true + ticketsEnabled?: true + musicEnabled?: true + statuspageEnabled?: true + dynamicVoiceEnabled?: true + birthdayEnabled?: true + reactionRolesEnabled?: true + eventsEnabled?: true + supportRoleId?: true + updatedAt?: true + createdAt?: true + } + + export type GuildSettingsMaxAggregateInputType = { + guildId?: true + welcomeChannelId?: true + logChannelId?: true + automodEnabled?: true + levelingEnabled?: true + ticketsEnabled?: true + musicEnabled?: true + statuspageEnabled?: true + dynamicVoiceEnabled?: true + birthdayEnabled?: true + reactionRolesEnabled?: true + eventsEnabled?: true + supportRoleId?: true + updatedAt?: true + createdAt?: true + } + + export type GuildSettingsCountAggregateInputType = { + guildId?: true + welcomeChannelId?: true + logChannelId?: true + automodEnabled?: true + automodConfig?: true + levelingEnabled?: true + ticketsEnabled?: true + musicEnabled?: true + statuspageEnabled?: true + statuspageConfig?: true + dynamicVoiceEnabled?: true + dynamicVoiceConfig?: true + supportLoginConfig?: true + birthdayEnabled?: true + birthdayConfig?: true + reactionRolesEnabled?: true + reactionRolesConfig?: true + eventsEnabled?: true + supportRoleId?: true + updatedAt?: true + createdAt?: true + _all?: true + } + + export type GuildSettingsAggregateArgs = { + /** + * Filter which GuildSettings to aggregate. + */ + where?: GuildSettingsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of GuildSettings to fetch. + */ + orderBy?: GuildSettingsOrderByWithRelationInput | GuildSettingsOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: GuildSettingsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` GuildSettings from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` GuildSettings. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned GuildSettings + **/ + _count?: true | GuildSettingsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: GuildSettingsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: GuildSettingsMaxAggregateInputType + } + + export type GetGuildSettingsAggregateType = { + [P in keyof T & keyof AggregateGuildSettings]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type GuildSettingsGroupByArgs = { + where?: GuildSettingsWhereInput + orderBy?: GuildSettingsOrderByWithAggregationInput | GuildSettingsOrderByWithAggregationInput[] + by: GuildSettingsScalarFieldEnum[] | GuildSettingsScalarFieldEnum + having?: GuildSettingsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: GuildSettingsCountAggregateInputType | true + _min?: GuildSettingsMinAggregateInputType + _max?: GuildSettingsMaxAggregateInputType + } + + export type GuildSettingsGroupByOutputType = { + guildId: string + welcomeChannelId: string | null + logChannelId: string | null + automodEnabled: boolean | null + automodConfig: JsonValue | null + levelingEnabled: boolean | null + ticketsEnabled: boolean | null + musicEnabled: boolean | null + statuspageEnabled: boolean | null + statuspageConfig: JsonValue | null + dynamicVoiceEnabled: boolean | null + dynamicVoiceConfig: JsonValue | null + supportLoginConfig: JsonValue | null + birthdayEnabled: boolean | null + birthdayConfig: JsonValue | null + reactionRolesEnabled: boolean | null + reactionRolesConfig: JsonValue | null + eventsEnabled: boolean | null + supportRoleId: string | null + updatedAt: Date + createdAt: Date + _count: GuildSettingsCountAggregateOutputType | null + _min: GuildSettingsMinAggregateOutputType | null + _max: GuildSettingsMaxAggregateOutputType | null + } + + type GetGuildSettingsGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof GuildSettingsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type GuildSettingsSelect = $Extensions.GetSelect<{ + guildId?: boolean + welcomeChannelId?: boolean + logChannelId?: boolean + automodEnabled?: boolean + automodConfig?: boolean + levelingEnabled?: boolean + ticketsEnabled?: boolean + musicEnabled?: boolean + statuspageEnabled?: boolean + statuspageConfig?: boolean + dynamicVoiceEnabled?: boolean + dynamicVoiceConfig?: boolean + supportLoginConfig?: boolean + birthdayEnabled?: boolean + birthdayConfig?: boolean + reactionRolesEnabled?: boolean + reactionRolesConfig?: boolean + eventsEnabled?: boolean + supportRoleId?: boolean + updatedAt?: boolean + createdAt?: boolean + }, ExtArgs["result"]["guildSettings"]> + + export type GuildSettingsSelectCreateManyAndReturn = $Extensions.GetSelect<{ + guildId?: boolean + welcomeChannelId?: boolean + logChannelId?: boolean + automodEnabled?: boolean + automodConfig?: boolean + levelingEnabled?: boolean + ticketsEnabled?: boolean + musicEnabled?: boolean + statuspageEnabled?: boolean + statuspageConfig?: boolean + dynamicVoiceEnabled?: boolean + dynamicVoiceConfig?: boolean + supportLoginConfig?: boolean + birthdayEnabled?: boolean + birthdayConfig?: boolean + reactionRolesEnabled?: boolean + reactionRolesConfig?: boolean + eventsEnabled?: boolean + supportRoleId?: boolean + updatedAt?: boolean + createdAt?: boolean + }, ExtArgs["result"]["guildSettings"]> + + export type GuildSettingsSelectScalar = { + guildId?: boolean + welcomeChannelId?: boolean + logChannelId?: boolean + automodEnabled?: boolean + automodConfig?: boolean + levelingEnabled?: boolean + ticketsEnabled?: boolean + musicEnabled?: boolean + statuspageEnabled?: boolean + statuspageConfig?: boolean + dynamicVoiceEnabled?: boolean + dynamicVoiceConfig?: boolean + supportLoginConfig?: boolean + birthdayEnabled?: boolean + birthdayConfig?: boolean + reactionRolesEnabled?: boolean + reactionRolesConfig?: boolean + eventsEnabled?: boolean + supportRoleId?: boolean + updatedAt?: boolean + createdAt?: boolean + } + + + export type $GuildSettingsPayload = { + name: "GuildSettings" + objects: {} + scalars: $Extensions.GetPayloadResult<{ + guildId: string + welcomeChannelId: string | null + logChannelId: string | null + automodEnabled: boolean | null + automodConfig: Prisma.JsonValue | null + levelingEnabled: boolean | null + ticketsEnabled: boolean | null + musicEnabled: boolean | null + statuspageEnabled: boolean | null + statuspageConfig: Prisma.JsonValue | null + dynamicVoiceEnabled: boolean | null + dynamicVoiceConfig: Prisma.JsonValue | null + supportLoginConfig: Prisma.JsonValue | null + birthdayEnabled: boolean | null + birthdayConfig: Prisma.JsonValue | null + reactionRolesEnabled: boolean | null + reactionRolesConfig: Prisma.JsonValue | null + eventsEnabled: boolean | null + supportRoleId: string | null + updatedAt: Date + createdAt: Date + }, ExtArgs["result"]["guildSettings"]> + composites: {} + } + + type GuildSettingsGetPayload = $Result.GetResult + + type GuildSettingsCountArgs = + Omit & { + select?: GuildSettingsCountAggregateInputType | true + } + + export interface GuildSettingsDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['GuildSettings'], meta: { name: 'GuildSettings' } } + /** + * Find zero or one GuildSettings that matches the filter. + * @param {GuildSettingsFindUniqueArgs} args - Arguments to find a GuildSettings + * @example + * // Get one GuildSettings + * const guildSettings = await prisma.guildSettings.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__GuildSettingsClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one GuildSettings that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {GuildSettingsFindUniqueOrThrowArgs} args - Arguments to find a GuildSettings + * @example + * // Get one GuildSettings + * const guildSettings = await prisma.guildSettings.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__GuildSettingsClient<$Result.GetResult, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first GuildSettings that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {GuildSettingsFindFirstArgs} args - Arguments to find a GuildSettings + * @example + * // Get one GuildSettings + * const guildSettings = await prisma.guildSettings.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__GuildSettingsClient<$Result.GetResult, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first GuildSettings that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {GuildSettingsFindFirstOrThrowArgs} args - Arguments to find a GuildSettings + * @example + * // Get one GuildSettings + * const guildSettings = await prisma.guildSettings.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__GuildSettingsClient<$Result.GetResult, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more GuildSettings that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {GuildSettingsFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all GuildSettings + * const guildSettings = await prisma.guildSettings.findMany() + * + * // Get first 10 GuildSettings + * const guildSettings = await prisma.guildSettings.findMany({ take: 10 }) + * + * // Only select the `guildId` + * const guildSettingsWithGuildIdOnly = await prisma.guildSettings.findMany({ select: { guildId: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany">> + + /** + * Create a GuildSettings. + * @param {GuildSettingsCreateArgs} args - Arguments to create a GuildSettings. + * @example + * // Create one GuildSettings + * const GuildSettings = await prisma.guildSettings.create({ + * data: { + * // ... data to create a GuildSettings + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__GuildSettingsClient<$Result.GetResult, T, "create">, never, ExtArgs> + + /** + * Create many GuildSettings. + * @param {GuildSettingsCreateManyArgs} args - Arguments to create many GuildSettings. + * @example + * // Create many GuildSettings + * const guildSettings = await prisma.guildSettings.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many GuildSettings and returns the data saved in the database. + * @param {GuildSettingsCreateManyAndReturnArgs} args - Arguments to create many GuildSettings. + * @example + * // Create many GuildSettings + * const guildSettings = await prisma.guildSettings.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many GuildSettings and only return the `guildId` + * const guildSettingsWithGuildIdOnly = await prisma.guildSettings.createManyAndReturn({ + * select: { guildId: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn">> + + /** + * Delete a GuildSettings. + * @param {GuildSettingsDeleteArgs} args - Arguments to delete one GuildSettings. + * @example + * // Delete one GuildSettings + * const GuildSettings = await prisma.guildSettings.delete({ + * where: { + * // ... filter to delete one GuildSettings + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__GuildSettingsClient<$Result.GetResult, T, "delete">, never, ExtArgs> + + /** + * Update one GuildSettings. + * @param {GuildSettingsUpdateArgs} args - Arguments to update one GuildSettings. + * @example + * // Update one GuildSettings + * const guildSettings = await prisma.guildSettings.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__GuildSettingsClient<$Result.GetResult, T, "update">, never, ExtArgs> + + /** + * Delete zero or more GuildSettings. + * @param {GuildSettingsDeleteManyArgs} args - Arguments to filter GuildSettings to delete. + * @example + * // Delete a few GuildSettings + * const { count } = await prisma.guildSettings.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more GuildSettings. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {GuildSettingsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many GuildSettings + * const guildSettings = await prisma.guildSettings.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one GuildSettings. + * @param {GuildSettingsUpsertArgs} args - Arguments to update or create a GuildSettings. + * @example + * // Update or create a GuildSettings + * const guildSettings = await prisma.guildSettings.upsert({ + * create: { + * // ... data to create a GuildSettings + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the GuildSettings we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__GuildSettingsClient<$Result.GetResult, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of GuildSettings. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {GuildSettingsCountArgs} args - Arguments to filter GuildSettings to count. + * @example + * // Count the number of GuildSettings + * const count = await prisma.guildSettings.count({ + * where: { + * // ... the filter for the GuildSettings we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a GuildSettings. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {GuildSettingsAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by GuildSettings. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {GuildSettingsGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends GuildSettingsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: GuildSettingsGroupByArgs['orderBy'] } + : { orderBy?: GuildSettingsGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends MaybeTupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetGuildSettingsGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the GuildSettings model + */ + readonly fields: GuildSettingsFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for GuildSettings. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export interface Prisma__GuildSettingsClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise + } + + + + + /** + * Fields of the GuildSettings model + */ + interface GuildSettingsFieldRefs { + readonly guildId: FieldRef<"GuildSettings", 'String'> + readonly welcomeChannelId: FieldRef<"GuildSettings", 'String'> + readonly logChannelId: FieldRef<"GuildSettings", 'String'> + readonly automodEnabled: FieldRef<"GuildSettings", 'Boolean'> + readonly automodConfig: FieldRef<"GuildSettings", 'Json'> + readonly levelingEnabled: FieldRef<"GuildSettings", 'Boolean'> + readonly ticketsEnabled: FieldRef<"GuildSettings", 'Boolean'> + readonly musicEnabled: FieldRef<"GuildSettings", 'Boolean'> + readonly statuspageEnabled: FieldRef<"GuildSettings", 'Boolean'> + readonly statuspageConfig: FieldRef<"GuildSettings", 'Json'> + readonly dynamicVoiceEnabled: FieldRef<"GuildSettings", 'Boolean'> + readonly dynamicVoiceConfig: FieldRef<"GuildSettings", 'Json'> + readonly supportLoginConfig: FieldRef<"GuildSettings", 'Json'> + readonly birthdayEnabled: FieldRef<"GuildSettings", 'Boolean'> + readonly birthdayConfig: FieldRef<"GuildSettings", 'Json'> + readonly reactionRolesEnabled: FieldRef<"GuildSettings", 'Boolean'> + readonly reactionRolesConfig: FieldRef<"GuildSettings", 'Json'> + readonly eventsEnabled: FieldRef<"GuildSettings", 'Boolean'> + readonly supportRoleId: FieldRef<"GuildSettings", 'String'> + readonly updatedAt: FieldRef<"GuildSettings", 'DateTime'> + readonly createdAt: FieldRef<"GuildSettings", 'DateTime'> + } + + + // Custom InputTypes + /** + * GuildSettings findUnique + */ + export type GuildSettingsFindUniqueArgs = { + /** + * Select specific fields to fetch from the GuildSettings + */ + select?: GuildSettingsSelect | null + /** + * Filter, which GuildSettings to fetch. + */ + where: GuildSettingsWhereUniqueInput + } + + /** + * GuildSettings findUniqueOrThrow + */ + export type GuildSettingsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the GuildSettings + */ + select?: GuildSettingsSelect | null + /** + * Filter, which GuildSettings to fetch. + */ + where: GuildSettingsWhereUniqueInput + } + + /** + * GuildSettings findFirst + */ + export type GuildSettingsFindFirstArgs = { + /** + * Select specific fields to fetch from the GuildSettings + */ + select?: GuildSettingsSelect | null + /** + * Filter, which GuildSettings to fetch. + */ + where?: GuildSettingsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of GuildSettings to fetch. + */ + orderBy?: GuildSettingsOrderByWithRelationInput | GuildSettingsOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for GuildSettings. + */ + cursor?: GuildSettingsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` GuildSettings from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` GuildSettings. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of GuildSettings. + */ + distinct?: GuildSettingsScalarFieldEnum | GuildSettingsScalarFieldEnum[] + } + + /** + * GuildSettings findFirstOrThrow + */ + export type GuildSettingsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the GuildSettings + */ + select?: GuildSettingsSelect | null + /** + * Filter, which GuildSettings to fetch. + */ + where?: GuildSettingsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of GuildSettings to fetch. + */ + orderBy?: GuildSettingsOrderByWithRelationInput | GuildSettingsOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for GuildSettings. + */ + cursor?: GuildSettingsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` GuildSettings from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` GuildSettings. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of GuildSettings. + */ + distinct?: GuildSettingsScalarFieldEnum | GuildSettingsScalarFieldEnum[] + } + + /** + * GuildSettings findMany + */ + export type GuildSettingsFindManyArgs = { + /** + * Select specific fields to fetch from the GuildSettings + */ + select?: GuildSettingsSelect | null + /** + * Filter, which GuildSettings to fetch. + */ + where?: GuildSettingsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of GuildSettings to fetch. + */ + orderBy?: GuildSettingsOrderByWithRelationInput | GuildSettingsOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing GuildSettings. + */ + cursor?: GuildSettingsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` GuildSettings from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` GuildSettings. + */ + skip?: number + distinct?: GuildSettingsScalarFieldEnum | GuildSettingsScalarFieldEnum[] + } + + /** + * GuildSettings create + */ + export type GuildSettingsCreateArgs = { + /** + * Select specific fields to fetch from the GuildSettings + */ + select?: GuildSettingsSelect | null + /** + * The data needed to create a GuildSettings. + */ + data: XOR + } + + /** + * GuildSettings createMany + */ + export type GuildSettingsCreateManyArgs = { + /** + * The data used to create many GuildSettings. + */ + data: GuildSettingsCreateManyInput | GuildSettingsCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * GuildSettings createManyAndReturn + */ + export type GuildSettingsCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the GuildSettings + */ + select?: GuildSettingsSelectCreateManyAndReturn | null + /** + * The data used to create many GuildSettings. + */ + data: GuildSettingsCreateManyInput | GuildSettingsCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * GuildSettings update + */ + export type GuildSettingsUpdateArgs = { + /** + * Select specific fields to fetch from the GuildSettings + */ + select?: GuildSettingsSelect | null + /** + * The data needed to update a GuildSettings. + */ + data: XOR + /** + * Choose, which GuildSettings to update. + */ + where: GuildSettingsWhereUniqueInput + } + + /** + * GuildSettings updateMany + */ + export type GuildSettingsUpdateManyArgs = { + /** + * The data used to update GuildSettings. + */ + data: XOR + /** + * Filter which GuildSettings to update + */ + where?: GuildSettingsWhereInput + } + + /** + * GuildSettings upsert + */ + export type GuildSettingsUpsertArgs = { + /** + * Select specific fields to fetch from the GuildSettings + */ + select?: GuildSettingsSelect | null + /** + * The filter to search for the GuildSettings to update in case it exists. + */ + where: GuildSettingsWhereUniqueInput + /** + * In case the GuildSettings found by the `where` argument doesn't exist, create a new GuildSettings with this data. + */ + create: XOR + /** + * In case the GuildSettings was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * GuildSettings delete + */ + export type GuildSettingsDeleteArgs = { + /** + * Select specific fields to fetch from the GuildSettings + */ + select?: GuildSettingsSelect | null + /** + * Filter which GuildSettings to delete. + */ + where: GuildSettingsWhereUniqueInput + } + + /** + * GuildSettings deleteMany + */ + export type GuildSettingsDeleteManyArgs = { + /** + * Filter which GuildSettings to delete + */ + where?: GuildSettingsWhereInput + } + + /** + * GuildSettings without action + */ + export type GuildSettingsDefaultArgs = { + /** + * Select specific fields to fetch from the GuildSettings + */ + select?: GuildSettingsSelect | null + } + + + /** + * Model Ticket + */ + + export type AggregateTicket = { + _count: TicketCountAggregateOutputType | null + _avg: TicketAvgAggregateOutputType | null + _sum: TicketSumAggregateOutputType | null + _min: TicketMinAggregateOutputType | null + _max: TicketMaxAggregateOutputType | null + } + + export type TicketAvgAggregateOutputType = { + ticketNumber: number | null + } + + export type TicketSumAggregateOutputType = { + ticketNumber: number | null + } + + export type TicketMinAggregateOutputType = { + id: string | null + ticketNumber: number | null + userId: string | null + channelId: string | null + guildId: string | null + topic: string | null + priority: string | null + status: string | null + claimedBy: string | null + transcript: string | null + createdAt: Date | null + updatedAt: Date | null + } + + export type TicketMaxAggregateOutputType = { + id: string | null + ticketNumber: number | null + userId: string | null + channelId: string | null + guildId: string | null + topic: string | null + priority: string | null + status: string | null + claimedBy: string | null + transcript: string | null + createdAt: Date | null + updatedAt: Date | null + } + + export type TicketCountAggregateOutputType = { + id: number + ticketNumber: number + userId: number + channelId: number + guildId: number + topic: number + priority: number + status: number + claimedBy: number + transcript: number + createdAt: number + updatedAt: number + _all: number + } + + + export type TicketAvgAggregateInputType = { + ticketNumber?: true + } + + export type TicketSumAggregateInputType = { + ticketNumber?: true + } + + export type TicketMinAggregateInputType = { + id?: true + ticketNumber?: true + userId?: true + channelId?: true + guildId?: true + topic?: true + priority?: true + status?: true + claimedBy?: true + transcript?: true + createdAt?: true + updatedAt?: true + } + + export type TicketMaxAggregateInputType = { + id?: true + ticketNumber?: true + userId?: true + channelId?: true + guildId?: true + topic?: true + priority?: true + status?: true + claimedBy?: true + transcript?: true + createdAt?: true + updatedAt?: true + } + + export type TicketCountAggregateInputType = { + id?: true + ticketNumber?: true + userId?: true + channelId?: true + guildId?: true + topic?: true + priority?: true + status?: true + claimedBy?: true + transcript?: true + createdAt?: true + updatedAt?: true + _all?: true + } + + export type TicketAggregateArgs = { + /** + * Filter which Ticket to aggregate. + */ + where?: TicketWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Tickets to fetch. + */ + orderBy?: TicketOrderByWithRelationInput | TicketOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: TicketWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Tickets from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Tickets. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Tickets + **/ + _count?: true | TicketCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: TicketAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: TicketSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: TicketMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: TicketMaxAggregateInputType + } + + export type GetTicketAggregateType = { + [P in keyof T & keyof AggregateTicket]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type TicketGroupByArgs = { + where?: TicketWhereInput + orderBy?: TicketOrderByWithAggregationInput | TicketOrderByWithAggregationInput[] + by: TicketScalarFieldEnum[] | TicketScalarFieldEnum + having?: TicketScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: TicketCountAggregateInputType | true + _avg?: TicketAvgAggregateInputType + _sum?: TicketSumAggregateInputType + _min?: TicketMinAggregateInputType + _max?: TicketMaxAggregateInputType + } + + export type TicketGroupByOutputType = { + id: string + ticketNumber: number + userId: string + channelId: string + guildId: string + topic: string | null + priority: string + status: string + claimedBy: string | null + transcript: string | null + createdAt: Date + updatedAt: Date + _count: TicketCountAggregateOutputType | null + _avg: TicketAvgAggregateOutputType | null + _sum: TicketSumAggregateOutputType | null + _min: TicketMinAggregateOutputType | null + _max: TicketMaxAggregateOutputType | null + } + + type GetTicketGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof TicketGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type TicketSelect = $Extensions.GetSelect<{ + id?: boolean + ticketNumber?: boolean + userId?: boolean + channelId?: boolean + guildId?: boolean + topic?: boolean + priority?: boolean + status?: boolean + claimedBy?: boolean + transcript?: boolean + createdAt?: boolean + updatedAt?: boolean + }, ExtArgs["result"]["ticket"]> + + export type TicketSelectCreateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + ticketNumber?: boolean + userId?: boolean + channelId?: boolean + guildId?: boolean + topic?: boolean + priority?: boolean + status?: boolean + claimedBy?: boolean + transcript?: boolean + createdAt?: boolean + updatedAt?: boolean + }, ExtArgs["result"]["ticket"]> + + export type TicketSelectScalar = { + id?: boolean + ticketNumber?: boolean + userId?: boolean + channelId?: boolean + guildId?: boolean + topic?: boolean + priority?: boolean + status?: boolean + claimedBy?: boolean + transcript?: boolean + createdAt?: boolean + updatedAt?: boolean + } + + + export type $TicketPayload = { + name: "Ticket" + objects: {} + scalars: $Extensions.GetPayloadResult<{ + id: string + ticketNumber: number + userId: string + channelId: string + guildId: string + topic: string | null + priority: string + status: string + claimedBy: string | null + transcript: string | null + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["ticket"]> + composites: {} + } + + type TicketGetPayload = $Result.GetResult + + type TicketCountArgs = + Omit & { + select?: TicketCountAggregateInputType | true + } + + export interface TicketDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Ticket'], meta: { name: 'Ticket' } } + /** + * Find zero or one Ticket that matches the filter. + * @param {TicketFindUniqueArgs} args - Arguments to find a Ticket + * @example + * // Get one Ticket + * const ticket = await prisma.ticket.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__TicketClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one Ticket that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {TicketFindUniqueOrThrowArgs} args - Arguments to find a Ticket + * @example + * // Get one Ticket + * const ticket = await prisma.ticket.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__TicketClient<$Result.GetResult, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first Ticket that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TicketFindFirstArgs} args - Arguments to find a Ticket + * @example + * // Get one Ticket + * const ticket = await prisma.ticket.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__TicketClient<$Result.GetResult, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first Ticket that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TicketFindFirstOrThrowArgs} args - Arguments to find a Ticket + * @example + * // Get one Ticket + * const ticket = await prisma.ticket.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__TicketClient<$Result.GetResult, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more Tickets that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TicketFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Tickets + * const tickets = await prisma.ticket.findMany() + * + * // Get first 10 Tickets + * const tickets = await prisma.ticket.findMany({ take: 10 }) + * + * // Only select the `id` + * const ticketWithIdOnly = await prisma.ticket.findMany({ select: { id: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany">> + + /** + * Create a Ticket. + * @param {TicketCreateArgs} args - Arguments to create a Ticket. + * @example + * // Create one Ticket + * const Ticket = await prisma.ticket.create({ + * data: { + * // ... data to create a Ticket + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__TicketClient<$Result.GetResult, T, "create">, never, ExtArgs> + + /** + * Create many Tickets. + * @param {TicketCreateManyArgs} args - Arguments to create many Tickets. + * @example + * // Create many Tickets + * const ticket = await prisma.ticket.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Tickets and returns the data saved in the database. + * @param {TicketCreateManyAndReturnArgs} args - Arguments to create many Tickets. + * @example + * // Create many Tickets + * const ticket = await prisma.ticket.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Tickets and only return the `id` + * const ticketWithIdOnly = await prisma.ticket.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn">> + + /** + * Delete a Ticket. + * @param {TicketDeleteArgs} args - Arguments to delete one Ticket. + * @example + * // Delete one Ticket + * const Ticket = await prisma.ticket.delete({ + * where: { + * // ... filter to delete one Ticket + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__TicketClient<$Result.GetResult, T, "delete">, never, ExtArgs> + + /** + * Update one Ticket. + * @param {TicketUpdateArgs} args - Arguments to update one Ticket. + * @example + * // Update one Ticket + * const ticket = await prisma.ticket.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__TicketClient<$Result.GetResult, T, "update">, never, ExtArgs> + + /** + * Delete zero or more Tickets. + * @param {TicketDeleteManyArgs} args - Arguments to filter Tickets to delete. + * @example + * // Delete a few Tickets + * const { count } = await prisma.ticket.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Tickets. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TicketUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Tickets + * const ticket = await prisma.ticket.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one Ticket. + * @param {TicketUpsertArgs} args - Arguments to update or create a Ticket. + * @example + * // Update or create a Ticket + * const ticket = await prisma.ticket.upsert({ + * create: { + * // ... data to create a Ticket + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Ticket we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__TicketClient<$Result.GetResult, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of Tickets. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TicketCountArgs} args - Arguments to filter Tickets to count. + * @example + * // Count the number of Tickets + * const count = await prisma.ticket.count({ + * where: { + * // ... the filter for the Tickets we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Ticket. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TicketAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by Ticket. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TicketGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends TicketGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: TicketGroupByArgs['orderBy'] } + : { orderBy?: TicketGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends MaybeTupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetTicketGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the Ticket model + */ + readonly fields: TicketFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for Ticket. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export interface Prisma__TicketClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise + } + + + + + /** + * Fields of the Ticket model + */ + interface TicketFieldRefs { + readonly id: FieldRef<"Ticket", 'String'> + readonly ticketNumber: FieldRef<"Ticket", 'Int'> + readonly userId: FieldRef<"Ticket", 'String'> + readonly channelId: FieldRef<"Ticket", 'String'> + readonly guildId: FieldRef<"Ticket", 'String'> + readonly topic: FieldRef<"Ticket", 'String'> + readonly priority: FieldRef<"Ticket", 'String'> + readonly status: FieldRef<"Ticket", 'String'> + readonly claimedBy: FieldRef<"Ticket", 'String'> + readonly transcript: FieldRef<"Ticket", 'String'> + readonly createdAt: FieldRef<"Ticket", 'DateTime'> + readonly updatedAt: FieldRef<"Ticket", 'DateTime'> + } + + + // Custom InputTypes + /** + * Ticket findUnique + */ + export type TicketFindUniqueArgs = { + /** + * Select specific fields to fetch from the Ticket + */ + select?: TicketSelect | null + /** + * Filter, which Ticket to fetch. + */ + where: TicketWhereUniqueInput + } + + /** + * Ticket findUniqueOrThrow + */ + export type TicketFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Ticket + */ + select?: TicketSelect | null + /** + * Filter, which Ticket to fetch. + */ + where: TicketWhereUniqueInput + } + + /** + * Ticket findFirst + */ + export type TicketFindFirstArgs = { + /** + * Select specific fields to fetch from the Ticket + */ + select?: TicketSelect | null + /** + * Filter, which Ticket to fetch. + */ + where?: TicketWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Tickets to fetch. + */ + orderBy?: TicketOrderByWithRelationInput | TicketOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Tickets. + */ + cursor?: TicketWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Tickets from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Tickets. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Tickets. + */ + distinct?: TicketScalarFieldEnum | TicketScalarFieldEnum[] + } + + /** + * Ticket findFirstOrThrow + */ + export type TicketFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Ticket + */ + select?: TicketSelect | null + /** + * Filter, which Ticket to fetch. + */ + where?: TicketWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Tickets to fetch. + */ + orderBy?: TicketOrderByWithRelationInput | TicketOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Tickets. + */ + cursor?: TicketWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Tickets from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Tickets. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Tickets. + */ + distinct?: TicketScalarFieldEnum | TicketScalarFieldEnum[] + } + + /** + * Ticket findMany + */ + export type TicketFindManyArgs = { + /** + * Select specific fields to fetch from the Ticket + */ + select?: TicketSelect | null + /** + * Filter, which Tickets to fetch. + */ + where?: TicketWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Tickets to fetch. + */ + orderBy?: TicketOrderByWithRelationInput | TicketOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Tickets. + */ + cursor?: TicketWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Tickets from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Tickets. + */ + skip?: number + distinct?: TicketScalarFieldEnum | TicketScalarFieldEnum[] + } + + /** + * Ticket create + */ + export type TicketCreateArgs = { + /** + * Select specific fields to fetch from the Ticket + */ + select?: TicketSelect | null + /** + * The data needed to create a Ticket. + */ + data: XOR + } + + /** + * Ticket createMany + */ + export type TicketCreateManyArgs = { + /** + * The data used to create many Tickets. + */ + data: TicketCreateManyInput | TicketCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Ticket createManyAndReturn + */ + export type TicketCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Ticket + */ + select?: TicketSelectCreateManyAndReturn | null + /** + * The data used to create many Tickets. + */ + data: TicketCreateManyInput | TicketCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Ticket update + */ + export type TicketUpdateArgs = { + /** + * Select specific fields to fetch from the Ticket + */ + select?: TicketSelect | null + /** + * The data needed to update a Ticket. + */ + data: XOR + /** + * Choose, which Ticket to update. + */ + where: TicketWhereUniqueInput + } + + /** + * Ticket updateMany + */ + export type TicketUpdateManyArgs = { + /** + * The data used to update Tickets. + */ + data: XOR + /** + * Filter which Tickets to update + */ + where?: TicketWhereInput + } + + /** + * Ticket upsert + */ + export type TicketUpsertArgs = { + /** + * Select specific fields to fetch from the Ticket + */ + select?: TicketSelect | null + /** + * The filter to search for the Ticket to update in case it exists. + */ + where: TicketWhereUniqueInput + /** + * In case the Ticket found by the `where` argument doesn't exist, create a new Ticket with this data. + */ + create: XOR + /** + * In case the Ticket was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * Ticket delete + */ + export type TicketDeleteArgs = { + /** + * Select specific fields to fetch from the Ticket + */ + select?: TicketSelect | null + /** + * Filter which Ticket to delete. + */ + where: TicketWhereUniqueInput + } + + /** + * Ticket deleteMany + */ + export type TicketDeleteManyArgs = { + /** + * Filter which Tickets to delete + */ + where?: TicketWhereInput + } + + /** + * Ticket without action + */ + export type TicketDefaultArgs = { + /** + * Select specific fields to fetch from the Ticket + */ + select?: TicketSelect | null + } + + + /** + * Model Level + */ + + export type AggregateLevel = { + _count: LevelCountAggregateOutputType | null + _avg: LevelAvgAggregateOutputType | null + _sum: LevelSumAggregateOutputType | null + _min: LevelMinAggregateOutputType | null + _max: LevelMaxAggregateOutputType | null + } + + export type LevelAvgAggregateOutputType = { + xp: number | null + level: number | null + } + + export type LevelSumAggregateOutputType = { + xp: number | null + level: number | null + } + + export type LevelMinAggregateOutputType = { + id: string | null + userId: string | null + guildId: string | null + xp: number | null + level: number | null + createdAt: Date | null + updatedAt: Date | null + } + + export type LevelMaxAggregateOutputType = { + id: string | null + userId: string | null + guildId: string | null + xp: number | null + level: number | null + createdAt: Date | null + updatedAt: Date | null + } + + export type LevelCountAggregateOutputType = { + id: number + userId: number + guildId: number + xp: number + level: number + createdAt: number + updatedAt: number + _all: number + } + + + export type LevelAvgAggregateInputType = { + xp?: true + level?: true + } + + export type LevelSumAggregateInputType = { + xp?: true + level?: true + } + + export type LevelMinAggregateInputType = { + id?: true + userId?: true + guildId?: true + xp?: true + level?: true + createdAt?: true + updatedAt?: true + } + + export type LevelMaxAggregateInputType = { + id?: true + userId?: true + guildId?: true + xp?: true + level?: true + createdAt?: true + updatedAt?: true + } + + export type LevelCountAggregateInputType = { + id?: true + userId?: true + guildId?: true + xp?: true + level?: true + createdAt?: true + updatedAt?: true + _all?: true + } + + export type LevelAggregateArgs = { + /** + * Filter which Level to aggregate. + */ + where?: LevelWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Levels to fetch. + */ + orderBy?: LevelOrderByWithRelationInput | LevelOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: LevelWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Levels from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Levels. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Levels + **/ + _count?: true | LevelCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: LevelAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: LevelSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: LevelMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: LevelMaxAggregateInputType + } + + export type GetLevelAggregateType = { + [P in keyof T & keyof AggregateLevel]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type LevelGroupByArgs = { + where?: LevelWhereInput + orderBy?: LevelOrderByWithAggregationInput | LevelOrderByWithAggregationInput[] + by: LevelScalarFieldEnum[] | LevelScalarFieldEnum + having?: LevelScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: LevelCountAggregateInputType | true + _avg?: LevelAvgAggregateInputType + _sum?: LevelSumAggregateInputType + _min?: LevelMinAggregateInputType + _max?: LevelMaxAggregateInputType + } + + export type LevelGroupByOutputType = { + id: string + userId: string + guildId: string + xp: number + level: number + createdAt: Date + updatedAt: Date + _count: LevelCountAggregateOutputType | null + _avg: LevelAvgAggregateOutputType | null + _sum: LevelSumAggregateOutputType | null + _min: LevelMinAggregateOutputType | null + _max: LevelMaxAggregateOutputType | null + } + + type GetLevelGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof LevelGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type LevelSelect = $Extensions.GetSelect<{ + id?: boolean + userId?: boolean + guildId?: boolean + xp?: boolean + level?: boolean + createdAt?: boolean + updatedAt?: boolean + }, ExtArgs["result"]["level"]> + + export type LevelSelectCreateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + userId?: boolean + guildId?: boolean + xp?: boolean + level?: boolean + createdAt?: boolean + updatedAt?: boolean + }, ExtArgs["result"]["level"]> + + export type LevelSelectScalar = { + id?: boolean + userId?: boolean + guildId?: boolean + xp?: boolean + level?: boolean + createdAt?: boolean + updatedAt?: boolean + } + + + export type $LevelPayload = { + name: "Level" + objects: {} + scalars: $Extensions.GetPayloadResult<{ + id: string + userId: string + guildId: string + xp: number + level: number + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["level"]> + composites: {} + } + + type LevelGetPayload = $Result.GetResult + + type LevelCountArgs = + Omit & { + select?: LevelCountAggregateInputType | true + } + + export interface LevelDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Level'], meta: { name: 'Level' } } + /** + * Find zero or one Level that matches the filter. + * @param {LevelFindUniqueArgs} args - Arguments to find a Level + * @example + * // Get one Level + * const level = await prisma.level.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__LevelClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one Level that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {LevelFindUniqueOrThrowArgs} args - Arguments to find a Level + * @example + * // Get one Level + * const level = await prisma.level.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__LevelClient<$Result.GetResult, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first Level that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LevelFindFirstArgs} args - Arguments to find a Level + * @example + * // Get one Level + * const level = await prisma.level.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__LevelClient<$Result.GetResult, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first Level that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LevelFindFirstOrThrowArgs} args - Arguments to find a Level + * @example + * // Get one Level + * const level = await prisma.level.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__LevelClient<$Result.GetResult, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more Levels that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LevelFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Levels + * const levels = await prisma.level.findMany() + * + * // Get first 10 Levels + * const levels = await prisma.level.findMany({ take: 10 }) + * + * // Only select the `id` + * const levelWithIdOnly = await prisma.level.findMany({ select: { id: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany">> + + /** + * Create a Level. + * @param {LevelCreateArgs} args - Arguments to create a Level. + * @example + * // Create one Level + * const Level = await prisma.level.create({ + * data: { + * // ... data to create a Level + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__LevelClient<$Result.GetResult, T, "create">, never, ExtArgs> + + /** + * Create many Levels. + * @param {LevelCreateManyArgs} args - Arguments to create many Levels. + * @example + * // Create many Levels + * const level = await prisma.level.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Levels and returns the data saved in the database. + * @param {LevelCreateManyAndReturnArgs} args - Arguments to create many Levels. + * @example + * // Create many Levels + * const level = await prisma.level.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Levels and only return the `id` + * const levelWithIdOnly = await prisma.level.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn">> + + /** + * Delete a Level. + * @param {LevelDeleteArgs} args - Arguments to delete one Level. + * @example + * // Delete one Level + * const Level = await prisma.level.delete({ + * where: { + * // ... filter to delete one Level + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__LevelClient<$Result.GetResult, T, "delete">, never, ExtArgs> + + /** + * Update one Level. + * @param {LevelUpdateArgs} args - Arguments to update one Level. + * @example + * // Update one Level + * const level = await prisma.level.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__LevelClient<$Result.GetResult, T, "update">, never, ExtArgs> + + /** + * Delete zero or more Levels. + * @param {LevelDeleteManyArgs} args - Arguments to filter Levels to delete. + * @example + * // Delete a few Levels + * const { count } = await prisma.level.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Levels. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LevelUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Levels + * const level = await prisma.level.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one Level. + * @param {LevelUpsertArgs} args - Arguments to update or create a Level. + * @example + * // Update or create a Level + * const level = await prisma.level.upsert({ + * create: { + * // ... data to create a Level + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Level we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__LevelClient<$Result.GetResult, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of Levels. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LevelCountArgs} args - Arguments to filter Levels to count. + * @example + * // Count the number of Levels + * const count = await prisma.level.count({ + * where: { + * // ... the filter for the Levels we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Level. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LevelAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by Level. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LevelGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends LevelGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: LevelGroupByArgs['orderBy'] } + : { orderBy?: LevelGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends MaybeTupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetLevelGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the Level model + */ + readonly fields: LevelFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for Level. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export interface Prisma__LevelClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise + } + + + + + /** + * Fields of the Level model + */ + interface LevelFieldRefs { + readonly id: FieldRef<"Level", 'String'> + readonly userId: FieldRef<"Level", 'String'> + readonly guildId: FieldRef<"Level", 'String'> + readonly xp: FieldRef<"Level", 'Int'> + readonly level: FieldRef<"Level", 'Int'> + readonly createdAt: FieldRef<"Level", 'DateTime'> + readonly updatedAt: FieldRef<"Level", 'DateTime'> + } + + + // Custom InputTypes + /** + * Level findUnique + */ + export type LevelFindUniqueArgs = { + /** + * Select specific fields to fetch from the Level + */ + select?: LevelSelect | null + /** + * Filter, which Level to fetch. + */ + where: LevelWhereUniqueInput + } + + /** + * Level findUniqueOrThrow + */ + export type LevelFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Level + */ + select?: LevelSelect | null + /** + * Filter, which Level to fetch. + */ + where: LevelWhereUniqueInput + } + + /** + * Level findFirst + */ + export type LevelFindFirstArgs = { + /** + * Select specific fields to fetch from the Level + */ + select?: LevelSelect | null + /** + * Filter, which Level to fetch. + */ + where?: LevelWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Levels to fetch. + */ + orderBy?: LevelOrderByWithRelationInput | LevelOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Levels. + */ + cursor?: LevelWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Levels from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Levels. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Levels. + */ + distinct?: LevelScalarFieldEnum | LevelScalarFieldEnum[] + } + + /** + * Level findFirstOrThrow + */ + export type LevelFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Level + */ + select?: LevelSelect | null + /** + * Filter, which Level to fetch. + */ + where?: LevelWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Levels to fetch. + */ + orderBy?: LevelOrderByWithRelationInput | LevelOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Levels. + */ + cursor?: LevelWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Levels from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Levels. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Levels. + */ + distinct?: LevelScalarFieldEnum | LevelScalarFieldEnum[] + } + + /** + * Level findMany + */ + export type LevelFindManyArgs = { + /** + * Select specific fields to fetch from the Level + */ + select?: LevelSelect | null + /** + * Filter, which Levels to fetch. + */ + where?: LevelWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Levels to fetch. + */ + orderBy?: LevelOrderByWithRelationInput | LevelOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Levels. + */ + cursor?: LevelWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Levels from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Levels. + */ + skip?: number + distinct?: LevelScalarFieldEnum | LevelScalarFieldEnum[] + } + + /** + * Level create + */ + export type LevelCreateArgs = { + /** + * Select specific fields to fetch from the Level + */ + select?: LevelSelect | null + /** + * The data needed to create a Level. + */ + data: XOR + } + + /** + * Level createMany + */ + export type LevelCreateManyArgs = { + /** + * The data used to create many Levels. + */ + data: LevelCreateManyInput | LevelCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Level createManyAndReturn + */ + export type LevelCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Level + */ + select?: LevelSelectCreateManyAndReturn | null + /** + * The data used to create many Levels. + */ + data: LevelCreateManyInput | LevelCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Level update + */ + export type LevelUpdateArgs = { + /** + * Select specific fields to fetch from the Level + */ + select?: LevelSelect | null + /** + * The data needed to update a Level. + */ + data: XOR + /** + * Choose, which Level to update. + */ + where: LevelWhereUniqueInput + } + + /** + * Level updateMany + */ + export type LevelUpdateManyArgs = { + /** + * The data used to update Levels. + */ + data: XOR + /** + * Filter which Levels to update + */ + where?: LevelWhereInput + } + + /** + * Level upsert + */ + export type LevelUpsertArgs = { + /** + * Select specific fields to fetch from the Level + */ + select?: LevelSelect | null + /** + * The filter to search for the Level to update in case it exists. + */ + where: LevelWhereUniqueInput + /** + * In case the Level found by the `where` argument doesn't exist, create a new Level with this data. + */ + create: XOR + /** + * In case the Level was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * Level delete + */ + export type LevelDeleteArgs = { + /** + * Select specific fields to fetch from the Level + */ + select?: LevelSelect | null + /** + * Filter which Level to delete. + */ + where: LevelWhereUniqueInput + } + + /** + * Level deleteMany + */ + export type LevelDeleteManyArgs = { + /** + * Filter which Levels to delete + */ + where?: LevelWhereInput + } + + /** + * Level without action + */ + export type LevelDefaultArgs = { + /** + * Select specific fields to fetch from the Level + */ + select?: LevelSelect | null + } + + + /** + * Model TicketSupportSession + */ + + export type AggregateTicketSupportSession = { + _count: TicketSupportSessionCountAggregateOutputType | null + _avg: TicketSupportSessionAvgAggregateOutputType | null + _sum: TicketSupportSessionSumAggregateOutputType | null + _min: TicketSupportSessionMinAggregateOutputType | null + _max: TicketSupportSessionMaxAggregateOutputType | null + } + + export type TicketSupportSessionAvgAggregateOutputType = { + durationSeconds: number | null + } + + export type TicketSupportSessionSumAggregateOutputType = { + durationSeconds: number | null + } + + export type TicketSupportSessionMinAggregateOutputType = { + id: string | null + guildId: string | null + userId: string | null + roleId: string | null + startedAt: Date | null + endedAt: Date | null + durationSeconds: number | null + } + + export type TicketSupportSessionMaxAggregateOutputType = { + id: string | null + guildId: string | null + userId: string | null + roleId: string | null + startedAt: Date | null + endedAt: Date | null + durationSeconds: number | null + } + + export type TicketSupportSessionCountAggregateOutputType = { + id: number + guildId: number + userId: number + roleId: number + startedAt: number + endedAt: number + durationSeconds: number + _all: number + } + + + export type TicketSupportSessionAvgAggregateInputType = { + durationSeconds?: true + } + + export type TicketSupportSessionSumAggregateInputType = { + durationSeconds?: true + } + + export type TicketSupportSessionMinAggregateInputType = { + id?: true + guildId?: true + userId?: true + roleId?: true + startedAt?: true + endedAt?: true + durationSeconds?: true + } + + export type TicketSupportSessionMaxAggregateInputType = { + id?: true + guildId?: true + userId?: true + roleId?: true + startedAt?: true + endedAt?: true + durationSeconds?: true + } + + export type TicketSupportSessionCountAggregateInputType = { + id?: true + guildId?: true + userId?: true + roleId?: true + startedAt?: true + endedAt?: true + durationSeconds?: true + _all?: true + } + + export type TicketSupportSessionAggregateArgs = { + /** + * Filter which TicketSupportSession to aggregate. + */ + where?: TicketSupportSessionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of TicketSupportSessions to fetch. + */ + orderBy?: TicketSupportSessionOrderByWithRelationInput | TicketSupportSessionOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: TicketSupportSessionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` TicketSupportSessions from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` TicketSupportSessions. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned TicketSupportSessions + **/ + _count?: true | TicketSupportSessionCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: TicketSupportSessionAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: TicketSupportSessionSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: TicketSupportSessionMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: TicketSupportSessionMaxAggregateInputType + } + + export type GetTicketSupportSessionAggregateType = { + [P in keyof T & keyof AggregateTicketSupportSession]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type TicketSupportSessionGroupByArgs = { + where?: TicketSupportSessionWhereInput + orderBy?: TicketSupportSessionOrderByWithAggregationInput | TicketSupportSessionOrderByWithAggregationInput[] + by: TicketSupportSessionScalarFieldEnum[] | TicketSupportSessionScalarFieldEnum + having?: TicketSupportSessionScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: TicketSupportSessionCountAggregateInputType | true + _avg?: TicketSupportSessionAvgAggregateInputType + _sum?: TicketSupportSessionSumAggregateInputType + _min?: TicketSupportSessionMinAggregateInputType + _max?: TicketSupportSessionMaxAggregateInputType + } + + export type TicketSupportSessionGroupByOutputType = { + id: string + guildId: string + userId: string + roleId: string + startedAt: Date + endedAt: Date | null + durationSeconds: number | null + _count: TicketSupportSessionCountAggregateOutputType | null + _avg: TicketSupportSessionAvgAggregateOutputType | null + _sum: TicketSupportSessionSumAggregateOutputType | null + _min: TicketSupportSessionMinAggregateOutputType | null + _max: TicketSupportSessionMaxAggregateOutputType | null + } + + type GetTicketSupportSessionGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof TicketSupportSessionGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type TicketSupportSessionSelect = $Extensions.GetSelect<{ + id?: boolean + guildId?: boolean + userId?: boolean + roleId?: boolean + startedAt?: boolean + endedAt?: boolean + durationSeconds?: boolean + }, ExtArgs["result"]["ticketSupportSession"]> + + export type TicketSupportSessionSelectCreateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + guildId?: boolean + userId?: boolean + roleId?: boolean + startedAt?: boolean + endedAt?: boolean + durationSeconds?: boolean + }, ExtArgs["result"]["ticketSupportSession"]> + + export type TicketSupportSessionSelectScalar = { + id?: boolean + guildId?: boolean + userId?: boolean + roleId?: boolean + startedAt?: boolean + endedAt?: boolean + durationSeconds?: boolean + } + + + export type $TicketSupportSessionPayload = { + name: "TicketSupportSession" + objects: {} + scalars: $Extensions.GetPayloadResult<{ + id: string + guildId: string + userId: string + roleId: string + startedAt: Date + endedAt: Date | null + durationSeconds: number | null + }, ExtArgs["result"]["ticketSupportSession"]> + composites: {} + } + + type TicketSupportSessionGetPayload = $Result.GetResult + + type TicketSupportSessionCountArgs = + Omit & { + select?: TicketSupportSessionCountAggregateInputType | true + } + + export interface TicketSupportSessionDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['TicketSupportSession'], meta: { name: 'TicketSupportSession' } } + /** + * Find zero or one TicketSupportSession that matches the filter. + * @param {TicketSupportSessionFindUniqueArgs} args - Arguments to find a TicketSupportSession + * @example + * // Get one TicketSupportSession + * const ticketSupportSession = await prisma.ticketSupportSession.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__TicketSupportSessionClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one TicketSupportSession that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {TicketSupportSessionFindUniqueOrThrowArgs} args - Arguments to find a TicketSupportSession + * @example + * // Get one TicketSupportSession + * const ticketSupportSession = await prisma.ticketSupportSession.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__TicketSupportSessionClient<$Result.GetResult, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first TicketSupportSession that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TicketSupportSessionFindFirstArgs} args - Arguments to find a TicketSupportSession + * @example + * // Get one TicketSupportSession + * const ticketSupportSession = await prisma.ticketSupportSession.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__TicketSupportSessionClient<$Result.GetResult, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first TicketSupportSession that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TicketSupportSessionFindFirstOrThrowArgs} args - Arguments to find a TicketSupportSession + * @example + * // Get one TicketSupportSession + * const ticketSupportSession = await prisma.ticketSupportSession.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__TicketSupportSessionClient<$Result.GetResult, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more TicketSupportSessions that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TicketSupportSessionFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all TicketSupportSessions + * const ticketSupportSessions = await prisma.ticketSupportSession.findMany() + * + * // Get first 10 TicketSupportSessions + * const ticketSupportSessions = await prisma.ticketSupportSession.findMany({ take: 10 }) + * + * // Only select the `id` + * const ticketSupportSessionWithIdOnly = await prisma.ticketSupportSession.findMany({ select: { id: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany">> + + /** + * Create a TicketSupportSession. + * @param {TicketSupportSessionCreateArgs} args - Arguments to create a TicketSupportSession. + * @example + * // Create one TicketSupportSession + * const TicketSupportSession = await prisma.ticketSupportSession.create({ + * data: { + * // ... data to create a TicketSupportSession + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__TicketSupportSessionClient<$Result.GetResult, T, "create">, never, ExtArgs> + + /** + * Create many TicketSupportSessions. + * @param {TicketSupportSessionCreateManyArgs} args - Arguments to create many TicketSupportSessions. + * @example + * // Create many TicketSupportSessions + * const ticketSupportSession = await prisma.ticketSupportSession.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many TicketSupportSessions and returns the data saved in the database. + * @param {TicketSupportSessionCreateManyAndReturnArgs} args - Arguments to create many TicketSupportSessions. + * @example + * // Create many TicketSupportSessions + * const ticketSupportSession = await prisma.ticketSupportSession.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many TicketSupportSessions and only return the `id` + * const ticketSupportSessionWithIdOnly = await prisma.ticketSupportSession.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn">> + + /** + * Delete a TicketSupportSession. + * @param {TicketSupportSessionDeleteArgs} args - Arguments to delete one TicketSupportSession. + * @example + * // Delete one TicketSupportSession + * const TicketSupportSession = await prisma.ticketSupportSession.delete({ + * where: { + * // ... filter to delete one TicketSupportSession + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__TicketSupportSessionClient<$Result.GetResult, T, "delete">, never, ExtArgs> + + /** + * Update one TicketSupportSession. + * @param {TicketSupportSessionUpdateArgs} args - Arguments to update one TicketSupportSession. + * @example + * // Update one TicketSupportSession + * const ticketSupportSession = await prisma.ticketSupportSession.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__TicketSupportSessionClient<$Result.GetResult, T, "update">, never, ExtArgs> + + /** + * Delete zero or more TicketSupportSessions. + * @param {TicketSupportSessionDeleteManyArgs} args - Arguments to filter TicketSupportSessions to delete. + * @example + * // Delete a few TicketSupportSessions + * const { count } = await prisma.ticketSupportSession.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more TicketSupportSessions. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TicketSupportSessionUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many TicketSupportSessions + * const ticketSupportSession = await prisma.ticketSupportSession.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one TicketSupportSession. + * @param {TicketSupportSessionUpsertArgs} args - Arguments to update or create a TicketSupportSession. + * @example + * // Update or create a TicketSupportSession + * const ticketSupportSession = await prisma.ticketSupportSession.upsert({ + * create: { + * // ... data to create a TicketSupportSession + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the TicketSupportSession we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__TicketSupportSessionClient<$Result.GetResult, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of TicketSupportSessions. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TicketSupportSessionCountArgs} args - Arguments to filter TicketSupportSessions to count. + * @example + * // Count the number of TicketSupportSessions + * const count = await prisma.ticketSupportSession.count({ + * where: { + * // ... the filter for the TicketSupportSessions we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a TicketSupportSession. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TicketSupportSessionAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by TicketSupportSession. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TicketSupportSessionGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends TicketSupportSessionGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: TicketSupportSessionGroupByArgs['orderBy'] } + : { orderBy?: TicketSupportSessionGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends MaybeTupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetTicketSupportSessionGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the TicketSupportSession model + */ + readonly fields: TicketSupportSessionFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for TicketSupportSession. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export interface Prisma__TicketSupportSessionClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise + } + + + + + /** + * Fields of the TicketSupportSession model + */ + interface TicketSupportSessionFieldRefs { + readonly id: FieldRef<"TicketSupportSession", 'String'> + readonly guildId: FieldRef<"TicketSupportSession", 'String'> + readonly userId: FieldRef<"TicketSupportSession", 'String'> + readonly roleId: FieldRef<"TicketSupportSession", 'String'> + readonly startedAt: FieldRef<"TicketSupportSession", 'DateTime'> + readonly endedAt: FieldRef<"TicketSupportSession", 'DateTime'> + readonly durationSeconds: FieldRef<"TicketSupportSession", 'Int'> + } + + + // Custom InputTypes + /** + * TicketSupportSession findUnique + */ + export type TicketSupportSessionFindUniqueArgs = { + /** + * Select specific fields to fetch from the TicketSupportSession + */ + select?: TicketSupportSessionSelect | null + /** + * Filter, which TicketSupportSession to fetch. + */ + where: TicketSupportSessionWhereUniqueInput + } + + /** + * TicketSupportSession findUniqueOrThrow + */ + export type TicketSupportSessionFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the TicketSupportSession + */ + select?: TicketSupportSessionSelect | null + /** + * Filter, which TicketSupportSession to fetch. + */ + where: TicketSupportSessionWhereUniqueInput + } + + /** + * TicketSupportSession findFirst + */ + export type TicketSupportSessionFindFirstArgs = { + /** + * Select specific fields to fetch from the TicketSupportSession + */ + select?: TicketSupportSessionSelect | null + /** + * Filter, which TicketSupportSession to fetch. + */ + where?: TicketSupportSessionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of TicketSupportSessions to fetch. + */ + orderBy?: TicketSupportSessionOrderByWithRelationInput | TicketSupportSessionOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for TicketSupportSessions. + */ + cursor?: TicketSupportSessionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` TicketSupportSessions from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` TicketSupportSessions. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of TicketSupportSessions. + */ + distinct?: TicketSupportSessionScalarFieldEnum | TicketSupportSessionScalarFieldEnum[] + } + + /** + * TicketSupportSession findFirstOrThrow + */ + export type TicketSupportSessionFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the TicketSupportSession + */ + select?: TicketSupportSessionSelect | null + /** + * Filter, which TicketSupportSession to fetch. + */ + where?: TicketSupportSessionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of TicketSupportSessions to fetch. + */ + orderBy?: TicketSupportSessionOrderByWithRelationInput | TicketSupportSessionOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for TicketSupportSessions. + */ + cursor?: TicketSupportSessionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` TicketSupportSessions from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` TicketSupportSessions. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of TicketSupportSessions. + */ + distinct?: TicketSupportSessionScalarFieldEnum | TicketSupportSessionScalarFieldEnum[] + } + + /** + * TicketSupportSession findMany + */ + export type TicketSupportSessionFindManyArgs = { + /** + * Select specific fields to fetch from the TicketSupportSession + */ + select?: TicketSupportSessionSelect | null + /** + * Filter, which TicketSupportSessions to fetch. + */ + where?: TicketSupportSessionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of TicketSupportSessions to fetch. + */ + orderBy?: TicketSupportSessionOrderByWithRelationInput | TicketSupportSessionOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing TicketSupportSessions. + */ + cursor?: TicketSupportSessionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` TicketSupportSessions from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` TicketSupportSessions. + */ + skip?: number + distinct?: TicketSupportSessionScalarFieldEnum | TicketSupportSessionScalarFieldEnum[] + } + + /** + * TicketSupportSession create + */ + export type TicketSupportSessionCreateArgs = { + /** + * Select specific fields to fetch from the TicketSupportSession + */ + select?: TicketSupportSessionSelect | null + /** + * The data needed to create a TicketSupportSession. + */ + data: XOR + } + + /** + * TicketSupportSession createMany + */ + export type TicketSupportSessionCreateManyArgs = { + /** + * The data used to create many TicketSupportSessions. + */ + data: TicketSupportSessionCreateManyInput | TicketSupportSessionCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * TicketSupportSession createManyAndReturn + */ + export type TicketSupportSessionCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the TicketSupportSession + */ + select?: TicketSupportSessionSelectCreateManyAndReturn | null + /** + * The data used to create many TicketSupportSessions. + */ + data: TicketSupportSessionCreateManyInput | TicketSupportSessionCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * TicketSupportSession update + */ + export type TicketSupportSessionUpdateArgs = { + /** + * Select specific fields to fetch from the TicketSupportSession + */ + select?: TicketSupportSessionSelect | null + /** + * The data needed to update a TicketSupportSession. + */ + data: XOR + /** + * Choose, which TicketSupportSession to update. + */ + where: TicketSupportSessionWhereUniqueInput + } + + /** + * TicketSupportSession updateMany + */ + export type TicketSupportSessionUpdateManyArgs = { + /** + * The data used to update TicketSupportSessions. + */ + data: XOR + /** + * Filter which TicketSupportSessions to update + */ + where?: TicketSupportSessionWhereInput + } + + /** + * TicketSupportSession upsert + */ + export type TicketSupportSessionUpsertArgs = { + /** + * Select specific fields to fetch from the TicketSupportSession + */ + select?: TicketSupportSessionSelect | null + /** + * The filter to search for the TicketSupportSession to update in case it exists. + */ + where: TicketSupportSessionWhereUniqueInput + /** + * In case the TicketSupportSession found by the `where` argument doesn't exist, create a new TicketSupportSession with this data. + */ + create: XOR + /** + * In case the TicketSupportSession was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * TicketSupportSession delete + */ + export type TicketSupportSessionDeleteArgs = { + /** + * Select specific fields to fetch from the TicketSupportSession + */ + select?: TicketSupportSessionSelect | null + /** + * Filter which TicketSupportSession to delete. + */ + where: TicketSupportSessionWhereUniqueInput + } + + /** + * TicketSupportSession deleteMany + */ + export type TicketSupportSessionDeleteManyArgs = { + /** + * Filter which TicketSupportSessions to delete + */ + where?: TicketSupportSessionWhereInput + } + + /** + * TicketSupportSession without action + */ + export type TicketSupportSessionDefaultArgs = { + /** + * Select specific fields to fetch from the TicketSupportSession + */ + select?: TicketSupportSessionSelect | null + } + + + /** + * Model Birthday + */ + + export type AggregateBirthday = { + _count: BirthdayCountAggregateOutputType | null + _min: BirthdayMinAggregateOutputType | null + _max: BirthdayMaxAggregateOutputType | null + } + + export type BirthdayMinAggregateOutputType = { + id: string | null + userId: string | null + guildId: string | null + birthDate: string | null + createdAt: Date | null + updatedAt: Date | null + } + + export type BirthdayMaxAggregateOutputType = { + id: string | null + userId: string | null + guildId: string | null + birthDate: string | null + createdAt: Date | null + updatedAt: Date | null + } + + export type BirthdayCountAggregateOutputType = { + id: number + userId: number + guildId: number + birthDate: number + createdAt: number + updatedAt: number + _all: number + } + + + export type BirthdayMinAggregateInputType = { + id?: true + userId?: true + guildId?: true + birthDate?: true + createdAt?: true + updatedAt?: true + } + + export type BirthdayMaxAggregateInputType = { + id?: true + userId?: true + guildId?: true + birthDate?: true + createdAt?: true + updatedAt?: true + } + + export type BirthdayCountAggregateInputType = { + id?: true + userId?: true + guildId?: true + birthDate?: true + createdAt?: true + updatedAt?: true + _all?: true + } + + export type BirthdayAggregateArgs = { + /** + * Filter which Birthday to aggregate. + */ + where?: BirthdayWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Birthdays to fetch. + */ + orderBy?: BirthdayOrderByWithRelationInput | BirthdayOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: BirthdayWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Birthdays from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Birthdays. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Birthdays + **/ + _count?: true | BirthdayCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: BirthdayMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: BirthdayMaxAggregateInputType + } + + export type GetBirthdayAggregateType = { + [P in keyof T & keyof AggregateBirthday]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type BirthdayGroupByArgs = { + where?: BirthdayWhereInput + orderBy?: BirthdayOrderByWithAggregationInput | BirthdayOrderByWithAggregationInput[] + by: BirthdayScalarFieldEnum[] | BirthdayScalarFieldEnum + having?: BirthdayScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: BirthdayCountAggregateInputType | true + _min?: BirthdayMinAggregateInputType + _max?: BirthdayMaxAggregateInputType + } + + export type BirthdayGroupByOutputType = { + id: string + userId: string + guildId: string + birthDate: string + createdAt: Date + updatedAt: Date + _count: BirthdayCountAggregateOutputType | null + _min: BirthdayMinAggregateOutputType | null + _max: BirthdayMaxAggregateOutputType | null + } + + type GetBirthdayGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof BirthdayGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type BirthdaySelect = $Extensions.GetSelect<{ + id?: boolean + userId?: boolean + guildId?: boolean + birthDate?: boolean + createdAt?: boolean + updatedAt?: boolean + }, ExtArgs["result"]["birthday"]> + + export type BirthdaySelectCreateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + userId?: boolean + guildId?: boolean + birthDate?: boolean + createdAt?: boolean + updatedAt?: boolean + }, ExtArgs["result"]["birthday"]> + + export type BirthdaySelectScalar = { + id?: boolean + userId?: boolean + guildId?: boolean + birthDate?: boolean + createdAt?: boolean + updatedAt?: boolean + } + + + export type $BirthdayPayload = { + name: "Birthday" + objects: {} + scalars: $Extensions.GetPayloadResult<{ + id: string + userId: string + guildId: string + birthDate: string + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["birthday"]> + composites: {} + } + + type BirthdayGetPayload = $Result.GetResult + + type BirthdayCountArgs = + Omit & { + select?: BirthdayCountAggregateInputType | true + } + + export interface BirthdayDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Birthday'], meta: { name: 'Birthday' } } + /** + * Find zero or one Birthday that matches the filter. + * @param {BirthdayFindUniqueArgs} args - Arguments to find a Birthday + * @example + * // Get one Birthday + * const birthday = await prisma.birthday.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__BirthdayClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one Birthday that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {BirthdayFindUniqueOrThrowArgs} args - Arguments to find a Birthday + * @example + * // Get one Birthday + * const birthday = await prisma.birthday.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__BirthdayClient<$Result.GetResult, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first Birthday that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BirthdayFindFirstArgs} args - Arguments to find a Birthday + * @example + * // Get one Birthday + * const birthday = await prisma.birthday.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__BirthdayClient<$Result.GetResult, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first Birthday that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BirthdayFindFirstOrThrowArgs} args - Arguments to find a Birthday + * @example + * // Get one Birthday + * const birthday = await prisma.birthday.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__BirthdayClient<$Result.GetResult, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more Birthdays that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BirthdayFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Birthdays + * const birthdays = await prisma.birthday.findMany() + * + * // Get first 10 Birthdays + * const birthdays = await prisma.birthday.findMany({ take: 10 }) + * + * // Only select the `id` + * const birthdayWithIdOnly = await prisma.birthday.findMany({ select: { id: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany">> + + /** + * Create a Birthday. + * @param {BirthdayCreateArgs} args - Arguments to create a Birthday. + * @example + * // Create one Birthday + * const Birthday = await prisma.birthday.create({ + * data: { + * // ... data to create a Birthday + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__BirthdayClient<$Result.GetResult, T, "create">, never, ExtArgs> + + /** + * Create many Birthdays. + * @param {BirthdayCreateManyArgs} args - Arguments to create many Birthdays. + * @example + * // Create many Birthdays + * const birthday = await prisma.birthday.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Birthdays and returns the data saved in the database. + * @param {BirthdayCreateManyAndReturnArgs} args - Arguments to create many Birthdays. + * @example + * // Create many Birthdays + * const birthday = await prisma.birthday.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Birthdays and only return the `id` + * const birthdayWithIdOnly = await prisma.birthday.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn">> + + /** + * Delete a Birthday. + * @param {BirthdayDeleteArgs} args - Arguments to delete one Birthday. + * @example + * // Delete one Birthday + * const Birthday = await prisma.birthday.delete({ + * where: { + * // ... filter to delete one Birthday + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__BirthdayClient<$Result.GetResult, T, "delete">, never, ExtArgs> + + /** + * Update one Birthday. + * @param {BirthdayUpdateArgs} args - Arguments to update one Birthday. + * @example + * // Update one Birthday + * const birthday = await prisma.birthday.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__BirthdayClient<$Result.GetResult, T, "update">, never, ExtArgs> + + /** + * Delete zero or more Birthdays. + * @param {BirthdayDeleteManyArgs} args - Arguments to filter Birthdays to delete. + * @example + * // Delete a few Birthdays + * const { count } = await prisma.birthday.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Birthdays. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BirthdayUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Birthdays + * const birthday = await prisma.birthday.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one Birthday. + * @param {BirthdayUpsertArgs} args - Arguments to update or create a Birthday. + * @example + * // Update or create a Birthday + * const birthday = await prisma.birthday.upsert({ + * create: { + * // ... data to create a Birthday + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Birthday we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__BirthdayClient<$Result.GetResult, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of Birthdays. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BirthdayCountArgs} args - Arguments to filter Birthdays to count. + * @example + * // Count the number of Birthdays + * const count = await prisma.birthday.count({ + * where: { + * // ... the filter for the Birthdays we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Birthday. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BirthdayAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by Birthday. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BirthdayGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends BirthdayGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: BirthdayGroupByArgs['orderBy'] } + : { orderBy?: BirthdayGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends MaybeTupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetBirthdayGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the Birthday model + */ + readonly fields: BirthdayFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for Birthday. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export interface Prisma__BirthdayClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise + } + + + + + /** + * Fields of the Birthday model + */ + interface BirthdayFieldRefs { + readonly id: FieldRef<"Birthday", 'String'> + readonly userId: FieldRef<"Birthday", 'String'> + readonly guildId: FieldRef<"Birthday", 'String'> + readonly birthDate: FieldRef<"Birthday", 'String'> + readonly createdAt: FieldRef<"Birthday", 'DateTime'> + readonly updatedAt: FieldRef<"Birthday", 'DateTime'> + } + + + // Custom InputTypes + /** + * Birthday findUnique + */ + export type BirthdayFindUniqueArgs = { + /** + * Select specific fields to fetch from the Birthday + */ + select?: BirthdaySelect | null + /** + * Filter, which Birthday to fetch. + */ + where: BirthdayWhereUniqueInput + } + + /** + * Birthday findUniqueOrThrow + */ + export type BirthdayFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Birthday + */ + select?: BirthdaySelect | null + /** + * Filter, which Birthday to fetch. + */ + where: BirthdayWhereUniqueInput + } + + /** + * Birthday findFirst + */ + export type BirthdayFindFirstArgs = { + /** + * Select specific fields to fetch from the Birthday + */ + select?: BirthdaySelect | null + /** + * Filter, which Birthday to fetch. + */ + where?: BirthdayWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Birthdays to fetch. + */ + orderBy?: BirthdayOrderByWithRelationInput | BirthdayOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Birthdays. + */ + cursor?: BirthdayWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Birthdays from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Birthdays. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Birthdays. + */ + distinct?: BirthdayScalarFieldEnum | BirthdayScalarFieldEnum[] + } + + /** + * Birthday findFirstOrThrow + */ + export type BirthdayFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Birthday + */ + select?: BirthdaySelect | null + /** + * Filter, which Birthday to fetch. + */ + where?: BirthdayWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Birthdays to fetch. + */ + orderBy?: BirthdayOrderByWithRelationInput | BirthdayOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Birthdays. + */ + cursor?: BirthdayWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Birthdays from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Birthdays. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Birthdays. + */ + distinct?: BirthdayScalarFieldEnum | BirthdayScalarFieldEnum[] + } + + /** + * Birthday findMany + */ + export type BirthdayFindManyArgs = { + /** + * Select specific fields to fetch from the Birthday + */ + select?: BirthdaySelect | null + /** + * Filter, which Birthdays to fetch. + */ + where?: BirthdayWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Birthdays to fetch. + */ + orderBy?: BirthdayOrderByWithRelationInput | BirthdayOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Birthdays. + */ + cursor?: BirthdayWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Birthdays from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Birthdays. + */ + skip?: number + distinct?: BirthdayScalarFieldEnum | BirthdayScalarFieldEnum[] + } + + /** + * Birthday create + */ + export type BirthdayCreateArgs = { + /** + * Select specific fields to fetch from the Birthday + */ + select?: BirthdaySelect | null + /** + * The data needed to create a Birthday. + */ + data: XOR + } + + /** + * Birthday createMany + */ + export type BirthdayCreateManyArgs = { + /** + * The data used to create many Birthdays. + */ + data: BirthdayCreateManyInput | BirthdayCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Birthday createManyAndReturn + */ + export type BirthdayCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Birthday + */ + select?: BirthdaySelectCreateManyAndReturn | null + /** + * The data used to create many Birthdays. + */ + data: BirthdayCreateManyInput | BirthdayCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Birthday update + */ + export type BirthdayUpdateArgs = { + /** + * Select specific fields to fetch from the Birthday + */ + select?: BirthdaySelect | null + /** + * The data needed to update a Birthday. + */ + data: XOR + /** + * Choose, which Birthday to update. + */ + where: BirthdayWhereUniqueInput + } + + /** + * Birthday updateMany + */ + export type BirthdayUpdateManyArgs = { + /** + * The data used to update Birthdays. + */ + data: XOR + /** + * Filter which Birthdays to update + */ + where?: BirthdayWhereInput + } + + /** + * Birthday upsert + */ + export type BirthdayUpsertArgs = { + /** + * Select specific fields to fetch from the Birthday + */ + select?: BirthdaySelect | null + /** + * The filter to search for the Birthday to update in case it exists. + */ + where: BirthdayWhereUniqueInput + /** + * In case the Birthday found by the `where` argument doesn't exist, create a new Birthday with this data. + */ + create: XOR + /** + * In case the Birthday was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * Birthday delete + */ + export type BirthdayDeleteArgs = { + /** + * Select specific fields to fetch from the Birthday + */ + select?: BirthdaySelect | null + /** + * Filter which Birthday to delete. + */ + where: BirthdayWhereUniqueInput + } + + /** + * Birthday deleteMany + */ + export type BirthdayDeleteManyArgs = { + /** + * Filter which Birthdays to delete + */ + where?: BirthdayWhereInput + } + + /** + * Birthday without action + */ + export type BirthdayDefaultArgs = { + /** + * Select specific fields to fetch from the Birthday + */ + select?: BirthdaySelect | null + } + + + /** + * Model ReactionRoleSet + */ + + export type AggregateReactionRoleSet = { + _count: ReactionRoleSetCountAggregateOutputType | null + _min: ReactionRoleSetMinAggregateOutputType | null + _max: ReactionRoleSetMaxAggregateOutputType | null + } + + export type ReactionRoleSetMinAggregateOutputType = { + id: string | null + guildId: string | null + channelId: string | null + messageId: string | null + title: string | null + description: string | null + createdAt: Date | null + updatedAt: Date | null + } + + export type ReactionRoleSetMaxAggregateOutputType = { + id: string | null + guildId: string | null + channelId: string | null + messageId: string | null + title: string | null + description: string | null + createdAt: Date | null + updatedAt: Date | null + } + + export type ReactionRoleSetCountAggregateOutputType = { + id: number + guildId: number + channelId: number + messageId: number + title: number + description: number + entries: number + createdAt: number + updatedAt: number + _all: number + } + + + export type ReactionRoleSetMinAggregateInputType = { + id?: true + guildId?: true + channelId?: true + messageId?: true + title?: true + description?: true + createdAt?: true + updatedAt?: true + } + + export type ReactionRoleSetMaxAggregateInputType = { + id?: true + guildId?: true + channelId?: true + messageId?: true + title?: true + description?: true + createdAt?: true + updatedAt?: true + } + + export type ReactionRoleSetCountAggregateInputType = { + id?: true + guildId?: true + channelId?: true + messageId?: true + title?: true + description?: true + entries?: true + createdAt?: true + updatedAt?: true + _all?: true + } + + export type ReactionRoleSetAggregateArgs = { + /** + * Filter which ReactionRoleSet to aggregate. + */ + where?: ReactionRoleSetWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of ReactionRoleSets to fetch. + */ + orderBy?: ReactionRoleSetOrderByWithRelationInput | ReactionRoleSetOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: ReactionRoleSetWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` ReactionRoleSets from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` ReactionRoleSets. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned ReactionRoleSets + **/ + _count?: true | ReactionRoleSetCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: ReactionRoleSetMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: ReactionRoleSetMaxAggregateInputType + } + + export type GetReactionRoleSetAggregateType = { + [P in keyof T & keyof AggregateReactionRoleSet]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type ReactionRoleSetGroupByArgs = { + where?: ReactionRoleSetWhereInput + orderBy?: ReactionRoleSetOrderByWithAggregationInput | ReactionRoleSetOrderByWithAggregationInput[] + by: ReactionRoleSetScalarFieldEnum[] | ReactionRoleSetScalarFieldEnum + having?: ReactionRoleSetScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: ReactionRoleSetCountAggregateInputType | true + _min?: ReactionRoleSetMinAggregateInputType + _max?: ReactionRoleSetMaxAggregateInputType + } + + export type ReactionRoleSetGroupByOutputType = { + id: string + guildId: string + channelId: string + messageId: string | null + title: string | null + description: string | null + entries: JsonValue + createdAt: Date + updatedAt: Date + _count: ReactionRoleSetCountAggregateOutputType | null + _min: ReactionRoleSetMinAggregateOutputType | null + _max: ReactionRoleSetMaxAggregateOutputType | null + } + + type GetReactionRoleSetGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof ReactionRoleSetGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type ReactionRoleSetSelect = $Extensions.GetSelect<{ + id?: boolean + guildId?: boolean + channelId?: boolean + messageId?: boolean + title?: boolean + description?: boolean + entries?: boolean + createdAt?: boolean + updatedAt?: boolean + }, ExtArgs["result"]["reactionRoleSet"]> + + export type ReactionRoleSetSelectCreateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + guildId?: boolean + channelId?: boolean + messageId?: boolean + title?: boolean + description?: boolean + entries?: boolean + createdAt?: boolean + updatedAt?: boolean + }, ExtArgs["result"]["reactionRoleSet"]> + + export type ReactionRoleSetSelectScalar = { + id?: boolean + guildId?: boolean + channelId?: boolean + messageId?: boolean + title?: boolean + description?: boolean + entries?: boolean + createdAt?: boolean + updatedAt?: boolean + } + + + export type $ReactionRoleSetPayload = { + name: "ReactionRoleSet" + objects: {} + scalars: $Extensions.GetPayloadResult<{ + id: string + guildId: string + channelId: string + messageId: string | null + title: string | null + description: string | null + entries: Prisma.JsonValue + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["reactionRoleSet"]> + composites: {} + } + + type ReactionRoleSetGetPayload = $Result.GetResult + + type ReactionRoleSetCountArgs = + Omit & { + select?: ReactionRoleSetCountAggregateInputType | true + } + + export interface ReactionRoleSetDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['ReactionRoleSet'], meta: { name: 'ReactionRoleSet' } } + /** + * Find zero or one ReactionRoleSet that matches the filter. + * @param {ReactionRoleSetFindUniqueArgs} args - Arguments to find a ReactionRoleSet + * @example + * // Get one ReactionRoleSet + * const reactionRoleSet = await prisma.reactionRoleSet.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__ReactionRoleSetClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one ReactionRoleSet that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {ReactionRoleSetFindUniqueOrThrowArgs} args - Arguments to find a ReactionRoleSet + * @example + * // Get one ReactionRoleSet + * const reactionRoleSet = await prisma.reactionRoleSet.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__ReactionRoleSetClient<$Result.GetResult, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first ReactionRoleSet that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ReactionRoleSetFindFirstArgs} args - Arguments to find a ReactionRoleSet + * @example + * // Get one ReactionRoleSet + * const reactionRoleSet = await prisma.reactionRoleSet.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__ReactionRoleSetClient<$Result.GetResult, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first ReactionRoleSet that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ReactionRoleSetFindFirstOrThrowArgs} args - Arguments to find a ReactionRoleSet + * @example + * // Get one ReactionRoleSet + * const reactionRoleSet = await prisma.reactionRoleSet.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__ReactionRoleSetClient<$Result.GetResult, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more ReactionRoleSets that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ReactionRoleSetFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all ReactionRoleSets + * const reactionRoleSets = await prisma.reactionRoleSet.findMany() + * + * // Get first 10 ReactionRoleSets + * const reactionRoleSets = await prisma.reactionRoleSet.findMany({ take: 10 }) + * + * // Only select the `id` + * const reactionRoleSetWithIdOnly = await prisma.reactionRoleSet.findMany({ select: { id: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany">> + + /** + * Create a ReactionRoleSet. + * @param {ReactionRoleSetCreateArgs} args - Arguments to create a ReactionRoleSet. + * @example + * // Create one ReactionRoleSet + * const ReactionRoleSet = await prisma.reactionRoleSet.create({ + * data: { + * // ... data to create a ReactionRoleSet + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__ReactionRoleSetClient<$Result.GetResult, T, "create">, never, ExtArgs> + + /** + * Create many ReactionRoleSets. + * @param {ReactionRoleSetCreateManyArgs} args - Arguments to create many ReactionRoleSets. + * @example + * // Create many ReactionRoleSets + * const reactionRoleSet = await prisma.reactionRoleSet.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many ReactionRoleSets and returns the data saved in the database. + * @param {ReactionRoleSetCreateManyAndReturnArgs} args - Arguments to create many ReactionRoleSets. + * @example + * // Create many ReactionRoleSets + * const reactionRoleSet = await prisma.reactionRoleSet.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many ReactionRoleSets and only return the `id` + * const reactionRoleSetWithIdOnly = await prisma.reactionRoleSet.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn">> + + /** + * Delete a ReactionRoleSet. + * @param {ReactionRoleSetDeleteArgs} args - Arguments to delete one ReactionRoleSet. + * @example + * // Delete one ReactionRoleSet + * const ReactionRoleSet = await prisma.reactionRoleSet.delete({ + * where: { + * // ... filter to delete one ReactionRoleSet + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__ReactionRoleSetClient<$Result.GetResult, T, "delete">, never, ExtArgs> + + /** + * Update one ReactionRoleSet. + * @param {ReactionRoleSetUpdateArgs} args - Arguments to update one ReactionRoleSet. + * @example + * // Update one ReactionRoleSet + * const reactionRoleSet = await prisma.reactionRoleSet.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__ReactionRoleSetClient<$Result.GetResult, T, "update">, never, ExtArgs> + + /** + * Delete zero or more ReactionRoleSets. + * @param {ReactionRoleSetDeleteManyArgs} args - Arguments to filter ReactionRoleSets to delete. + * @example + * // Delete a few ReactionRoleSets + * const { count } = await prisma.reactionRoleSet.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more ReactionRoleSets. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ReactionRoleSetUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many ReactionRoleSets + * const reactionRoleSet = await prisma.reactionRoleSet.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one ReactionRoleSet. + * @param {ReactionRoleSetUpsertArgs} args - Arguments to update or create a ReactionRoleSet. + * @example + * // Update or create a ReactionRoleSet + * const reactionRoleSet = await prisma.reactionRoleSet.upsert({ + * create: { + * // ... data to create a ReactionRoleSet + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the ReactionRoleSet we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__ReactionRoleSetClient<$Result.GetResult, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of ReactionRoleSets. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ReactionRoleSetCountArgs} args - Arguments to filter ReactionRoleSets to count. + * @example + * // Count the number of ReactionRoleSets + * const count = await prisma.reactionRoleSet.count({ + * where: { + * // ... the filter for the ReactionRoleSets we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a ReactionRoleSet. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ReactionRoleSetAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by ReactionRoleSet. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ReactionRoleSetGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends ReactionRoleSetGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: ReactionRoleSetGroupByArgs['orderBy'] } + : { orderBy?: ReactionRoleSetGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends MaybeTupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetReactionRoleSetGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the ReactionRoleSet model + */ + readonly fields: ReactionRoleSetFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for ReactionRoleSet. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export interface Prisma__ReactionRoleSetClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise + } + + + + + /** + * Fields of the ReactionRoleSet model + */ + interface ReactionRoleSetFieldRefs { + readonly id: FieldRef<"ReactionRoleSet", 'String'> + readonly guildId: FieldRef<"ReactionRoleSet", 'String'> + readonly channelId: FieldRef<"ReactionRoleSet", 'String'> + readonly messageId: FieldRef<"ReactionRoleSet", 'String'> + readonly title: FieldRef<"ReactionRoleSet", 'String'> + readonly description: FieldRef<"ReactionRoleSet", 'String'> + readonly entries: FieldRef<"ReactionRoleSet", 'Json'> + readonly createdAt: FieldRef<"ReactionRoleSet", 'DateTime'> + readonly updatedAt: FieldRef<"ReactionRoleSet", 'DateTime'> + } + + + // Custom InputTypes + /** + * ReactionRoleSet findUnique + */ + export type ReactionRoleSetFindUniqueArgs = { + /** + * Select specific fields to fetch from the ReactionRoleSet + */ + select?: ReactionRoleSetSelect | null + /** + * Filter, which ReactionRoleSet to fetch. + */ + where: ReactionRoleSetWhereUniqueInput + } + + /** + * ReactionRoleSet findUniqueOrThrow + */ + export type ReactionRoleSetFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the ReactionRoleSet + */ + select?: ReactionRoleSetSelect | null + /** + * Filter, which ReactionRoleSet to fetch. + */ + where: ReactionRoleSetWhereUniqueInput + } + + /** + * ReactionRoleSet findFirst + */ + export type ReactionRoleSetFindFirstArgs = { + /** + * Select specific fields to fetch from the ReactionRoleSet + */ + select?: ReactionRoleSetSelect | null + /** + * Filter, which ReactionRoleSet to fetch. + */ + where?: ReactionRoleSetWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of ReactionRoleSets to fetch. + */ + orderBy?: ReactionRoleSetOrderByWithRelationInput | ReactionRoleSetOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for ReactionRoleSets. + */ + cursor?: ReactionRoleSetWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` ReactionRoleSets from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` ReactionRoleSets. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of ReactionRoleSets. + */ + distinct?: ReactionRoleSetScalarFieldEnum | ReactionRoleSetScalarFieldEnum[] + } + + /** + * ReactionRoleSet findFirstOrThrow + */ + export type ReactionRoleSetFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the ReactionRoleSet + */ + select?: ReactionRoleSetSelect | null + /** + * Filter, which ReactionRoleSet to fetch. + */ + where?: ReactionRoleSetWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of ReactionRoleSets to fetch. + */ + orderBy?: ReactionRoleSetOrderByWithRelationInput | ReactionRoleSetOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for ReactionRoleSets. + */ + cursor?: ReactionRoleSetWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` ReactionRoleSets from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` ReactionRoleSets. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of ReactionRoleSets. + */ + distinct?: ReactionRoleSetScalarFieldEnum | ReactionRoleSetScalarFieldEnum[] + } + + /** + * ReactionRoleSet findMany + */ + export type ReactionRoleSetFindManyArgs = { + /** + * Select specific fields to fetch from the ReactionRoleSet + */ + select?: ReactionRoleSetSelect | null + /** + * Filter, which ReactionRoleSets to fetch. + */ + where?: ReactionRoleSetWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of ReactionRoleSets to fetch. + */ + orderBy?: ReactionRoleSetOrderByWithRelationInput | ReactionRoleSetOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing ReactionRoleSets. + */ + cursor?: ReactionRoleSetWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` ReactionRoleSets from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` ReactionRoleSets. + */ + skip?: number + distinct?: ReactionRoleSetScalarFieldEnum | ReactionRoleSetScalarFieldEnum[] + } + + /** + * ReactionRoleSet create + */ + export type ReactionRoleSetCreateArgs = { + /** + * Select specific fields to fetch from the ReactionRoleSet + */ + select?: ReactionRoleSetSelect | null + /** + * The data needed to create a ReactionRoleSet. + */ + data: XOR + } + + /** + * ReactionRoleSet createMany + */ + export type ReactionRoleSetCreateManyArgs = { + /** + * The data used to create many ReactionRoleSets. + */ + data: ReactionRoleSetCreateManyInput | ReactionRoleSetCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * ReactionRoleSet createManyAndReturn + */ + export type ReactionRoleSetCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the ReactionRoleSet + */ + select?: ReactionRoleSetSelectCreateManyAndReturn | null + /** + * The data used to create many ReactionRoleSets. + */ + data: ReactionRoleSetCreateManyInput | ReactionRoleSetCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * ReactionRoleSet update + */ + export type ReactionRoleSetUpdateArgs = { + /** + * Select specific fields to fetch from the ReactionRoleSet + */ + select?: ReactionRoleSetSelect | null + /** + * The data needed to update a ReactionRoleSet. + */ + data: XOR + /** + * Choose, which ReactionRoleSet to update. + */ + where: ReactionRoleSetWhereUniqueInput + } + + /** + * ReactionRoleSet updateMany + */ + export type ReactionRoleSetUpdateManyArgs = { + /** + * The data used to update ReactionRoleSets. + */ + data: XOR + /** + * Filter which ReactionRoleSets to update + */ + where?: ReactionRoleSetWhereInput + } + + /** + * ReactionRoleSet upsert + */ + export type ReactionRoleSetUpsertArgs = { + /** + * Select specific fields to fetch from the ReactionRoleSet + */ + select?: ReactionRoleSetSelect | null + /** + * The filter to search for the ReactionRoleSet to update in case it exists. + */ + where: ReactionRoleSetWhereUniqueInput + /** + * In case the ReactionRoleSet found by the `where` argument doesn't exist, create a new ReactionRoleSet with this data. + */ + create: XOR + /** + * In case the ReactionRoleSet was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * ReactionRoleSet delete + */ + export type ReactionRoleSetDeleteArgs = { + /** + * Select specific fields to fetch from the ReactionRoleSet + */ + select?: ReactionRoleSetSelect | null + /** + * Filter which ReactionRoleSet to delete. + */ + where: ReactionRoleSetWhereUniqueInput + } + + /** + * ReactionRoleSet deleteMany + */ + export type ReactionRoleSetDeleteManyArgs = { + /** + * Filter which ReactionRoleSets to delete + */ + where?: ReactionRoleSetWhereInput + } + + /** + * ReactionRoleSet without action + */ + export type ReactionRoleSetDefaultArgs = { + /** + * Select specific fields to fetch from the ReactionRoleSet + */ + select?: ReactionRoleSetSelect | null + } + + + /** + * Model Event + */ + + export type AggregateEvent = { + _count: EventCountAggregateOutputType | null + _avg: EventAvgAggregateOutputType | null + _sum: EventSumAggregateOutputType | null + _min: EventMinAggregateOutputType | null + _max: EventMaxAggregateOutputType | null + } + + export type EventAvgAggregateOutputType = { + reminderOffsetMinutes: number | null + } + + export type EventSumAggregateOutputType = { + reminderOffsetMinutes: number | null + } + + export type EventMinAggregateOutputType = { + id: string | null + guildId: string | null + title: string | null + description: string | null + channelId: string | null + startTime: Date | null + repeatType: string | null + reminderOffsetMinutes: number | null + roleId: string | null + isActive: boolean | null + lastReminderAt: Date | null + createdAt: Date | null + updatedAt: Date | null + } + + export type EventMaxAggregateOutputType = { + id: string | null + guildId: string | null + title: string | null + description: string | null + channelId: string | null + startTime: Date | null + repeatType: string | null + reminderOffsetMinutes: number | null + roleId: string | null + isActive: boolean | null + lastReminderAt: Date | null + createdAt: Date | null + updatedAt: Date | null + } + + export type EventCountAggregateOutputType = { + id: number + guildId: number + title: number + description: number + channelId: number + startTime: number + repeatType: number + repeatConfig: number + reminderOffsetMinutes: number + roleId: number + isActive: number + lastReminderAt: number + createdAt: number + updatedAt: number + _all: number + } + + + export type EventAvgAggregateInputType = { + reminderOffsetMinutes?: true + } + + export type EventSumAggregateInputType = { + reminderOffsetMinutes?: true + } + + export type EventMinAggregateInputType = { + id?: true + guildId?: true + title?: true + description?: true + channelId?: true + startTime?: true + repeatType?: true + reminderOffsetMinutes?: true + roleId?: true + isActive?: true + lastReminderAt?: true + createdAt?: true + updatedAt?: true + } + + export type EventMaxAggregateInputType = { + id?: true + guildId?: true + title?: true + description?: true + channelId?: true + startTime?: true + repeatType?: true + reminderOffsetMinutes?: true + roleId?: true + isActive?: true + lastReminderAt?: true + createdAt?: true + updatedAt?: true + } + + export type EventCountAggregateInputType = { + id?: true + guildId?: true + title?: true + description?: true + channelId?: true + startTime?: true + repeatType?: true + repeatConfig?: true + reminderOffsetMinutes?: true + roleId?: true + isActive?: true + lastReminderAt?: true + createdAt?: true + updatedAt?: true + _all?: true + } + + export type EventAggregateArgs = { + /** + * Filter which Event to aggregate. + */ + where?: EventWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Events to fetch. + */ + orderBy?: EventOrderByWithRelationInput | EventOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: EventWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Events from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Events. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Events + **/ + _count?: true | EventCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: EventAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: EventSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: EventMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: EventMaxAggregateInputType + } + + export type GetEventAggregateType = { + [P in keyof T & keyof AggregateEvent]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type EventGroupByArgs = { + where?: EventWhereInput + orderBy?: EventOrderByWithAggregationInput | EventOrderByWithAggregationInput[] + by: EventScalarFieldEnum[] | EventScalarFieldEnum + having?: EventScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: EventCountAggregateInputType | true + _avg?: EventAvgAggregateInputType + _sum?: EventSumAggregateInputType + _min?: EventMinAggregateInputType + _max?: EventMaxAggregateInputType + } + + export type EventGroupByOutputType = { + id: string + guildId: string + title: string + description: string | null + channelId: string + startTime: Date + repeatType: string + repeatConfig: JsonValue | null + reminderOffsetMinutes: number + roleId: string | null + isActive: boolean + lastReminderAt: Date | null + createdAt: Date + updatedAt: Date + _count: EventCountAggregateOutputType | null + _avg: EventAvgAggregateOutputType | null + _sum: EventSumAggregateOutputType | null + _min: EventMinAggregateOutputType | null + _max: EventMaxAggregateOutputType | null + } + + type GetEventGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof EventGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type EventSelect = $Extensions.GetSelect<{ + id?: boolean + guildId?: boolean + title?: boolean + description?: boolean + channelId?: boolean + startTime?: boolean + repeatType?: boolean + repeatConfig?: boolean + reminderOffsetMinutes?: boolean + roleId?: boolean + isActive?: boolean + lastReminderAt?: boolean + createdAt?: boolean + updatedAt?: boolean + signups?: boolean | Event$signupsArgs + _count?: boolean | EventCountOutputTypeDefaultArgs + }, ExtArgs["result"]["event"]> + + export type EventSelectCreateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + guildId?: boolean + title?: boolean + description?: boolean + channelId?: boolean + startTime?: boolean + repeatType?: boolean + repeatConfig?: boolean + reminderOffsetMinutes?: boolean + roleId?: boolean + isActive?: boolean + lastReminderAt?: boolean + createdAt?: boolean + updatedAt?: boolean + }, ExtArgs["result"]["event"]> + + export type EventSelectScalar = { + id?: boolean + guildId?: boolean + title?: boolean + description?: boolean + channelId?: boolean + startTime?: boolean + repeatType?: boolean + repeatConfig?: boolean + reminderOffsetMinutes?: boolean + roleId?: boolean + isActive?: boolean + lastReminderAt?: boolean + createdAt?: boolean + updatedAt?: boolean + } + + export type EventInclude = { + signups?: boolean | Event$signupsArgs + _count?: boolean | EventCountOutputTypeDefaultArgs + } + export type EventIncludeCreateManyAndReturn = {} + + export type $EventPayload = { + name: "Event" + objects: { + signups: Prisma.$EventSignupPayload[] + } + scalars: $Extensions.GetPayloadResult<{ + id: string + guildId: string + title: string + description: string | null + channelId: string + startTime: Date + repeatType: string + repeatConfig: Prisma.JsonValue | null + reminderOffsetMinutes: number + roleId: string | null + isActive: boolean + lastReminderAt: Date | null + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["event"]> + composites: {} + } + + type EventGetPayload = $Result.GetResult + + type EventCountArgs = + Omit & { + select?: EventCountAggregateInputType | true + } + + export interface EventDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Event'], meta: { name: 'Event' } } + /** + * Find zero or one Event that matches the filter. + * @param {EventFindUniqueArgs} args - Arguments to find a Event + * @example + * // Get one Event + * const event = await prisma.event.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__EventClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one Event that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {EventFindUniqueOrThrowArgs} args - Arguments to find a Event + * @example + * // Get one Event + * const event = await prisma.event.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__EventClient<$Result.GetResult, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first Event that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {EventFindFirstArgs} args - Arguments to find a Event + * @example + * // Get one Event + * const event = await prisma.event.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__EventClient<$Result.GetResult, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first Event that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {EventFindFirstOrThrowArgs} args - Arguments to find a Event + * @example + * // Get one Event + * const event = await prisma.event.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__EventClient<$Result.GetResult, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more Events that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {EventFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Events + * const events = await prisma.event.findMany() + * + * // Get first 10 Events + * const events = await prisma.event.findMany({ take: 10 }) + * + * // Only select the `id` + * const eventWithIdOnly = await prisma.event.findMany({ select: { id: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany">> + + /** + * Create a Event. + * @param {EventCreateArgs} args - Arguments to create a Event. + * @example + * // Create one Event + * const Event = await prisma.event.create({ + * data: { + * // ... data to create a Event + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__EventClient<$Result.GetResult, T, "create">, never, ExtArgs> + + /** + * Create many Events. + * @param {EventCreateManyArgs} args - Arguments to create many Events. + * @example + * // Create many Events + * const event = await prisma.event.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Events and returns the data saved in the database. + * @param {EventCreateManyAndReturnArgs} args - Arguments to create many Events. + * @example + * // Create many Events + * const event = await prisma.event.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Events and only return the `id` + * const eventWithIdOnly = await prisma.event.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn">> + + /** + * Delete a Event. + * @param {EventDeleteArgs} args - Arguments to delete one Event. + * @example + * // Delete one Event + * const Event = await prisma.event.delete({ + * where: { + * // ... filter to delete one Event + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__EventClient<$Result.GetResult, T, "delete">, never, ExtArgs> + + /** + * Update one Event. + * @param {EventUpdateArgs} args - Arguments to update one Event. + * @example + * // Update one Event + * const event = await prisma.event.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__EventClient<$Result.GetResult, T, "update">, never, ExtArgs> + + /** + * Delete zero or more Events. + * @param {EventDeleteManyArgs} args - Arguments to filter Events to delete. + * @example + * // Delete a few Events + * const { count } = await prisma.event.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Events. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {EventUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Events + * const event = await prisma.event.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one Event. + * @param {EventUpsertArgs} args - Arguments to update or create a Event. + * @example + * // Update or create a Event + * const event = await prisma.event.upsert({ + * create: { + * // ... data to create a Event + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Event we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__EventClient<$Result.GetResult, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of Events. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {EventCountArgs} args - Arguments to filter Events to count. + * @example + * // Count the number of Events + * const count = await prisma.event.count({ + * where: { + * // ... the filter for the Events we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Event. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {EventAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by Event. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {EventGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends EventGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: EventGroupByArgs['orderBy'] } + : { orderBy?: EventGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends MaybeTupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetEventGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the Event model + */ + readonly fields: EventFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for Event. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export interface Prisma__EventClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + signups = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise + } + + + + + /** + * Fields of the Event model + */ + interface EventFieldRefs { + readonly id: FieldRef<"Event", 'String'> + readonly guildId: FieldRef<"Event", 'String'> + readonly title: FieldRef<"Event", 'String'> + readonly description: FieldRef<"Event", 'String'> + readonly channelId: FieldRef<"Event", 'String'> + readonly startTime: FieldRef<"Event", 'DateTime'> + readonly repeatType: FieldRef<"Event", 'String'> + readonly repeatConfig: FieldRef<"Event", 'Json'> + readonly reminderOffsetMinutes: FieldRef<"Event", 'Int'> + readonly roleId: FieldRef<"Event", 'String'> + readonly isActive: FieldRef<"Event", 'Boolean'> + readonly lastReminderAt: FieldRef<"Event", 'DateTime'> + readonly createdAt: FieldRef<"Event", 'DateTime'> + readonly updatedAt: FieldRef<"Event", 'DateTime'> + } + + + // Custom InputTypes + /** + * Event findUnique + */ + export type EventFindUniqueArgs = { + /** + * Select specific fields to fetch from the Event + */ + select?: EventSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventInclude | null + /** + * Filter, which Event to fetch. + */ + where: EventWhereUniqueInput + } + + /** + * Event findUniqueOrThrow + */ + export type EventFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Event + */ + select?: EventSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventInclude | null + /** + * Filter, which Event to fetch. + */ + where: EventWhereUniqueInput + } + + /** + * Event findFirst + */ + export type EventFindFirstArgs = { + /** + * Select specific fields to fetch from the Event + */ + select?: EventSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventInclude | null + /** + * Filter, which Event to fetch. + */ + where?: EventWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Events to fetch. + */ + orderBy?: EventOrderByWithRelationInput | EventOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Events. + */ + cursor?: EventWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Events from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Events. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Events. + */ + distinct?: EventScalarFieldEnum | EventScalarFieldEnum[] + } + + /** + * Event findFirstOrThrow + */ + export type EventFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Event + */ + select?: EventSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventInclude | null + /** + * Filter, which Event to fetch. + */ + where?: EventWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Events to fetch. + */ + orderBy?: EventOrderByWithRelationInput | EventOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Events. + */ + cursor?: EventWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Events from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Events. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Events. + */ + distinct?: EventScalarFieldEnum | EventScalarFieldEnum[] + } + + /** + * Event findMany + */ + export type EventFindManyArgs = { + /** + * Select specific fields to fetch from the Event + */ + select?: EventSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventInclude | null + /** + * Filter, which Events to fetch. + */ + where?: EventWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Events to fetch. + */ + orderBy?: EventOrderByWithRelationInput | EventOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Events. + */ + cursor?: EventWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Events from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Events. + */ + skip?: number + distinct?: EventScalarFieldEnum | EventScalarFieldEnum[] + } + + /** + * Event create + */ + export type EventCreateArgs = { + /** + * Select specific fields to fetch from the Event + */ + select?: EventSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventInclude | null + /** + * The data needed to create a Event. + */ + data: XOR + } + + /** + * Event createMany + */ + export type EventCreateManyArgs = { + /** + * The data used to create many Events. + */ + data: EventCreateManyInput | EventCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Event createManyAndReturn + */ + export type EventCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Event + */ + select?: EventSelectCreateManyAndReturn | null + /** + * The data used to create many Events. + */ + data: EventCreateManyInput | EventCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Event update + */ + export type EventUpdateArgs = { + /** + * Select specific fields to fetch from the Event + */ + select?: EventSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventInclude | null + /** + * The data needed to update a Event. + */ + data: XOR + /** + * Choose, which Event to update. + */ + where: EventWhereUniqueInput + } + + /** + * Event updateMany + */ + export type EventUpdateManyArgs = { + /** + * The data used to update Events. + */ + data: XOR + /** + * Filter which Events to update + */ + where?: EventWhereInput + } + + /** + * Event upsert + */ + export type EventUpsertArgs = { + /** + * Select specific fields to fetch from the Event + */ + select?: EventSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventInclude | null + /** + * The filter to search for the Event to update in case it exists. + */ + where: EventWhereUniqueInput + /** + * In case the Event found by the `where` argument doesn't exist, create a new Event with this data. + */ + create: XOR + /** + * In case the Event was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * Event delete + */ + export type EventDeleteArgs = { + /** + * Select specific fields to fetch from the Event + */ + select?: EventSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventInclude | null + /** + * Filter which Event to delete. + */ + where: EventWhereUniqueInput + } + + /** + * Event deleteMany + */ + export type EventDeleteManyArgs = { + /** + * Filter which Events to delete + */ + where?: EventWhereInput + } + + /** + * Event.signups + */ + export type Event$signupsArgs = { + /** + * Select specific fields to fetch from the EventSignup + */ + select?: EventSignupSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventSignupInclude | null + where?: EventSignupWhereInput + orderBy?: EventSignupOrderByWithRelationInput | EventSignupOrderByWithRelationInput[] + cursor?: EventSignupWhereUniqueInput + take?: number + skip?: number + distinct?: EventSignupScalarFieldEnum | EventSignupScalarFieldEnum[] + } + + /** + * Event without action + */ + export type EventDefaultArgs = { + /** + * Select specific fields to fetch from the Event + */ + select?: EventSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventInclude | null + } + + + /** + * Model EventSignup + */ + + export type AggregateEventSignup = { + _count: EventSignupCountAggregateOutputType | null + _min: EventSignupMinAggregateOutputType | null + _max: EventSignupMaxAggregateOutputType | null + } + + export type EventSignupMinAggregateOutputType = { + id: string | null + eventId: string | null + guildId: string | null + userId: string | null + createdAt: Date | null + canceledAt: Date | null + } + + export type EventSignupMaxAggregateOutputType = { + id: string | null + eventId: string | null + guildId: string | null + userId: string | null + createdAt: Date | null + canceledAt: Date | null + } + + export type EventSignupCountAggregateOutputType = { + id: number + eventId: number + guildId: number + userId: number + createdAt: number + canceledAt: number + _all: number + } + + + export type EventSignupMinAggregateInputType = { + id?: true + eventId?: true + guildId?: true + userId?: true + createdAt?: true + canceledAt?: true + } + + export type EventSignupMaxAggregateInputType = { + id?: true + eventId?: true + guildId?: true + userId?: true + createdAt?: true + canceledAt?: true + } + + export type EventSignupCountAggregateInputType = { + id?: true + eventId?: true + guildId?: true + userId?: true + createdAt?: true + canceledAt?: true + _all?: true + } + + export type EventSignupAggregateArgs = { + /** + * Filter which EventSignup to aggregate. + */ + where?: EventSignupWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of EventSignups to fetch. + */ + orderBy?: EventSignupOrderByWithRelationInput | EventSignupOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: EventSignupWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` EventSignups from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` EventSignups. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned EventSignups + **/ + _count?: true | EventSignupCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: EventSignupMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: EventSignupMaxAggregateInputType + } + + export type GetEventSignupAggregateType = { + [P in keyof T & keyof AggregateEventSignup]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type EventSignupGroupByArgs = { + where?: EventSignupWhereInput + orderBy?: EventSignupOrderByWithAggregationInput | EventSignupOrderByWithAggregationInput[] + by: EventSignupScalarFieldEnum[] | EventSignupScalarFieldEnum + having?: EventSignupScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: EventSignupCountAggregateInputType | true + _min?: EventSignupMinAggregateInputType + _max?: EventSignupMaxAggregateInputType + } + + export type EventSignupGroupByOutputType = { + id: string + eventId: string + guildId: string + userId: string + createdAt: Date + canceledAt: Date | null + _count: EventSignupCountAggregateOutputType | null + _min: EventSignupMinAggregateOutputType | null + _max: EventSignupMaxAggregateOutputType | null + } + + type GetEventSignupGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof EventSignupGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type EventSignupSelect = $Extensions.GetSelect<{ + id?: boolean + eventId?: boolean + guildId?: boolean + userId?: boolean + createdAt?: boolean + canceledAt?: boolean + event?: boolean | EventDefaultArgs + }, ExtArgs["result"]["eventSignup"]> + + export type EventSignupSelectCreateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + eventId?: boolean + guildId?: boolean + userId?: boolean + createdAt?: boolean + canceledAt?: boolean + event?: boolean | EventDefaultArgs + }, ExtArgs["result"]["eventSignup"]> + + export type EventSignupSelectScalar = { + id?: boolean + eventId?: boolean + guildId?: boolean + userId?: boolean + createdAt?: boolean + canceledAt?: boolean + } + + export type EventSignupInclude = { + event?: boolean | EventDefaultArgs + } + export type EventSignupIncludeCreateManyAndReturn = { + event?: boolean | EventDefaultArgs + } + + export type $EventSignupPayload = { + name: "EventSignup" + objects: { + event: Prisma.$EventPayload + } + scalars: $Extensions.GetPayloadResult<{ + id: string + eventId: string + guildId: string + userId: string + createdAt: Date + canceledAt: Date | null + }, ExtArgs["result"]["eventSignup"]> + composites: {} + } + + type EventSignupGetPayload = $Result.GetResult + + type EventSignupCountArgs = + Omit & { + select?: EventSignupCountAggregateInputType | true + } + + export interface EventSignupDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['EventSignup'], meta: { name: 'EventSignup' } } + /** + * Find zero or one EventSignup that matches the filter. + * @param {EventSignupFindUniqueArgs} args - Arguments to find a EventSignup + * @example + * // Get one EventSignup + * const eventSignup = await prisma.eventSignup.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__EventSignupClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one EventSignup that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {EventSignupFindUniqueOrThrowArgs} args - Arguments to find a EventSignup + * @example + * // Get one EventSignup + * const eventSignup = await prisma.eventSignup.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__EventSignupClient<$Result.GetResult, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first EventSignup that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {EventSignupFindFirstArgs} args - Arguments to find a EventSignup + * @example + * // Get one EventSignup + * const eventSignup = await prisma.eventSignup.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__EventSignupClient<$Result.GetResult, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first EventSignup that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {EventSignupFindFirstOrThrowArgs} args - Arguments to find a EventSignup + * @example + * // Get one EventSignup + * const eventSignup = await prisma.eventSignup.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__EventSignupClient<$Result.GetResult, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more EventSignups that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {EventSignupFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all EventSignups + * const eventSignups = await prisma.eventSignup.findMany() + * + * // Get first 10 EventSignups + * const eventSignups = await prisma.eventSignup.findMany({ take: 10 }) + * + * // Only select the `id` + * const eventSignupWithIdOnly = await prisma.eventSignup.findMany({ select: { id: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany">> + + /** + * Create a EventSignup. + * @param {EventSignupCreateArgs} args - Arguments to create a EventSignup. + * @example + * // Create one EventSignup + * const EventSignup = await prisma.eventSignup.create({ + * data: { + * // ... data to create a EventSignup + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__EventSignupClient<$Result.GetResult, T, "create">, never, ExtArgs> + + /** + * Create many EventSignups. + * @param {EventSignupCreateManyArgs} args - Arguments to create many EventSignups. + * @example + * // Create many EventSignups + * const eventSignup = await prisma.eventSignup.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many EventSignups and returns the data saved in the database. + * @param {EventSignupCreateManyAndReturnArgs} args - Arguments to create many EventSignups. + * @example + * // Create many EventSignups + * const eventSignup = await prisma.eventSignup.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many EventSignups and only return the `id` + * const eventSignupWithIdOnly = await prisma.eventSignup.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn">> + + /** + * Delete a EventSignup. + * @param {EventSignupDeleteArgs} args - Arguments to delete one EventSignup. + * @example + * // Delete one EventSignup + * const EventSignup = await prisma.eventSignup.delete({ + * where: { + * // ... filter to delete one EventSignup + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__EventSignupClient<$Result.GetResult, T, "delete">, never, ExtArgs> + + /** + * Update one EventSignup. + * @param {EventSignupUpdateArgs} args - Arguments to update one EventSignup. + * @example + * // Update one EventSignup + * const eventSignup = await prisma.eventSignup.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__EventSignupClient<$Result.GetResult, T, "update">, never, ExtArgs> + + /** + * Delete zero or more EventSignups. + * @param {EventSignupDeleteManyArgs} args - Arguments to filter EventSignups to delete. + * @example + * // Delete a few EventSignups + * const { count } = await prisma.eventSignup.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more EventSignups. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {EventSignupUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many EventSignups + * const eventSignup = await prisma.eventSignup.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one EventSignup. + * @param {EventSignupUpsertArgs} args - Arguments to update or create a EventSignup. + * @example + * // Update or create a EventSignup + * const eventSignup = await prisma.eventSignup.upsert({ + * create: { + * // ... data to create a EventSignup + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the EventSignup we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__EventSignupClient<$Result.GetResult, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of EventSignups. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {EventSignupCountArgs} args - Arguments to filter EventSignups to count. + * @example + * // Count the number of EventSignups + * const count = await prisma.eventSignup.count({ + * where: { + * // ... the filter for the EventSignups we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a EventSignup. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {EventSignupAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by EventSignup. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {EventSignupGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends EventSignupGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: EventSignupGroupByArgs['orderBy'] } + : { orderBy?: EventSignupGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends MaybeTupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetEventSignupGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the EventSignup model + */ + readonly fields: EventSignupFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for EventSignup. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export interface Prisma__EventSignupClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + event = {}>(args?: Subset>): Prisma__EventClient<$Result.GetResult, T, "findUniqueOrThrow"> | Null, Null, ExtArgs> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise + } + + + + + /** + * Fields of the EventSignup model + */ + interface EventSignupFieldRefs { + readonly id: FieldRef<"EventSignup", 'String'> + readonly eventId: FieldRef<"EventSignup", 'String'> + readonly guildId: FieldRef<"EventSignup", 'String'> + readonly userId: FieldRef<"EventSignup", 'String'> + readonly createdAt: FieldRef<"EventSignup", 'DateTime'> + readonly canceledAt: FieldRef<"EventSignup", 'DateTime'> + } + + + // Custom InputTypes + /** + * EventSignup findUnique + */ + export type EventSignupFindUniqueArgs = { + /** + * Select specific fields to fetch from the EventSignup + */ + select?: EventSignupSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventSignupInclude | null + /** + * Filter, which EventSignup to fetch. + */ + where: EventSignupWhereUniqueInput + } + + /** + * EventSignup findUniqueOrThrow + */ + export type EventSignupFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the EventSignup + */ + select?: EventSignupSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventSignupInclude | null + /** + * Filter, which EventSignup to fetch. + */ + where: EventSignupWhereUniqueInput + } + + /** + * EventSignup findFirst + */ + export type EventSignupFindFirstArgs = { + /** + * Select specific fields to fetch from the EventSignup + */ + select?: EventSignupSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventSignupInclude | null + /** + * Filter, which EventSignup to fetch. + */ + where?: EventSignupWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of EventSignups to fetch. + */ + orderBy?: EventSignupOrderByWithRelationInput | EventSignupOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for EventSignups. + */ + cursor?: EventSignupWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` EventSignups from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` EventSignups. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of EventSignups. + */ + distinct?: EventSignupScalarFieldEnum | EventSignupScalarFieldEnum[] + } + + /** + * EventSignup findFirstOrThrow + */ + export type EventSignupFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the EventSignup + */ + select?: EventSignupSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventSignupInclude | null + /** + * Filter, which EventSignup to fetch. + */ + where?: EventSignupWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of EventSignups to fetch. + */ + orderBy?: EventSignupOrderByWithRelationInput | EventSignupOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for EventSignups. + */ + cursor?: EventSignupWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` EventSignups from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` EventSignups. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of EventSignups. + */ + distinct?: EventSignupScalarFieldEnum | EventSignupScalarFieldEnum[] + } + + /** + * EventSignup findMany + */ + export type EventSignupFindManyArgs = { + /** + * Select specific fields to fetch from the EventSignup + */ + select?: EventSignupSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventSignupInclude | null + /** + * Filter, which EventSignups to fetch. + */ + where?: EventSignupWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of EventSignups to fetch. + */ + orderBy?: EventSignupOrderByWithRelationInput | EventSignupOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing EventSignups. + */ + cursor?: EventSignupWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` EventSignups from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` EventSignups. + */ + skip?: number + distinct?: EventSignupScalarFieldEnum | EventSignupScalarFieldEnum[] + } + + /** + * EventSignup create + */ + export type EventSignupCreateArgs = { + /** + * Select specific fields to fetch from the EventSignup + */ + select?: EventSignupSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventSignupInclude | null + /** + * The data needed to create a EventSignup. + */ + data: XOR + } + + /** + * EventSignup createMany + */ + export type EventSignupCreateManyArgs = { + /** + * The data used to create many EventSignups. + */ + data: EventSignupCreateManyInput | EventSignupCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * EventSignup createManyAndReturn + */ + export type EventSignupCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the EventSignup + */ + select?: EventSignupSelectCreateManyAndReturn | null + /** + * The data used to create many EventSignups. + */ + data: EventSignupCreateManyInput | EventSignupCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: EventSignupIncludeCreateManyAndReturn | null + } + + /** + * EventSignup update + */ + export type EventSignupUpdateArgs = { + /** + * Select specific fields to fetch from the EventSignup + */ + select?: EventSignupSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventSignupInclude | null + /** + * The data needed to update a EventSignup. + */ + data: XOR + /** + * Choose, which EventSignup to update. + */ + where: EventSignupWhereUniqueInput + } + + /** + * EventSignup updateMany + */ + export type EventSignupUpdateManyArgs = { + /** + * The data used to update EventSignups. + */ + data: XOR + /** + * Filter which EventSignups to update + */ + where?: EventSignupWhereInput + } + + /** + * EventSignup upsert + */ + export type EventSignupUpsertArgs = { + /** + * Select specific fields to fetch from the EventSignup + */ + select?: EventSignupSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventSignupInclude | null + /** + * The filter to search for the EventSignup to update in case it exists. + */ + where: EventSignupWhereUniqueInput + /** + * In case the EventSignup found by the `where` argument doesn't exist, create a new EventSignup with this data. + */ + create: XOR + /** + * In case the EventSignup was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * EventSignup delete + */ + export type EventSignupDeleteArgs = { + /** + * Select specific fields to fetch from the EventSignup + */ + select?: EventSignupSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventSignupInclude | null + /** + * Filter which EventSignup to delete. + */ + where: EventSignupWhereUniqueInput + } + + /** + * EventSignup deleteMany + */ + export type EventSignupDeleteManyArgs = { + /** + * Filter which EventSignups to delete + */ + where?: EventSignupWhereInput + } + + /** + * EventSignup without action + */ + export type EventSignupDefaultArgs = { + /** + * Select specific fields to fetch from the EventSignup + */ + select?: EventSignupSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: EventSignupInclude | null + } + + + /** + * Enums + */ + + export const TransactionIsolationLevel: { + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' + }; + + export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + + export const GuildSettingsScalarFieldEnum: { + guildId: 'guildId', + welcomeChannelId: 'welcomeChannelId', + logChannelId: 'logChannelId', + automodEnabled: 'automodEnabled', + automodConfig: 'automodConfig', + levelingEnabled: 'levelingEnabled', + ticketsEnabled: 'ticketsEnabled', + musicEnabled: 'musicEnabled', + statuspageEnabled: 'statuspageEnabled', + statuspageConfig: 'statuspageConfig', + dynamicVoiceEnabled: 'dynamicVoiceEnabled', + dynamicVoiceConfig: 'dynamicVoiceConfig', + supportLoginConfig: 'supportLoginConfig', + birthdayEnabled: 'birthdayEnabled', + birthdayConfig: 'birthdayConfig', + reactionRolesEnabled: 'reactionRolesEnabled', + reactionRolesConfig: 'reactionRolesConfig', + eventsEnabled: 'eventsEnabled', + supportRoleId: 'supportRoleId', + updatedAt: 'updatedAt', + createdAt: 'createdAt' + }; + + export type GuildSettingsScalarFieldEnum = (typeof GuildSettingsScalarFieldEnum)[keyof typeof GuildSettingsScalarFieldEnum] + + + export const TicketScalarFieldEnum: { + id: 'id', + ticketNumber: 'ticketNumber', + userId: 'userId', + channelId: 'channelId', + guildId: 'guildId', + topic: 'topic', + priority: 'priority', + status: 'status', + claimedBy: 'claimedBy', + transcript: 'transcript', + createdAt: 'createdAt', + updatedAt: 'updatedAt' + }; + + export type TicketScalarFieldEnum = (typeof TicketScalarFieldEnum)[keyof typeof TicketScalarFieldEnum] + + + export const LevelScalarFieldEnum: { + id: 'id', + userId: 'userId', + guildId: 'guildId', + xp: 'xp', + level: 'level', + createdAt: 'createdAt', + updatedAt: 'updatedAt' + }; + + export type LevelScalarFieldEnum = (typeof LevelScalarFieldEnum)[keyof typeof LevelScalarFieldEnum] + + + export const TicketSupportSessionScalarFieldEnum: { + id: 'id', + guildId: 'guildId', + userId: 'userId', + roleId: 'roleId', + startedAt: 'startedAt', + endedAt: 'endedAt', + durationSeconds: 'durationSeconds' + }; + + export type TicketSupportSessionScalarFieldEnum = (typeof TicketSupportSessionScalarFieldEnum)[keyof typeof TicketSupportSessionScalarFieldEnum] + + + export const BirthdayScalarFieldEnum: { + id: 'id', + userId: 'userId', + guildId: 'guildId', + birthDate: 'birthDate', + createdAt: 'createdAt', + updatedAt: 'updatedAt' + }; + + export type BirthdayScalarFieldEnum = (typeof BirthdayScalarFieldEnum)[keyof typeof BirthdayScalarFieldEnum] + + + export const ReactionRoleSetScalarFieldEnum: { + id: 'id', + guildId: 'guildId', + channelId: 'channelId', + messageId: 'messageId', + title: 'title', + description: 'description', + entries: 'entries', + createdAt: 'createdAt', + updatedAt: 'updatedAt' + }; + + export type ReactionRoleSetScalarFieldEnum = (typeof ReactionRoleSetScalarFieldEnum)[keyof typeof ReactionRoleSetScalarFieldEnum] + + + export const EventScalarFieldEnum: { + id: 'id', + guildId: 'guildId', + title: 'title', + description: 'description', + channelId: 'channelId', + startTime: 'startTime', + repeatType: 'repeatType', + repeatConfig: 'repeatConfig', + reminderOffsetMinutes: 'reminderOffsetMinutes', + roleId: 'roleId', + isActive: 'isActive', + lastReminderAt: 'lastReminderAt', + createdAt: 'createdAt', + updatedAt: 'updatedAt' + }; + + export type EventScalarFieldEnum = (typeof EventScalarFieldEnum)[keyof typeof EventScalarFieldEnum] + + + export const EventSignupScalarFieldEnum: { + id: 'id', + eventId: 'eventId', + guildId: 'guildId', + userId: 'userId', + createdAt: 'createdAt', + canceledAt: 'canceledAt' + }; + + export type EventSignupScalarFieldEnum = (typeof EventSignupScalarFieldEnum)[keyof typeof EventSignupScalarFieldEnum] + + + export const SortOrder: { + asc: 'asc', + desc: 'desc' + }; + + export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + + export const NullableJsonNullValueInput: { + DbNull: typeof DbNull, + JsonNull: typeof JsonNull + }; + + export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput] + + + export const JsonNullValueInput: { + JsonNull: typeof JsonNull + }; + + export type JsonNullValueInput = (typeof JsonNullValueInput)[keyof typeof JsonNullValueInput] + + + export const QueryMode: { + default: 'default', + insensitive: 'insensitive' + }; + + export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + + export const JsonNullValueFilter: { + DbNull: typeof DbNull, + JsonNull: typeof JsonNull, + AnyNull: typeof AnyNull + }; + + export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter] + + + export const NullsOrder: { + first: 'first', + last: 'last' + }; + + export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + + + /** + * Field references + */ + + + /** + * Reference to a field of type 'String' + */ + export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String'> + + + + /** + * Reference to a field of type 'String[]' + */ + export type ListStringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String[]'> + + + + /** + * Reference to a field of type 'Boolean' + */ + export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'> + + + + /** + * Reference to a field of type 'Json' + */ + export type JsonFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Json'> + + + + /** + * Reference to a field of type 'DateTime' + */ + export type DateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime'> + + + + /** + * Reference to a field of type 'DateTime[]' + */ + export type ListDateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime[]'> + + + + /** + * Reference to a field of type 'Int' + */ + export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> + + + + /** + * Reference to a field of type 'Int[]' + */ + export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int[]'> + + + + /** + * Reference to a field of type 'Float' + */ + export type FloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float'> + + + + /** + * Reference to a field of type 'Float[]' + */ + export type ListFloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float[]'> + + /** + * Deep Input Types + */ + + + export type GuildSettingsWhereInput = { + AND?: GuildSettingsWhereInput | GuildSettingsWhereInput[] + OR?: GuildSettingsWhereInput[] + NOT?: GuildSettingsWhereInput | GuildSettingsWhereInput[] + guildId?: StringFilter<"GuildSettings"> | string + welcomeChannelId?: StringNullableFilter<"GuildSettings"> | string | null + logChannelId?: StringNullableFilter<"GuildSettings"> | string | null + automodEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + automodConfig?: JsonNullableFilter<"GuildSettings"> + levelingEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + ticketsEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + musicEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + statuspageEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + statuspageConfig?: JsonNullableFilter<"GuildSettings"> + dynamicVoiceEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + dynamicVoiceConfig?: JsonNullableFilter<"GuildSettings"> + supportLoginConfig?: JsonNullableFilter<"GuildSettings"> + birthdayEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + birthdayConfig?: JsonNullableFilter<"GuildSettings"> + reactionRolesEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + reactionRolesConfig?: JsonNullableFilter<"GuildSettings"> + eventsEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + supportRoleId?: StringNullableFilter<"GuildSettings"> | string | null + updatedAt?: DateTimeFilter<"GuildSettings"> | Date | string + createdAt?: DateTimeFilter<"GuildSettings"> | Date | string + } + + export type GuildSettingsOrderByWithRelationInput = { + guildId?: SortOrder + welcomeChannelId?: SortOrderInput | SortOrder + logChannelId?: SortOrderInput | SortOrder + automodEnabled?: SortOrderInput | SortOrder + automodConfig?: SortOrderInput | SortOrder + levelingEnabled?: SortOrderInput | SortOrder + ticketsEnabled?: SortOrderInput | SortOrder + musicEnabled?: SortOrderInput | SortOrder + statuspageEnabled?: SortOrderInput | SortOrder + statuspageConfig?: SortOrderInput | SortOrder + dynamicVoiceEnabled?: SortOrderInput | SortOrder + dynamicVoiceConfig?: SortOrderInput | SortOrder + supportLoginConfig?: SortOrderInput | SortOrder + birthdayEnabled?: SortOrderInput | SortOrder + birthdayConfig?: SortOrderInput | SortOrder + reactionRolesEnabled?: SortOrderInput | SortOrder + reactionRolesConfig?: SortOrderInput | SortOrder + eventsEnabled?: SortOrderInput | SortOrder + supportRoleId?: SortOrderInput | SortOrder + updatedAt?: SortOrder + createdAt?: SortOrder + } + + export type GuildSettingsWhereUniqueInput = Prisma.AtLeast<{ + guildId?: string + AND?: GuildSettingsWhereInput | GuildSettingsWhereInput[] + OR?: GuildSettingsWhereInput[] + NOT?: GuildSettingsWhereInput | GuildSettingsWhereInput[] + welcomeChannelId?: StringNullableFilter<"GuildSettings"> | string | null + logChannelId?: StringNullableFilter<"GuildSettings"> | string | null + automodEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + automodConfig?: JsonNullableFilter<"GuildSettings"> + levelingEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + ticketsEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + musicEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + statuspageEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + statuspageConfig?: JsonNullableFilter<"GuildSettings"> + dynamicVoiceEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + dynamicVoiceConfig?: JsonNullableFilter<"GuildSettings"> + supportLoginConfig?: JsonNullableFilter<"GuildSettings"> + birthdayEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + birthdayConfig?: JsonNullableFilter<"GuildSettings"> + reactionRolesEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + reactionRolesConfig?: JsonNullableFilter<"GuildSettings"> + eventsEnabled?: BoolNullableFilter<"GuildSettings"> | boolean | null + supportRoleId?: StringNullableFilter<"GuildSettings"> | string | null + updatedAt?: DateTimeFilter<"GuildSettings"> | Date | string + createdAt?: DateTimeFilter<"GuildSettings"> | Date | string + }, "guildId"> + + export type GuildSettingsOrderByWithAggregationInput = { + guildId?: SortOrder + welcomeChannelId?: SortOrderInput | SortOrder + logChannelId?: SortOrderInput | SortOrder + automodEnabled?: SortOrderInput | SortOrder + automodConfig?: SortOrderInput | SortOrder + levelingEnabled?: SortOrderInput | SortOrder + ticketsEnabled?: SortOrderInput | SortOrder + musicEnabled?: SortOrderInput | SortOrder + statuspageEnabled?: SortOrderInput | SortOrder + statuspageConfig?: SortOrderInput | SortOrder + dynamicVoiceEnabled?: SortOrderInput | SortOrder + dynamicVoiceConfig?: SortOrderInput | SortOrder + supportLoginConfig?: SortOrderInput | SortOrder + birthdayEnabled?: SortOrderInput | SortOrder + birthdayConfig?: SortOrderInput | SortOrder + reactionRolesEnabled?: SortOrderInput | SortOrder + reactionRolesConfig?: SortOrderInput | SortOrder + eventsEnabled?: SortOrderInput | SortOrder + supportRoleId?: SortOrderInput | SortOrder + updatedAt?: SortOrder + createdAt?: SortOrder + _count?: GuildSettingsCountOrderByAggregateInput + _max?: GuildSettingsMaxOrderByAggregateInput + _min?: GuildSettingsMinOrderByAggregateInput + } + + export type GuildSettingsScalarWhereWithAggregatesInput = { + AND?: GuildSettingsScalarWhereWithAggregatesInput | GuildSettingsScalarWhereWithAggregatesInput[] + OR?: GuildSettingsScalarWhereWithAggregatesInput[] + NOT?: GuildSettingsScalarWhereWithAggregatesInput | GuildSettingsScalarWhereWithAggregatesInput[] + guildId?: StringWithAggregatesFilter<"GuildSettings"> | string + welcomeChannelId?: StringNullableWithAggregatesFilter<"GuildSettings"> | string | null + logChannelId?: StringNullableWithAggregatesFilter<"GuildSettings"> | string | null + automodEnabled?: BoolNullableWithAggregatesFilter<"GuildSettings"> | boolean | null + automodConfig?: JsonNullableWithAggregatesFilter<"GuildSettings"> + levelingEnabled?: BoolNullableWithAggregatesFilter<"GuildSettings"> | boolean | null + ticketsEnabled?: BoolNullableWithAggregatesFilter<"GuildSettings"> | boolean | null + musicEnabled?: BoolNullableWithAggregatesFilter<"GuildSettings"> | boolean | null + statuspageEnabled?: BoolNullableWithAggregatesFilter<"GuildSettings"> | boolean | null + statuspageConfig?: JsonNullableWithAggregatesFilter<"GuildSettings"> + dynamicVoiceEnabled?: BoolNullableWithAggregatesFilter<"GuildSettings"> | boolean | null + dynamicVoiceConfig?: JsonNullableWithAggregatesFilter<"GuildSettings"> + supportLoginConfig?: JsonNullableWithAggregatesFilter<"GuildSettings"> + birthdayEnabled?: BoolNullableWithAggregatesFilter<"GuildSettings"> | boolean | null + birthdayConfig?: JsonNullableWithAggregatesFilter<"GuildSettings"> + reactionRolesEnabled?: BoolNullableWithAggregatesFilter<"GuildSettings"> | boolean | null + reactionRolesConfig?: JsonNullableWithAggregatesFilter<"GuildSettings"> + eventsEnabled?: BoolNullableWithAggregatesFilter<"GuildSettings"> | boolean | null + supportRoleId?: StringNullableWithAggregatesFilter<"GuildSettings"> | string | null + updatedAt?: DateTimeWithAggregatesFilter<"GuildSettings"> | Date | string + createdAt?: DateTimeWithAggregatesFilter<"GuildSettings"> | Date | string + } + + export type TicketWhereInput = { + AND?: TicketWhereInput | TicketWhereInput[] + OR?: TicketWhereInput[] + NOT?: TicketWhereInput | TicketWhereInput[] + id?: StringFilter<"Ticket"> | string + ticketNumber?: IntFilter<"Ticket"> | number + userId?: StringFilter<"Ticket"> | string + channelId?: StringFilter<"Ticket"> | string + guildId?: StringFilter<"Ticket"> | string + topic?: StringNullableFilter<"Ticket"> | string | null + priority?: StringFilter<"Ticket"> | string + status?: StringFilter<"Ticket"> | string + claimedBy?: StringNullableFilter<"Ticket"> | string | null + transcript?: StringNullableFilter<"Ticket"> | string | null + createdAt?: DateTimeFilter<"Ticket"> | Date | string + updatedAt?: DateTimeFilter<"Ticket"> | Date | string + } + + export type TicketOrderByWithRelationInput = { + id?: SortOrder + ticketNumber?: SortOrder + userId?: SortOrder + channelId?: SortOrder + guildId?: SortOrder + topic?: SortOrderInput | SortOrder + priority?: SortOrder + status?: SortOrder + claimedBy?: SortOrderInput | SortOrder + transcript?: SortOrderInput | SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type TicketWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: TicketWhereInput | TicketWhereInput[] + OR?: TicketWhereInput[] + NOT?: TicketWhereInput | TicketWhereInput[] + ticketNumber?: IntFilter<"Ticket"> | number + userId?: StringFilter<"Ticket"> | string + channelId?: StringFilter<"Ticket"> | string + guildId?: StringFilter<"Ticket"> | string + topic?: StringNullableFilter<"Ticket"> | string | null + priority?: StringFilter<"Ticket"> | string + status?: StringFilter<"Ticket"> | string + claimedBy?: StringNullableFilter<"Ticket"> | string | null + transcript?: StringNullableFilter<"Ticket"> | string | null + createdAt?: DateTimeFilter<"Ticket"> | Date | string + updatedAt?: DateTimeFilter<"Ticket"> | Date | string + }, "id"> + + export type TicketOrderByWithAggregationInput = { + id?: SortOrder + ticketNumber?: SortOrder + userId?: SortOrder + channelId?: SortOrder + guildId?: SortOrder + topic?: SortOrderInput | SortOrder + priority?: SortOrder + status?: SortOrder + claimedBy?: SortOrderInput | SortOrder + transcript?: SortOrderInput | SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + _count?: TicketCountOrderByAggregateInput + _avg?: TicketAvgOrderByAggregateInput + _max?: TicketMaxOrderByAggregateInput + _min?: TicketMinOrderByAggregateInput + _sum?: TicketSumOrderByAggregateInput + } + + export type TicketScalarWhereWithAggregatesInput = { + AND?: TicketScalarWhereWithAggregatesInput | TicketScalarWhereWithAggregatesInput[] + OR?: TicketScalarWhereWithAggregatesInput[] + NOT?: TicketScalarWhereWithAggregatesInput | TicketScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"Ticket"> | string + ticketNumber?: IntWithAggregatesFilter<"Ticket"> | number + userId?: StringWithAggregatesFilter<"Ticket"> | string + channelId?: StringWithAggregatesFilter<"Ticket"> | string + guildId?: StringWithAggregatesFilter<"Ticket"> | string + topic?: StringNullableWithAggregatesFilter<"Ticket"> | string | null + priority?: StringWithAggregatesFilter<"Ticket"> | string + status?: StringWithAggregatesFilter<"Ticket"> | string + claimedBy?: StringNullableWithAggregatesFilter<"Ticket"> | string | null + transcript?: StringNullableWithAggregatesFilter<"Ticket"> | string | null + createdAt?: DateTimeWithAggregatesFilter<"Ticket"> | Date | string + updatedAt?: DateTimeWithAggregatesFilter<"Ticket"> | Date | string + } + + export type LevelWhereInput = { + AND?: LevelWhereInput | LevelWhereInput[] + OR?: LevelWhereInput[] + NOT?: LevelWhereInput | LevelWhereInput[] + id?: StringFilter<"Level"> | string + userId?: StringFilter<"Level"> | string + guildId?: StringFilter<"Level"> | string + xp?: IntFilter<"Level"> | number + level?: IntFilter<"Level"> | number + createdAt?: DateTimeFilter<"Level"> | Date | string + updatedAt?: DateTimeFilter<"Level"> | Date | string + } + + export type LevelOrderByWithRelationInput = { + id?: SortOrder + userId?: SortOrder + guildId?: SortOrder + xp?: SortOrder + level?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type LevelWhereUniqueInput = Prisma.AtLeast<{ + id?: string + userId_guildId?: LevelUserId_guildIdCompoundUniqueInput + AND?: LevelWhereInput | LevelWhereInput[] + OR?: LevelWhereInput[] + NOT?: LevelWhereInput | LevelWhereInput[] + userId?: StringFilter<"Level"> | string + guildId?: StringFilter<"Level"> | string + xp?: IntFilter<"Level"> | number + level?: IntFilter<"Level"> | number + createdAt?: DateTimeFilter<"Level"> | Date | string + updatedAt?: DateTimeFilter<"Level"> | Date | string + }, "id" | "userId_guildId"> + + export type LevelOrderByWithAggregationInput = { + id?: SortOrder + userId?: SortOrder + guildId?: SortOrder + xp?: SortOrder + level?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + _count?: LevelCountOrderByAggregateInput + _avg?: LevelAvgOrderByAggregateInput + _max?: LevelMaxOrderByAggregateInput + _min?: LevelMinOrderByAggregateInput + _sum?: LevelSumOrderByAggregateInput + } + + export type LevelScalarWhereWithAggregatesInput = { + AND?: LevelScalarWhereWithAggregatesInput | LevelScalarWhereWithAggregatesInput[] + OR?: LevelScalarWhereWithAggregatesInput[] + NOT?: LevelScalarWhereWithAggregatesInput | LevelScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"Level"> | string + userId?: StringWithAggregatesFilter<"Level"> | string + guildId?: StringWithAggregatesFilter<"Level"> | string + xp?: IntWithAggregatesFilter<"Level"> | number + level?: IntWithAggregatesFilter<"Level"> | number + createdAt?: DateTimeWithAggregatesFilter<"Level"> | Date | string + updatedAt?: DateTimeWithAggregatesFilter<"Level"> | Date | string + } + + export type TicketSupportSessionWhereInput = { + AND?: TicketSupportSessionWhereInput | TicketSupportSessionWhereInput[] + OR?: TicketSupportSessionWhereInput[] + NOT?: TicketSupportSessionWhereInput | TicketSupportSessionWhereInput[] + id?: StringFilter<"TicketSupportSession"> | string + guildId?: StringFilter<"TicketSupportSession"> | string + userId?: StringFilter<"TicketSupportSession"> | string + roleId?: StringFilter<"TicketSupportSession"> | string + startedAt?: DateTimeFilter<"TicketSupportSession"> | Date | string + endedAt?: DateTimeNullableFilter<"TicketSupportSession"> | Date | string | null + durationSeconds?: IntNullableFilter<"TicketSupportSession"> | number | null + } + + export type TicketSupportSessionOrderByWithRelationInput = { + id?: SortOrder + guildId?: SortOrder + userId?: SortOrder + roleId?: SortOrder + startedAt?: SortOrder + endedAt?: SortOrderInput | SortOrder + durationSeconds?: SortOrderInput | SortOrder + } + + export type TicketSupportSessionWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: TicketSupportSessionWhereInput | TicketSupportSessionWhereInput[] + OR?: TicketSupportSessionWhereInput[] + NOT?: TicketSupportSessionWhereInput | TicketSupportSessionWhereInput[] + guildId?: StringFilter<"TicketSupportSession"> | string + userId?: StringFilter<"TicketSupportSession"> | string + roleId?: StringFilter<"TicketSupportSession"> | string + startedAt?: DateTimeFilter<"TicketSupportSession"> | Date | string + endedAt?: DateTimeNullableFilter<"TicketSupportSession"> | Date | string | null + durationSeconds?: IntNullableFilter<"TicketSupportSession"> | number | null + }, "id"> + + export type TicketSupportSessionOrderByWithAggregationInput = { + id?: SortOrder + guildId?: SortOrder + userId?: SortOrder + roleId?: SortOrder + startedAt?: SortOrder + endedAt?: SortOrderInput | SortOrder + durationSeconds?: SortOrderInput | SortOrder + _count?: TicketSupportSessionCountOrderByAggregateInput + _avg?: TicketSupportSessionAvgOrderByAggregateInput + _max?: TicketSupportSessionMaxOrderByAggregateInput + _min?: TicketSupportSessionMinOrderByAggregateInput + _sum?: TicketSupportSessionSumOrderByAggregateInput + } + + export type TicketSupportSessionScalarWhereWithAggregatesInput = { + AND?: TicketSupportSessionScalarWhereWithAggregatesInput | TicketSupportSessionScalarWhereWithAggregatesInput[] + OR?: TicketSupportSessionScalarWhereWithAggregatesInput[] + NOT?: TicketSupportSessionScalarWhereWithAggregatesInput | TicketSupportSessionScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"TicketSupportSession"> | string + guildId?: StringWithAggregatesFilter<"TicketSupportSession"> | string + userId?: StringWithAggregatesFilter<"TicketSupportSession"> | string + roleId?: StringWithAggregatesFilter<"TicketSupportSession"> | string + startedAt?: DateTimeWithAggregatesFilter<"TicketSupportSession"> | Date | string + endedAt?: DateTimeNullableWithAggregatesFilter<"TicketSupportSession"> | Date | string | null + durationSeconds?: IntNullableWithAggregatesFilter<"TicketSupportSession"> | number | null + } + + export type BirthdayWhereInput = { + AND?: BirthdayWhereInput | BirthdayWhereInput[] + OR?: BirthdayWhereInput[] + NOT?: BirthdayWhereInput | BirthdayWhereInput[] + id?: StringFilter<"Birthday"> | string + userId?: StringFilter<"Birthday"> | string + guildId?: StringFilter<"Birthday"> | string + birthDate?: StringFilter<"Birthday"> | string + createdAt?: DateTimeFilter<"Birthday"> | Date | string + updatedAt?: DateTimeFilter<"Birthday"> | Date | string + } + + export type BirthdayOrderByWithRelationInput = { + id?: SortOrder + userId?: SortOrder + guildId?: SortOrder + birthDate?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type BirthdayWhereUniqueInput = Prisma.AtLeast<{ + id?: string + birthday_user_guild?: BirthdayBirthday_user_guildCompoundUniqueInput + AND?: BirthdayWhereInput | BirthdayWhereInput[] + OR?: BirthdayWhereInput[] + NOT?: BirthdayWhereInput | BirthdayWhereInput[] + userId?: StringFilter<"Birthday"> | string + guildId?: StringFilter<"Birthday"> | string + birthDate?: StringFilter<"Birthday"> | string + createdAt?: DateTimeFilter<"Birthday"> | Date | string + updatedAt?: DateTimeFilter<"Birthday"> | Date | string + }, "id" | "birthday_user_guild"> + + export type BirthdayOrderByWithAggregationInput = { + id?: SortOrder + userId?: SortOrder + guildId?: SortOrder + birthDate?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + _count?: BirthdayCountOrderByAggregateInput + _max?: BirthdayMaxOrderByAggregateInput + _min?: BirthdayMinOrderByAggregateInput + } + + export type BirthdayScalarWhereWithAggregatesInput = { + AND?: BirthdayScalarWhereWithAggregatesInput | BirthdayScalarWhereWithAggregatesInput[] + OR?: BirthdayScalarWhereWithAggregatesInput[] + NOT?: BirthdayScalarWhereWithAggregatesInput | BirthdayScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"Birthday"> | string + userId?: StringWithAggregatesFilter<"Birthday"> | string + guildId?: StringWithAggregatesFilter<"Birthday"> | string + birthDate?: StringWithAggregatesFilter<"Birthday"> | string + createdAt?: DateTimeWithAggregatesFilter<"Birthday"> | Date | string + updatedAt?: DateTimeWithAggregatesFilter<"Birthday"> | Date | string + } + + export type ReactionRoleSetWhereInput = { + AND?: ReactionRoleSetWhereInput | ReactionRoleSetWhereInput[] + OR?: ReactionRoleSetWhereInput[] + NOT?: ReactionRoleSetWhereInput | ReactionRoleSetWhereInput[] + id?: StringFilter<"ReactionRoleSet"> | string + guildId?: StringFilter<"ReactionRoleSet"> | string + channelId?: StringFilter<"ReactionRoleSet"> | string + messageId?: StringNullableFilter<"ReactionRoleSet"> | string | null + title?: StringNullableFilter<"ReactionRoleSet"> | string | null + description?: StringNullableFilter<"ReactionRoleSet"> | string | null + entries?: JsonFilter<"ReactionRoleSet"> + createdAt?: DateTimeFilter<"ReactionRoleSet"> | Date | string + updatedAt?: DateTimeFilter<"ReactionRoleSet"> | Date | string + } + + export type ReactionRoleSetOrderByWithRelationInput = { + id?: SortOrder + guildId?: SortOrder + channelId?: SortOrder + messageId?: SortOrderInput | SortOrder + title?: SortOrderInput | SortOrder + description?: SortOrderInput | SortOrder + entries?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type ReactionRoleSetWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: ReactionRoleSetWhereInput | ReactionRoleSetWhereInput[] + OR?: ReactionRoleSetWhereInput[] + NOT?: ReactionRoleSetWhereInput | ReactionRoleSetWhereInput[] + guildId?: StringFilter<"ReactionRoleSet"> | string + channelId?: StringFilter<"ReactionRoleSet"> | string + messageId?: StringNullableFilter<"ReactionRoleSet"> | string | null + title?: StringNullableFilter<"ReactionRoleSet"> | string | null + description?: StringNullableFilter<"ReactionRoleSet"> | string | null + entries?: JsonFilter<"ReactionRoleSet"> + createdAt?: DateTimeFilter<"ReactionRoleSet"> | Date | string + updatedAt?: DateTimeFilter<"ReactionRoleSet"> | Date | string + }, "id"> + + export type ReactionRoleSetOrderByWithAggregationInput = { + id?: SortOrder + guildId?: SortOrder + channelId?: SortOrder + messageId?: SortOrderInput | SortOrder + title?: SortOrderInput | SortOrder + description?: SortOrderInput | SortOrder + entries?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + _count?: ReactionRoleSetCountOrderByAggregateInput + _max?: ReactionRoleSetMaxOrderByAggregateInput + _min?: ReactionRoleSetMinOrderByAggregateInput + } + + export type ReactionRoleSetScalarWhereWithAggregatesInput = { + AND?: ReactionRoleSetScalarWhereWithAggregatesInput | ReactionRoleSetScalarWhereWithAggregatesInput[] + OR?: ReactionRoleSetScalarWhereWithAggregatesInput[] + NOT?: ReactionRoleSetScalarWhereWithAggregatesInput | ReactionRoleSetScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"ReactionRoleSet"> | string + guildId?: StringWithAggregatesFilter<"ReactionRoleSet"> | string + channelId?: StringWithAggregatesFilter<"ReactionRoleSet"> | string + messageId?: StringNullableWithAggregatesFilter<"ReactionRoleSet"> | string | null + title?: StringNullableWithAggregatesFilter<"ReactionRoleSet"> | string | null + description?: StringNullableWithAggregatesFilter<"ReactionRoleSet"> | string | null + entries?: JsonWithAggregatesFilter<"ReactionRoleSet"> + createdAt?: DateTimeWithAggregatesFilter<"ReactionRoleSet"> | Date | string + updatedAt?: DateTimeWithAggregatesFilter<"ReactionRoleSet"> | Date | string + } + + export type EventWhereInput = { + AND?: EventWhereInput | EventWhereInput[] + OR?: EventWhereInput[] + NOT?: EventWhereInput | EventWhereInput[] + id?: StringFilter<"Event"> | string + guildId?: StringFilter<"Event"> | string + title?: StringFilter<"Event"> | string + description?: StringNullableFilter<"Event"> | string | null + channelId?: StringFilter<"Event"> | string + startTime?: DateTimeFilter<"Event"> | Date | string + repeatType?: StringFilter<"Event"> | string + repeatConfig?: JsonNullableFilter<"Event"> + reminderOffsetMinutes?: IntFilter<"Event"> | number + roleId?: StringNullableFilter<"Event"> | string | null + isActive?: BoolFilter<"Event"> | boolean + lastReminderAt?: DateTimeNullableFilter<"Event"> | Date | string | null + createdAt?: DateTimeFilter<"Event"> | Date | string + updatedAt?: DateTimeFilter<"Event"> | Date | string + signups?: EventSignupListRelationFilter + } + + export type EventOrderByWithRelationInput = { + id?: SortOrder + guildId?: SortOrder + title?: SortOrder + description?: SortOrderInput | SortOrder + channelId?: SortOrder + startTime?: SortOrder + repeatType?: SortOrder + repeatConfig?: SortOrderInput | SortOrder + reminderOffsetMinutes?: SortOrder + roleId?: SortOrderInput | SortOrder + isActive?: SortOrder + lastReminderAt?: SortOrderInput | SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + signups?: EventSignupOrderByRelationAggregateInput + } + + export type EventWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: EventWhereInput | EventWhereInput[] + OR?: EventWhereInput[] + NOT?: EventWhereInput | EventWhereInput[] + guildId?: StringFilter<"Event"> | string + title?: StringFilter<"Event"> | string + description?: StringNullableFilter<"Event"> | string | null + channelId?: StringFilter<"Event"> | string + startTime?: DateTimeFilter<"Event"> | Date | string + repeatType?: StringFilter<"Event"> | string + repeatConfig?: JsonNullableFilter<"Event"> + reminderOffsetMinutes?: IntFilter<"Event"> | number + roleId?: StringNullableFilter<"Event"> | string | null + isActive?: BoolFilter<"Event"> | boolean + lastReminderAt?: DateTimeNullableFilter<"Event"> | Date | string | null + createdAt?: DateTimeFilter<"Event"> | Date | string + updatedAt?: DateTimeFilter<"Event"> | Date | string + signups?: EventSignupListRelationFilter + }, "id"> + + export type EventOrderByWithAggregationInput = { + id?: SortOrder + guildId?: SortOrder + title?: SortOrder + description?: SortOrderInput | SortOrder + channelId?: SortOrder + startTime?: SortOrder + repeatType?: SortOrder + repeatConfig?: SortOrderInput | SortOrder + reminderOffsetMinutes?: SortOrder + roleId?: SortOrderInput | SortOrder + isActive?: SortOrder + lastReminderAt?: SortOrderInput | SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + _count?: EventCountOrderByAggregateInput + _avg?: EventAvgOrderByAggregateInput + _max?: EventMaxOrderByAggregateInput + _min?: EventMinOrderByAggregateInput + _sum?: EventSumOrderByAggregateInput + } + + export type EventScalarWhereWithAggregatesInput = { + AND?: EventScalarWhereWithAggregatesInput | EventScalarWhereWithAggregatesInput[] + OR?: EventScalarWhereWithAggregatesInput[] + NOT?: EventScalarWhereWithAggregatesInput | EventScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"Event"> | string + guildId?: StringWithAggregatesFilter<"Event"> | string + title?: StringWithAggregatesFilter<"Event"> | string + description?: StringNullableWithAggregatesFilter<"Event"> | string | null + channelId?: StringWithAggregatesFilter<"Event"> | string + startTime?: DateTimeWithAggregatesFilter<"Event"> | Date | string + repeatType?: StringWithAggregatesFilter<"Event"> | string + repeatConfig?: JsonNullableWithAggregatesFilter<"Event"> + reminderOffsetMinutes?: IntWithAggregatesFilter<"Event"> | number + roleId?: StringNullableWithAggregatesFilter<"Event"> | string | null + isActive?: BoolWithAggregatesFilter<"Event"> | boolean + lastReminderAt?: DateTimeNullableWithAggregatesFilter<"Event"> | Date | string | null + createdAt?: DateTimeWithAggregatesFilter<"Event"> | Date | string + updatedAt?: DateTimeWithAggregatesFilter<"Event"> | Date | string + } + + export type EventSignupWhereInput = { + AND?: EventSignupWhereInput | EventSignupWhereInput[] + OR?: EventSignupWhereInput[] + NOT?: EventSignupWhereInput | EventSignupWhereInput[] + id?: StringFilter<"EventSignup"> | string + eventId?: StringFilter<"EventSignup"> | string + guildId?: StringFilter<"EventSignup"> | string + userId?: StringFilter<"EventSignup"> | string + createdAt?: DateTimeFilter<"EventSignup"> | Date | string + canceledAt?: DateTimeNullableFilter<"EventSignup"> | Date | string | null + event?: XOR + } + + export type EventSignupOrderByWithRelationInput = { + id?: SortOrder + eventId?: SortOrder + guildId?: SortOrder + userId?: SortOrder + createdAt?: SortOrder + canceledAt?: SortOrderInput | SortOrder + event?: EventOrderByWithRelationInput + } + + export type EventSignupWhereUniqueInput = Prisma.AtLeast<{ + id?: string + eventId_userId?: EventSignupEventIdUserIdCompoundUniqueInput + AND?: EventSignupWhereInput | EventSignupWhereInput[] + OR?: EventSignupWhereInput[] + NOT?: EventSignupWhereInput | EventSignupWhereInput[] + eventId?: StringFilter<"EventSignup"> | string + guildId?: StringFilter<"EventSignup"> | string + userId?: StringFilter<"EventSignup"> | string + createdAt?: DateTimeFilter<"EventSignup"> | Date | string + canceledAt?: DateTimeNullableFilter<"EventSignup"> | Date | string | null + event?: XOR + }, "id" | "eventId_userId"> + + export type EventSignupOrderByWithAggregationInput = { + id?: SortOrder + eventId?: SortOrder + guildId?: SortOrder + userId?: SortOrder + createdAt?: SortOrder + canceledAt?: SortOrderInput | SortOrder + _count?: EventSignupCountOrderByAggregateInput + _max?: EventSignupMaxOrderByAggregateInput + _min?: EventSignupMinOrderByAggregateInput + } + + export type EventSignupScalarWhereWithAggregatesInput = { + AND?: EventSignupScalarWhereWithAggregatesInput | EventSignupScalarWhereWithAggregatesInput[] + OR?: EventSignupScalarWhereWithAggregatesInput[] + NOT?: EventSignupScalarWhereWithAggregatesInput | EventSignupScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"EventSignup"> | string + eventId?: StringWithAggregatesFilter<"EventSignup"> | string + guildId?: StringWithAggregatesFilter<"EventSignup"> | string + userId?: StringWithAggregatesFilter<"EventSignup"> | string + createdAt?: DateTimeWithAggregatesFilter<"EventSignup"> | Date | string + canceledAt?: DateTimeNullableWithAggregatesFilter<"EventSignup"> | Date | string | null + } + + export type GuildSettingsCreateInput = { + guildId: string + welcomeChannelId?: string | null + logChannelId?: string | null + automodEnabled?: boolean | null + automodConfig?: NullableJsonNullValueInput | InputJsonValue + levelingEnabled?: boolean | null + ticketsEnabled?: boolean | null + musicEnabled?: boolean | null + statuspageEnabled?: boolean | null + statuspageConfig?: NullableJsonNullValueInput | InputJsonValue + dynamicVoiceEnabled?: boolean | null + dynamicVoiceConfig?: NullableJsonNullValueInput | InputJsonValue + supportLoginConfig?: NullableJsonNullValueInput | InputJsonValue + birthdayEnabled?: boolean | null + birthdayConfig?: NullableJsonNullValueInput | InputJsonValue + reactionRolesEnabled?: boolean | null + reactionRolesConfig?: NullableJsonNullValueInput | InputJsonValue + eventsEnabled?: boolean | null + supportRoleId?: string | null + updatedAt?: Date | string + createdAt?: Date | string + } + + export type GuildSettingsUncheckedCreateInput = { + guildId: string + welcomeChannelId?: string | null + logChannelId?: string | null + automodEnabled?: boolean | null + automodConfig?: NullableJsonNullValueInput | InputJsonValue + levelingEnabled?: boolean | null + ticketsEnabled?: boolean | null + musicEnabled?: boolean | null + statuspageEnabled?: boolean | null + statuspageConfig?: NullableJsonNullValueInput | InputJsonValue + dynamicVoiceEnabled?: boolean | null + dynamicVoiceConfig?: NullableJsonNullValueInput | InputJsonValue + supportLoginConfig?: NullableJsonNullValueInput | InputJsonValue + birthdayEnabled?: boolean | null + birthdayConfig?: NullableJsonNullValueInput | InputJsonValue + reactionRolesEnabled?: boolean | null + reactionRolesConfig?: NullableJsonNullValueInput | InputJsonValue + eventsEnabled?: boolean | null + supportRoleId?: string | null + updatedAt?: Date | string + createdAt?: Date | string + } + + export type GuildSettingsUpdateInput = { + guildId?: StringFieldUpdateOperationsInput | string + welcomeChannelId?: NullableStringFieldUpdateOperationsInput | string | null + logChannelId?: NullableStringFieldUpdateOperationsInput | string | null + automodEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + automodConfig?: NullableJsonNullValueInput | InputJsonValue + levelingEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + ticketsEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + musicEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + statuspageEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + statuspageConfig?: NullableJsonNullValueInput | InputJsonValue + dynamicVoiceEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + dynamicVoiceConfig?: NullableJsonNullValueInput | InputJsonValue + supportLoginConfig?: NullableJsonNullValueInput | InputJsonValue + birthdayEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + birthdayConfig?: NullableJsonNullValueInput | InputJsonValue + reactionRolesEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + reactionRolesConfig?: NullableJsonNullValueInput | InputJsonValue + eventsEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + supportRoleId?: NullableStringFieldUpdateOperationsInput | string | null + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type GuildSettingsUncheckedUpdateInput = { + guildId?: StringFieldUpdateOperationsInput | string + welcomeChannelId?: NullableStringFieldUpdateOperationsInput | string | null + logChannelId?: NullableStringFieldUpdateOperationsInput | string | null + automodEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + automodConfig?: NullableJsonNullValueInput | InputJsonValue + levelingEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + ticketsEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + musicEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + statuspageEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + statuspageConfig?: NullableJsonNullValueInput | InputJsonValue + dynamicVoiceEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + dynamicVoiceConfig?: NullableJsonNullValueInput | InputJsonValue + supportLoginConfig?: NullableJsonNullValueInput | InputJsonValue + birthdayEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + birthdayConfig?: NullableJsonNullValueInput | InputJsonValue + reactionRolesEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + reactionRolesConfig?: NullableJsonNullValueInput | InputJsonValue + eventsEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + supportRoleId?: NullableStringFieldUpdateOperationsInput | string | null + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type GuildSettingsCreateManyInput = { + guildId: string + welcomeChannelId?: string | null + logChannelId?: string | null + automodEnabled?: boolean | null + automodConfig?: NullableJsonNullValueInput | InputJsonValue + levelingEnabled?: boolean | null + ticketsEnabled?: boolean | null + musicEnabled?: boolean | null + statuspageEnabled?: boolean | null + statuspageConfig?: NullableJsonNullValueInput | InputJsonValue + dynamicVoiceEnabled?: boolean | null + dynamicVoiceConfig?: NullableJsonNullValueInput | InputJsonValue + supportLoginConfig?: NullableJsonNullValueInput | InputJsonValue + birthdayEnabled?: boolean | null + birthdayConfig?: NullableJsonNullValueInput | InputJsonValue + reactionRolesEnabled?: boolean | null + reactionRolesConfig?: NullableJsonNullValueInput | InputJsonValue + eventsEnabled?: boolean | null + supportRoleId?: string | null + updatedAt?: Date | string + createdAt?: Date | string + } + + export type GuildSettingsUpdateManyMutationInput = { + guildId?: StringFieldUpdateOperationsInput | string + welcomeChannelId?: NullableStringFieldUpdateOperationsInput | string | null + logChannelId?: NullableStringFieldUpdateOperationsInput | string | null + automodEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + automodConfig?: NullableJsonNullValueInput | InputJsonValue + levelingEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + ticketsEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + musicEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + statuspageEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + statuspageConfig?: NullableJsonNullValueInput | InputJsonValue + dynamicVoiceEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + dynamicVoiceConfig?: NullableJsonNullValueInput | InputJsonValue + supportLoginConfig?: NullableJsonNullValueInput | InputJsonValue + birthdayEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + birthdayConfig?: NullableJsonNullValueInput | InputJsonValue + reactionRolesEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + reactionRolesConfig?: NullableJsonNullValueInput | InputJsonValue + eventsEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + supportRoleId?: NullableStringFieldUpdateOperationsInput | string | null + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type GuildSettingsUncheckedUpdateManyInput = { + guildId?: StringFieldUpdateOperationsInput | string + welcomeChannelId?: NullableStringFieldUpdateOperationsInput | string | null + logChannelId?: NullableStringFieldUpdateOperationsInput | string | null + automodEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + automodConfig?: NullableJsonNullValueInput | InputJsonValue + levelingEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + ticketsEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + musicEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + statuspageEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + statuspageConfig?: NullableJsonNullValueInput | InputJsonValue + dynamicVoiceEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + dynamicVoiceConfig?: NullableJsonNullValueInput | InputJsonValue + supportLoginConfig?: NullableJsonNullValueInput | InputJsonValue + birthdayEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + birthdayConfig?: NullableJsonNullValueInput | InputJsonValue + reactionRolesEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + reactionRolesConfig?: NullableJsonNullValueInput | InputJsonValue + eventsEnabled?: NullableBoolFieldUpdateOperationsInput | boolean | null + supportRoleId?: NullableStringFieldUpdateOperationsInput | string | null + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type TicketCreateInput = { + id?: string + ticketNumber?: number + userId: string + channelId: string + guildId: string + topic?: string | null + priority?: string + status: string + claimedBy?: string | null + transcript?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type TicketUncheckedCreateInput = { + id?: string + ticketNumber?: number + userId: string + channelId: string + guildId: string + topic?: string | null + priority?: string + status: string + claimedBy?: string | null + transcript?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type TicketUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + ticketNumber?: IntFieldUpdateOperationsInput | number + userId?: StringFieldUpdateOperationsInput | string + channelId?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + topic?: NullableStringFieldUpdateOperationsInput | string | null + priority?: StringFieldUpdateOperationsInput | string + status?: StringFieldUpdateOperationsInput | string + claimedBy?: NullableStringFieldUpdateOperationsInput | string | null + transcript?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type TicketUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + ticketNumber?: IntFieldUpdateOperationsInput | number + userId?: StringFieldUpdateOperationsInput | string + channelId?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + topic?: NullableStringFieldUpdateOperationsInput | string | null + priority?: StringFieldUpdateOperationsInput | string + status?: StringFieldUpdateOperationsInput | string + claimedBy?: NullableStringFieldUpdateOperationsInput | string | null + transcript?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type TicketCreateManyInput = { + id?: string + ticketNumber?: number + userId: string + channelId: string + guildId: string + topic?: string | null + priority?: string + status: string + claimedBy?: string | null + transcript?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type TicketUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + ticketNumber?: IntFieldUpdateOperationsInput | number + userId?: StringFieldUpdateOperationsInput | string + channelId?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + topic?: NullableStringFieldUpdateOperationsInput | string | null + priority?: StringFieldUpdateOperationsInput | string + status?: StringFieldUpdateOperationsInput | string + claimedBy?: NullableStringFieldUpdateOperationsInput | string | null + transcript?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type TicketUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + ticketNumber?: IntFieldUpdateOperationsInput | number + userId?: StringFieldUpdateOperationsInput | string + channelId?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + topic?: NullableStringFieldUpdateOperationsInput | string | null + priority?: StringFieldUpdateOperationsInput | string + status?: StringFieldUpdateOperationsInput | string + claimedBy?: NullableStringFieldUpdateOperationsInput | string | null + transcript?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type LevelCreateInput = { + id?: string + userId: string + guildId: string + xp?: number + level?: number + createdAt?: Date | string + updatedAt?: Date | string + } + + export type LevelUncheckedCreateInput = { + id?: string + userId: string + guildId: string + xp?: number + level?: number + createdAt?: Date | string + updatedAt?: Date | string + } + + export type LevelUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + xp?: IntFieldUpdateOperationsInput | number + level?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type LevelUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + xp?: IntFieldUpdateOperationsInput | number + level?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type LevelCreateManyInput = { + id?: string + userId: string + guildId: string + xp?: number + level?: number + createdAt?: Date | string + updatedAt?: Date | string + } + + export type LevelUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + xp?: IntFieldUpdateOperationsInput | number + level?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type LevelUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + xp?: IntFieldUpdateOperationsInput | number + level?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type TicketSupportSessionCreateInput = { + id?: string + guildId: string + userId: string + roleId: string + startedAt?: Date | string + endedAt?: Date | string | null + durationSeconds?: number | null + } + + export type TicketSupportSessionUncheckedCreateInput = { + id?: string + guildId: string + userId: string + roleId: string + startedAt?: Date | string + endedAt?: Date | string | null + durationSeconds?: number | null + } + + export type TicketSupportSessionUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + roleId?: StringFieldUpdateOperationsInput | string + startedAt?: DateTimeFieldUpdateOperationsInput | Date | string + endedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + durationSeconds?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type TicketSupportSessionUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + roleId?: StringFieldUpdateOperationsInput | string + startedAt?: DateTimeFieldUpdateOperationsInput | Date | string + endedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + durationSeconds?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type TicketSupportSessionCreateManyInput = { + id?: string + guildId: string + userId: string + roleId: string + startedAt?: Date | string + endedAt?: Date | string | null + durationSeconds?: number | null + } + + export type TicketSupportSessionUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + roleId?: StringFieldUpdateOperationsInput | string + startedAt?: DateTimeFieldUpdateOperationsInput | Date | string + endedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + durationSeconds?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type TicketSupportSessionUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + roleId?: StringFieldUpdateOperationsInput | string + startedAt?: DateTimeFieldUpdateOperationsInput | Date | string + endedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + durationSeconds?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type BirthdayCreateInput = { + id?: string + userId: string + guildId: string + birthDate: string + createdAt?: Date | string + updatedAt?: Date | string + } + + export type BirthdayUncheckedCreateInput = { + id?: string + userId: string + guildId: string + birthDate: string + createdAt?: Date | string + updatedAt?: Date | string + } + + export type BirthdayUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + birthDate?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type BirthdayUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + birthDate?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type BirthdayCreateManyInput = { + id?: string + userId: string + guildId: string + birthDate: string + createdAt?: Date | string + updatedAt?: Date | string + } + + export type BirthdayUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + birthDate?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type BirthdayUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + birthDate?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type ReactionRoleSetCreateInput = { + id?: string + guildId: string + channelId: string + messageId?: string | null + title?: string | null + description?: string | null + entries: JsonNullValueInput | InputJsonValue + createdAt?: Date | string + updatedAt?: Date | string + } + + export type ReactionRoleSetUncheckedCreateInput = { + id?: string + guildId: string + channelId: string + messageId?: string | null + title?: string | null + description?: string | null + entries: JsonNullValueInput | InputJsonValue + createdAt?: Date | string + updatedAt?: Date | string + } + + export type ReactionRoleSetUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + channelId?: StringFieldUpdateOperationsInput | string + messageId?: NullableStringFieldUpdateOperationsInput | string | null + title?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null + entries?: JsonNullValueInput | InputJsonValue + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type ReactionRoleSetUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + channelId?: StringFieldUpdateOperationsInput | string + messageId?: NullableStringFieldUpdateOperationsInput | string | null + title?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null + entries?: JsonNullValueInput | InputJsonValue + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type ReactionRoleSetCreateManyInput = { + id?: string + guildId: string + channelId: string + messageId?: string | null + title?: string | null + description?: string | null + entries: JsonNullValueInput | InputJsonValue + createdAt?: Date | string + updatedAt?: Date | string + } + + export type ReactionRoleSetUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + channelId?: StringFieldUpdateOperationsInput | string + messageId?: NullableStringFieldUpdateOperationsInput | string | null + title?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null + entries?: JsonNullValueInput | InputJsonValue + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type ReactionRoleSetUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + channelId?: StringFieldUpdateOperationsInput | string + messageId?: NullableStringFieldUpdateOperationsInput | string | null + title?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null + entries?: JsonNullValueInput | InputJsonValue + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type EventCreateInput = { + id?: string + guildId: string + title: string + description?: string | null + channelId: string + startTime: Date | string + repeatType?: string + repeatConfig?: NullableJsonNullValueInput | InputJsonValue + reminderOffsetMinutes?: number + roleId?: string | null + isActive?: boolean + lastReminderAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string + signups?: EventSignupCreateNestedManyWithoutEventInput + } + + export type EventUncheckedCreateInput = { + id?: string + guildId: string + title: string + description?: string | null + channelId: string + startTime: Date | string + repeatType?: string + repeatConfig?: NullableJsonNullValueInput | InputJsonValue + reminderOffsetMinutes?: number + roleId?: string | null + isActive?: boolean + lastReminderAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string + signups?: EventSignupUncheckedCreateNestedManyWithoutEventInput + } + + export type EventUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + channelId?: StringFieldUpdateOperationsInput | string + startTime?: DateTimeFieldUpdateOperationsInput | Date | string + repeatType?: StringFieldUpdateOperationsInput | string + repeatConfig?: NullableJsonNullValueInput | InputJsonValue + reminderOffsetMinutes?: IntFieldUpdateOperationsInput | number + roleId?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + lastReminderAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + signups?: EventSignupUpdateManyWithoutEventNestedInput + } + + export type EventUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + channelId?: StringFieldUpdateOperationsInput | string + startTime?: DateTimeFieldUpdateOperationsInput | Date | string + repeatType?: StringFieldUpdateOperationsInput | string + repeatConfig?: NullableJsonNullValueInput | InputJsonValue + reminderOffsetMinutes?: IntFieldUpdateOperationsInput | number + roleId?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + lastReminderAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + signups?: EventSignupUncheckedUpdateManyWithoutEventNestedInput + } + + export type EventCreateManyInput = { + id?: string + guildId: string + title: string + description?: string | null + channelId: string + startTime: Date | string + repeatType?: string + repeatConfig?: NullableJsonNullValueInput | InputJsonValue + reminderOffsetMinutes?: number + roleId?: string | null + isActive?: boolean + lastReminderAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type EventUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + channelId?: StringFieldUpdateOperationsInput | string + startTime?: DateTimeFieldUpdateOperationsInput | Date | string + repeatType?: StringFieldUpdateOperationsInput | string + repeatConfig?: NullableJsonNullValueInput | InputJsonValue + reminderOffsetMinutes?: IntFieldUpdateOperationsInput | number + roleId?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + lastReminderAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type EventUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + channelId?: StringFieldUpdateOperationsInput | string + startTime?: DateTimeFieldUpdateOperationsInput | Date | string + repeatType?: StringFieldUpdateOperationsInput | string + repeatConfig?: NullableJsonNullValueInput | InputJsonValue + reminderOffsetMinutes?: IntFieldUpdateOperationsInput | number + roleId?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + lastReminderAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type EventSignupCreateInput = { + id?: string + guildId: string + userId: string + createdAt?: Date | string + canceledAt?: Date | string | null + event: EventCreateNestedOneWithoutSignupsInput + } + + export type EventSignupUncheckedCreateInput = { + id?: string + eventId: string + guildId: string + userId: string + createdAt?: Date | string + canceledAt?: Date | string | null + } + + export type EventSignupUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + canceledAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + event?: EventUpdateOneRequiredWithoutSignupsNestedInput + } + + export type EventSignupUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + eventId?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + canceledAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type EventSignupCreateManyInput = { + id?: string + eventId: string + guildId: string + userId: string + createdAt?: Date | string + canceledAt?: Date | string | null + } + + export type EventSignupUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + canceledAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type EventSignupUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + eventId?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + canceledAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type StringFilter<$PrismaModel = never> = { + equals?: string | StringFieldRefInput<$PrismaModel> + in?: string[] | ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | ListStringFieldRefInput<$PrismaModel> + lt?: string | StringFieldRefInput<$PrismaModel> + lte?: string | StringFieldRefInput<$PrismaModel> + gt?: string | StringFieldRefInput<$PrismaModel> + gte?: string | StringFieldRefInput<$PrismaModel> + contains?: string | StringFieldRefInput<$PrismaModel> + startsWith?: string | StringFieldRefInput<$PrismaModel> + endsWith?: string | StringFieldRefInput<$PrismaModel> + mode?: QueryMode + not?: NestedStringFilter<$PrismaModel> | string + } + + export type StringNullableFilter<$PrismaModel = never> = { + equals?: string | StringFieldRefInput<$PrismaModel> | null + in?: string[] | ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | ListStringFieldRefInput<$PrismaModel> | null + lt?: string | StringFieldRefInput<$PrismaModel> + lte?: string | StringFieldRefInput<$PrismaModel> + gt?: string | StringFieldRefInput<$PrismaModel> + gte?: string | StringFieldRefInput<$PrismaModel> + contains?: string | StringFieldRefInput<$PrismaModel> + startsWith?: string | StringFieldRefInput<$PrismaModel> + endsWith?: string | StringFieldRefInput<$PrismaModel> + mode?: QueryMode + not?: NestedStringNullableFilter<$PrismaModel> | string | null + } + + export type BoolNullableFilter<$PrismaModel = never> = { + equals?: boolean | BooleanFieldRefInput<$PrismaModel> | null + not?: NestedBoolNullableFilter<$PrismaModel> | boolean | null + } + export type JsonNullableFilter<$PrismaModel = never> = + | PatchUndefined< + Either>, Exclude>, 'path'>>, + Required> + > + | OptionalFlat>, 'path'>> + + export type JsonNullableFilterBase<$PrismaModel = never> = { + equals?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + path?: string[] + string_contains?: string | StringFieldRefInput<$PrismaModel> + string_starts_with?: string | StringFieldRefInput<$PrismaModel> + string_ends_with?: string | StringFieldRefInput<$PrismaModel> + array_contains?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_starts_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + lt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + lte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + not?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + } + + export type DateTimeFilter<$PrismaModel = never> = { + equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + not?: NestedDateTimeFilter<$PrismaModel> | Date | string + } + + export type SortOrderInput = { + sort: SortOrder + nulls?: NullsOrder + } + + export type GuildSettingsCountOrderByAggregateInput = { + guildId?: SortOrder + welcomeChannelId?: SortOrder + logChannelId?: SortOrder + automodEnabled?: SortOrder + automodConfig?: SortOrder + levelingEnabled?: SortOrder + ticketsEnabled?: SortOrder + musicEnabled?: SortOrder + statuspageEnabled?: SortOrder + statuspageConfig?: SortOrder + dynamicVoiceEnabled?: SortOrder + dynamicVoiceConfig?: SortOrder + supportLoginConfig?: SortOrder + birthdayEnabled?: SortOrder + birthdayConfig?: SortOrder + reactionRolesEnabled?: SortOrder + reactionRolesConfig?: SortOrder + eventsEnabled?: SortOrder + supportRoleId?: SortOrder + updatedAt?: SortOrder + createdAt?: SortOrder + } + + export type GuildSettingsMaxOrderByAggregateInput = { + guildId?: SortOrder + welcomeChannelId?: SortOrder + logChannelId?: SortOrder + automodEnabled?: SortOrder + levelingEnabled?: SortOrder + ticketsEnabled?: SortOrder + musicEnabled?: SortOrder + statuspageEnabled?: SortOrder + dynamicVoiceEnabled?: SortOrder + birthdayEnabled?: SortOrder + reactionRolesEnabled?: SortOrder + eventsEnabled?: SortOrder + supportRoleId?: SortOrder + updatedAt?: SortOrder + createdAt?: SortOrder + } + + export type GuildSettingsMinOrderByAggregateInput = { + guildId?: SortOrder + welcomeChannelId?: SortOrder + logChannelId?: SortOrder + automodEnabled?: SortOrder + levelingEnabled?: SortOrder + ticketsEnabled?: SortOrder + musicEnabled?: SortOrder + statuspageEnabled?: SortOrder + dynamicVoiceEnabled?: SortOrder + birthdayEnabled?: SortOrder + reactionRolesEnabled?: SortOrder + eventsEnabled?: SortOrder + supportRoleId?: SortOrder + updatedAt?: SortOrder + createdAt?: SortOrder + } + + export type StringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | StringFieldRefInput<$PrismaModel> + in?: string[] | ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | ListStringFieldRefInput<$PrismaModel> + lt?: string | StringFieldRefInput<$PrismaModel> + lte?: string | StringFieldRefInput<$PrismaModel> + gt?: string | StringFieldRefInput<$PrismaModel> + gte?: string | StringFieldRefInput<$PrismaModel> + contains?: string | StringFieldRefInput<$PrismaModel> + startsWith?: string | StringFieldRefInput<$PrismaModel> + endsWith?: string | StringFieldRefInput<$PrismaModel> + mode?: QueryMode + not?: NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedStringFilter<$PrismaModel> + _max?: NestedStringFilter<$PrismaModel> + } + + export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | StringFieldRefInput<$PrismaModel> | null + in?: string[] | ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | ListStringFieldRefInput<$PrismaModel> | null + lt?: string | StringFieldRefInput<$PrismaModel> + lte?: string | StringFieldRefInput<$PrismaModel> + gt?: string | StringFieldRefInput<$PrismaModel> + gte?: string | StringFieldRefInput<$PrismaModel> + contains?: string | StringFieldRefInput<$PrismaModel> + startsWith?: string | StringFieldRefInput<$PrismaModel> + endsWith?: string | StringFieldRefInput<$PrismaModel> + mode?: QueryMode + not?: NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedStringNullableFilter<$PrismaModel> + _max?: NestedStringNullableFilter<$PrismaModel> + } + + export type BoolNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | BooleanFieldRefInput<$PrismaModel> | null + not?: NestedBoolNullableWithAggregatesFilter<$PrismaModel> | boolean | null + _count?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedBoolNullableFilter<$PrismaModel> + _max?: NestedBoolNullableFilter<$PrismaModel> + } + export type JsonNullableWithAggregatesFilter<$PrismaModel = never> = + | PatchUndefined< + Either>, Exclude>, 'path'>>, + Required> + > + | OptionalFlat>, 'path'>> + + export type JsonNullableWithAggregatesFilterBase<$PrismaModel = never> = { + equals?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + path?: string[] + string_contains?: string | StringFieldRefInput<$PrismaModel> + string_starts_with?: string | StringFieldRefInput<$PrismaModel> + string_ends_with?: string | StringFieldRefInput<$PrismaModel> + array_contains?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_starts_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + lt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + lte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + not?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + _count?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedJsonNullableFilter<$PrismaModel> + _max?: NestedJsonNullableFilter<$PrismaModel> + } + + export type DateTimeWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + not?: NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedDateTimeFilter<$PrismaModel> + _max?: NestedDateTimeFilter<$PrismaModel> + } + + export type IntFilter<$PrismaModel = never> = { + equals?: number | IntFieldRefInput<$PrismaModel> + in?: number[] | ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | ListIntFieldRefInput<$PrismaModel> + lt?: number | IntFieldRefInput<$PrismaModel> + lte?: number | IntFieldRefInput<$PrismaModel> + gt?: number | IntFieldRefInput<$PrismaModel> + gte?: number | IntFieldRefInput<$PrismaModel> + not?: NestedIntFilter<$PrismaModel> | number + } + + export type TicketCountOrderByAggregateInput = { + id?: SortOrder + ticketNumber?: SortOrder + userId?: SortOrder + channelId?: SortOrder + guildId?: SortOrder + topic?: SortOrder + priority?: SortOrder + status?: SortOrder + claimedBy?: SortOrder + transcript?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type TicketAvgOrderByAggregateInput = { + ticketNumber?: SortOrder + } + + export type TicketMaxOrderByAggregateInput = { + id?: SortOrder + ticketNumber?: SortOrder + userId?: SortOrder + channelId?: SortOrder + guildId?: SortOrder + topic?: SortOrder + priority?: SortOrder + status?: SortOrder + claimedBy?: SortOrder + transcript?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type TicketMinOrderByAggregateInput = { + id?: SortOrder + ticketNumber?: SortOrder + userId?: SortOrder + channelId?: SortOrder + guildId?: SortOrder + topic?: SortOrder + priority?: SortOrder + status?: SortOrder + claimedBy?: SortOrder + transcript?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type TicketSumOrderByAggregateInput = { + ticketNumber?: SortOrder + } + + export type IntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | IntFieldRefInput<$PrismaModel> + in?: number[] | ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | ListIntFieldRefInput<$PrismaModel> + lt?: number | IntFieldRefInput<$PrismaModel> + lte?: number | IntFieldRefInput<$PrismaModel> + gt?: number | IntFieldRefInput<$PrismaModel> + gte?: number | IntFieldRefInput<$PrismaModel> + not?: NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: NestedIntFilter<$PrismaModel> + _avg?: NestedFloatFilter<$PrismaModel> + _sum?: NestedIntFilter<$PrismaModel> + _min?: NestedIntFilter<$PrismaModel> + _max?: NestedIntFilter<$PrismaModel> + } + + export type LevelUserId_guildIdCompoundUniqueInput = { + userId: string + guildId: string + } + + export type LevelCountOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + guildId?: SortOrder + xp?: SortOrder + level?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type LevelAvgOrderByAggregateInput = { + xp?: SortOrder + level?: SortOrder + } + + export type LevelMaxOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + guildId?: SortOrder + xp?: SortOrder + level?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type LevelMinOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + guildId?: SortOrder + xp?: SortOrder + level?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type LevelSumOrderByAggregateInput = { + xp?: SortOrder + level?: SortOrder + } + + export type DateTimeNullableFilter<$PrismaModel = never> = { + equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> | null + in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null + notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null + lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + not?: NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null + } + + export type IntNullableFilter<$PrismaModel = never> = { + equals?: number | IntFieldRefInput<$PrismaModel> | null + in?: number[] | ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | ListIntFieldRefInput<$PrismaModel> | null + lt?: number | IntFieldRefInput<$PrismaModel> + lte?: number | IntFieldRefInput<$PrismaModel> + gt?: number | IntFieldRefInput<$PrismaModel> + gte?: number | IntFieldRefInput<$PrismaModel> + not?: NestedIntNullableFilter<$PrismaModel> | number | null + } + + export type TicketSupportSessionCountOrderByAggregateInput = { + id?: SortOrder + guildId?: SortOrder + userId?: SortOrder + roleId?: SortOrder + startedAt?: SortOrder + endedAt?: SortOrder + durationSeconds?: SortOrder + } + + export type TicketSupportSessionAvgOrderByAggregateInput = { + durationSeconds?: SortOrder + } + + export type TicketSupportSessionMaxOrderByAggregateInput = { + id?: SortOrder + guildId?: SortOrder + userId?: SortOrder + roleId?: SortOrder + startedAt?: SortOrder + endedAt?: SortOrder + durationSeconds?: SortOrder + } + + export type TicketSupportSessionMinOrderByAggregateInput = { + id?: SortOrder + guildId?: SortOrder + userId?: SortOrder + roleId?: SortOrder + startedAt?: SortOrder + endedAt?: SortOrder + durationSeconds?: SortOrder + } + + export type TicketSupportSessionSumOrderByAggregateInput = { + durationSeconds?: SortOrder + } + + export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> | null + in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null + notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null + lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + not?: NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null + _count?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedDateTimeNullableFilter<$PrismaModel> + _max?: NestedDateTimeNullableFilter<$PrismaModel> + } + + export type IntNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | IntFieldRefInput<$PrismaModel> | null + in?: number[] | ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | ListIntFieldRefInput<$PrismaModel> | null + lt?: number | IntFieldRefInput<$PrismaModel> + lte?: number | IntFieldRefInput<$PrismaModel> + gt?: number | IntFieldRefInput<$PrismaModel> + gte?: number | IntFieldRefInput<$PrismaModel> + not?: NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null + _count?: NestedIntNullableFilter<$PrismaModel> + _avg?: NestedFloatNullableFilter<$PrismaModel> + _sum?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedIntNullableFilter<$PrismaModel> + _max?: NestedIntNullableFilter<$PrismaModel> + } + + export type BirthdayBirthday_user_guildCompoundUniqueInput = { + userId: string + guildId: string + } + + export type BirthdayCountOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + guildId?: SortOrder + birthDate?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type BirthdayMaxOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + guildId?: SortOrder + birthDate?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type BirthdayMinOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + guildId?: SortOrder + birthDate?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + export type JsonFilter<$PrismaModel = never> = + | PatchUndefined< + Either>, Exclude>, 'path'>>, + Required> + > + | OptionalFlat>, 'path'>> + + export type JsonFilterBase<$PrismaModel = never> = { + equals?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + path?: string[] + string_contains?: string | StringFieldRefInput<$PrismaModel> + string_starts_with?: string | StringFieldRefInput<$PrismaModel> + string_ends_with?: string | StringFieldRefInput<$PrismaModel> + array_contains?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_starts_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + lt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + lte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + not?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + } + + export type ReactionRoleSetCountOrderByAggregateInput = { + id?: SortOrder + guildId?: SortOrder + channelId?: SortOrder + messageId?: SortOrder + title?: SortOrder + description?: SortOrder + entries?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type ReactionRoleSetMaxOrderByAggregateInput = { + id?: SortOrder + guildId?: SortOrder + channelId?: SortOrder + messageId?: SortOrder + title?: SortOrder + description?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type ReactionRoleSetMinOrderByAggregateInput = { + id?: SortOrder + guildId?: SortOrder + channelId?: SortOrder + messageId?: SortOrder + title?: SortOrder + description?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + export type JsonWithAggregatesFilter<$PrismaModel = never> = + | PatchUndefined< + Either>, Exclude>, 'path'>>, + Required> + > + | OptionalFlat>, 'path'>> + + export type JsonWithAggregatesFilterBase<$PrismaModel = never> = { + equals?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + path?: string[] + string_contains?: string | StringFieldRefInput<$PrismaModel> + string_starts_with?: string | StringFieldRefInput<$PrismaModel> + string_ends_with?: string | StringFieldRefInput<$PrismaModel> + array_contains?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_starts_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + lt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + lte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + not?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedJsonFilter<$PrismaModel> + _max?: NestedJsonFilter<$PrismaModel> + } + + export type BoolFilter<$PrismaModel = never> = { + equals?: boolean | BooleanFieldRefInput<$PrismaModel> + not?: NestedBoolFilter<$PrismaModel> | boolean + } + + export type EventSignupListRelationFilter = { + every?: EventSignupWhereInput + some?: EventSignupWhereInput + none?: EventSignupWhereInput + } + + export type EventSignupOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type EventCountOrderByAggregateInput = { + id?: SortOrder + guildId?: SortOrder + title?: SortOrder + description?: SortOrder + channelId?: SortOrder + startTime?: SortOrder + repeatType?: SortOrder + repeatConfig?: SortOrder + reminderOffsetMinutes?: SortOrder + roleId?: SortOrder + isActive?: SortOrder + lastReminderAt?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type EventAvgOrderByAggregateInput = { + reminderOffsetMinutes?: SortOrder + } + + export type EventMaxOrderByAggregateInput = { + id?: SortOrder + guildId?: SortOrder + title?: SortOrder + description?: SortOrder + channelId?: SortOrder + startTime?: SortOrder + repeatType?: SortOrder + reminderOffsetMinutes?: SortOrder + roleId?: SortOrder + isActive?: SortOrder + lastReminderAt?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type EventMinOrderByAggregateInput = { + id?: SortOrder + guildId?: SortOrder + title?: SortOrder + description?: SortOrder + channelId?: SortOrder + startTime?: SortOrder + repeatType?: SortOrder + reminderOffsetMinutes?: SortOrder + roleId?: SortOrder + isActive?: SortOrder + lastReminderAt?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type EventSumOrderByAggregateInput = { + reminderOffsetMinutes?: SortOrder + } + + export type BoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | BooleanFieldRefInput<$PrismaModel> + not?: NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedBoolFilter<$PrismaModel> + _max?: NestedBoolFilter<$PrismaModel> + } + + export type EventRelationFilter = { + is?: EventWhereInput + isNot?: EventWhereInput + } + + export type EventSignupEventIdUserIdCompoundUniqueInput = { + eventId: string + userId: string + } + + export type EventSignupCountOrderByAggregateInput = { + id?: SortOrder + eventId?: SortOrder + guildId?: SortOrder + userId?: SortOrder + createdAt?: SortOrder + canceledAt?: SortOrder + } + + export type EventSignupMaxOrderByAggregateInput = { + id?: SortOrder + eventId?: SortOrder + guildId?: SortOrder + userId?: SortOrder + createdAt?: SortOrder + canceledAt?: SortOrder + } + + export type EventSignupMinOrderByAggregateInput = { + id?: SortOrder + eventId?: SortOrder + guildId?: SortOrder + userId?: SortOrder + createdAt?: SortOrder + canceledAt?: SortOrder + } + + export type StringFieldUpdateOperationsInput = { + set?: string + } + + export type NullableStringFieldUpdateOperationsInput = { + set?: string | null + } + + export type NullableBoolFieldUpdateOperationsInput = { + set?: boolean | null + } + + export type DateTimeFieldUpdateOperationsInput = { + set?: Date | string + } + + export type IntFieldUpdateOperationsInput = { + set?: number + increment?: number + decrement?: number + multiply?: number + divide?: number + } + + export type NullableDateTimeFieldUpdateOperationsInput = { + set?: Date | string | null + } + + export type NullableIntFieldUpdateOperationsInput = { + set?: number | null + increment?: number + decrement?: number + multiply?: number + divide?: number + } + + export type EventSignupCreateNestedManyWithoutEventInput = { + create?: XOR | EventSignupCreateWithoutEventInput[] | EventSignupUncheckedCreateWithoutEventInput[] + connectOrCreate?: EventSignupCreateOrConnectWithoutEventInput | EventSignupCreateOrConnectWithoutEventInput[] + createMany?: EventSignupCreateManyEventInputEnvelope + connect?: EventSignupWhereUniqueInput | EventSignupWhereUniqueInput[] + } + + export type EventSignupUncheckedCreateNestedManyWithoutEventInput = { + create?: XOR | EventSignupCreateWithoutEventInput[] | EventSignupUncheckedCreateWithoutEventInput[] + connectOrCreate?: EventSignupCreateOrConnectWithoutEventInput | EventSignupCreateOrConnectWithoutEventInput[] + createMany?: EventSignupCreateManyEventInputEnvelope + connect?: EventSignupWhereUniqueInput | EventSignupWhereUniqueInput[] + } + + export type BoolFieldUpdateOperationsInput = { + set?: boolean + } + + export type EventSignupUpdateManyWithoutEventNestedInput = { + create?: XOR | EventSignupCreateWithoutEventInput[] | EventSignupUncheckedCreateWithoutEventInput[] + connectOrCreate?: EventSignupCreateOrConnectWithoutEventInput | EventSignupCreateOrConnectWithoutEventInput[] + upsert?: EventSignupUpsertWithWhereUniqueWithoutEventInput | EventSignupUpsertWithWhereUniqueWithoutEventInput[] + createMany?: EventSignupCreateManyEventInputEnvelope + set?: EventSignupWhereUniqueInput | EventSignupWhereUniqueInput[] + disconnect?: EventSignupWhereUniqueInput | EventSignupWhereUniqueInput[] + delete?: EventSignupWhereUniqueInput | EventSignupWhereUniqueInput[] + connect?: EventSignupWhereUniqueInput | EventSignupWhereUniqueInput[] + update?: EventSignupUpdateWithWhereUniqueWithoutEventInput | EventSignupUpdateWithWhereUniqueWithoutEventInput[] + updateMany?: EventSignupUpdateManyWithWhereWithoutEventInput | EventSignupUpdateManyWithWhereWithoutEventInput[] + deleteMany?: EventSignupScalarWhereInput | EventSignupScalarWhereInput[] + } + + export type EventSignupUncheckedUpdateManyWithoutEventNestedInput = { + create?: XOR | EventSignupCreateWithoutEventInput[] | EventSignupUncheckedCreateWithoutEventInput[] + connectOrCreate?: EventSignupCreateOrConnectWithoutEventInput | EventSignupCreateOrConnectWithoutEventInput[] + upsert?: EventSignupUpsertWithWhereUniqueWithoutEventInput | EventSignupUpsertWithWhereUniqueWithoutEventInput[] + createMany?: EventSignupCreateManyEventInputEnvelope + set?: EventSignupWhereUniqueInput | EventSignupWhereUniqueInput[] + disconnect?: EventSignupWhereUniqueInput | EventSignupWhereUniqueInput[] + delete?: EventSignupWhereUniqueInput | EventSignupWhereUniqueInput[] + connect?: EventSignupWhereUniqueInput | EventSignupWhereUniqueInput[] + update?: EventSignupUpdateWithWhereUniqueWithoutEventInput | EventSignupUpdateWithWhereUniqueWithoutEventInput[] + updateMany?: EventSignupUpdateManyWithWhereWithoutEventInput | EventSignupUpdateManyWithWhereWithoutEventInput[] + deleteMany?: EventSignupScalarWhereInput | EventSignupScalarWhereInput[] + } + + export type EventCreateNestedOneWithoutSignupsInput = { + create?: XOR + connectOrCreate?: EventCreateOrConnectWithoutSignupsInput + connect?: EventWhereUniqueInput + } + + export type EventUpdateOneRequiredWithoutSignupsNestedInput = { + create?: XOR + connectOrCreate?: EventCreateOrConnectWithoutSignupsInput + upsert?: EventUpsertWithoutSignupsInput + connect?: EventWhereUniqueInput + update?: XOR, EventUncheckedUpdateWithoutSignupsInput> + } + + export type NestedStringFilter<$PrismaModel = never> = { + equals?: string | StringFieldRefInput<$PrismaModel> + in?: string[] | ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | ListStringFieldRefInput<$PrismaModel> + lt?: string | StringFieldRefInput<$PrismaModel> + lte?: string | StringFieldRefInput<$PrismaModel> + gt?: string | StringFieldRefInput<$PrismaModel> + gte?: string | StringFieldRefInput<$PrismaModel> + contains?: string | StringFieldRefInput<$PrismaModel> + startsWith?: string | StringFieldRefInput<$PrismaModel> + endsWith?: string | StringFieldRefInput<$PrismaModel> + not?: NestedStringFilter<$PrismaModel> | string + } + + export type NestedStringNullableFilter<$PrismaModel = never> = { + equals?: string | StringFieldRefInput<$PrismaModel> | null + in?: string[] | ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | ListStringFieldRefInput<$PrismaModel> | null + lt?: string | StringFieldRefInput<$PrismaModel> + lte?: string | StringFieldRefInput<$PrismaModel> + gt?: string | StringFieldRefInput<$PrismaModel> + gte?: string | StringFieldRefInput<$PrismaModel> + contains?: string | StringFieldRefInput<$PrismaModel> + startsWith?: string | StringFieldRefInput<$PrismaModel> + endsWith?: string | StringFieldRefInput<$PrismaModel> + not?: NestedStringNullableFilter<$PrismaModel> | string | null + } + + export type NestedBoolNullableFilter<$PrismaModel = never> = { + equals?: boolean | BooleanFieldRefInput<$PrismaModel> | null + not?: NestedBoolNullableFilter<$PrismaModel> | boolean | null + } + + export type NestedDateTimeFilter<$PrismaModel = never> = { + equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + not?: NestedDateTimeFilter<$PrismaModel> | Date | string + } + + export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | StringFieldRefInput<$PrismaModel> + in?: string[] | ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | ListStringFieldRefInput<$PrismaModel> + lt?: string | StringFieldRefInput<$PrismaModel> + lte?: string | StringFieldRefInput<$PrismaModel> + gt?: string | StringFieldRefInput<$PrismaModel> + gte?: string | StringFieldRefInput<$PrismaModel> + contains?: string | StringFieldRefInput<$PrismaModel> + startsWith?: string | StringFieldRefInput<$PrismaModel> + endsWith?: string | StringFieldRefInput<$PrismaModel> + not?: NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedStringFilter<$PrismaModel> + _max?: NestedStringFilter<$PrismaModel> + } + + export type NestedIntFilter<$PrismaModel = never> = { + equals?: number | IntFieldRefInput<$PrismaModel> + in?: number[] | ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | ListIntFieldRefInput<$PrismaModel> + lt?: number | IntFieldRefInput<$PrismaModel> + lte?: number | IntFieldRefInput<$PrismaModel> + gt?: number | IntFieldRefInput<$PrismaModel> + gte?: number | IntFieldRefInput<$PrismaModel> + not?: NestedIntFilter<$PrismaModel> | number + } + + export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | StringFieldRefInput<$PrismaModel> | null + in?: string[] | ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | ListStringFieldRefInput<$PrismaModel> | null + lt?: string | StringFieldRefInput<$PrismaModel> + lte?: string | StringFieldRefInput<$PrismaModel> + gt?: string | StringFieldRefInput<$PrismaModel> + gte?: string | StringFieldRefInput<$PrismaModel> + contains?: string | StringFieldRefInput<$PrismaModel> + startsWith?: string | StringFieldRefInput<$PrismaModel> + endsWith?: string | StringFieldRefInput<$PrismaModel> + not?: NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedStringNullableFilter<$PrismaModel> + _max?: NestedStringNullableFilter<$PrismaModel> + } + + export type NestedIntNullableFilter<$PrismaModel = never> = { + equals?: number | IntFieldRefInput<$PrismaModel> | null + in?: number[] | ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | ListIntFieldRefInput<$PrismaModel> | null + lt?: number | IntFieldRefInput<$PrismaModel> + lte?: number | IntFieldRefInput<$PrismaModel> + gt?: number | IntFieldRefInput<$PrismaModel> + gte?: number | IntFieldRefInput<$PrismaModel> + not?: NestedIntNullableFilter<$PrismaModel> | number | null + } + + export type NestedBoolNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | BooleanFieldRefInput<$PrismaModel> | null + not?: NestedBoolNullableWithAggregatesFilter<$PrismaModel> | boolean | null + _count?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedBoolNullableFilter<$PrismaModel> + _max?: NestedBoolNullableFilter<$PrismaModel> + } + export type NestedJsonNullableFilter<$PrismaModel = never> = + | PatchUndefined< + Either>, Exclude>, 'path'>>, + Required> + > + | OptionalFlat>, 'path'>> + + export type NestedJsonNullableFilterBase<$PrismaModel = never> = { + equals?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + path?: string[] + string_contains?: string | StringFieldRefInput<$PrismaModel> + string_starts_with?: string | StringFieldRefInput<$PrismaModel> + string_ends_with?: string | StringFieldRefInput<$PrismaModel> + array_contains?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_starts_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + lt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + lte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + not?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + } + + export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + not?: NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedDateTimeFilter<$PrismaModel> + _max?: NestedDateTimeFilter<$PrismaModel> + } + + export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | IntFieldRefInput<$PrismaModel> + in?: number[] | ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | ListIntFieldRefInput<$PrismaModel> + lt?: number | IntFieldRefInput<$PrismaModel> + lte?: number | IntFieldRefInput<$PrismaModel> + gt?: number | IntFieldRefInput<$PrismaModel> + gte?: number | IntFieldRefInput<$PrismaModel> + not?: NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: NestedIntFilter<$PrismaModel> + _avg?: NestedFloatFilter<$PrismaModel> + _sum?: NestedIntFilter<$PrismaModel> + _min?: NestedIntFilter<$PrismaModel> + _max?: NestedIntFilter<$PrismaModel> + } + + export type NestedFloatFilter<$PrismaModel = never> = { + equals?: number | FloatFieldRefInput<$PrismaModel> + in?: number[] | ListFloatFieldRefInput<$PrismaModel> + notIn?: number[] | ListFloatFieldRefInput<$PrismaModel> + lt?: number | FloatFieldRefInput<$PrismaModel> + lte?: number | FloatFieldRefInput<$PrismaModel> + gt?: number | FloatFieldRefInput<$PrismaModel> + gte?: number | FloatFieldRefInput<$PrismaModel> + not?: NestedFloatFilter<$PrismaModel> | number + } + + export type NestedDateTimeNullableFilter<$PrismaModel = never> = { + equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> | null + in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null + notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null + lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + not?: NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null + } + + export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> | null + in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null + notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null + lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + not?: NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null + _count?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedDateTimeNullableFilter<$PrismaModel> + _max?: NestedDateTimeNullableFilter<$PrismaModel> + } + + export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | IntFieldRefInput<$PrismaModel> | null + in?: number[] | ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | ListIntFieldRefInput<$PrismaModel> | null + lt?: number | IntFieldRefInput<$PrismaModel> + lte?: number | IntFieldRefInput<$PrismaModel> + gt?: number | IntFieldRefInput<$PrismaModel> + gte?: number | IntFieldRefInput<$PrismaModel> + not?: NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null + _count?: NestedIntNullableFilter<$PrismaModel> + _avg?: NestedFloatNullableFilter<$PrismaModel> + _sum?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedIntNullableFilter<$PrismaModel> + _max?: NestedIntNullableFilter<$PrismaModel> + } + + export type NestedFloatNullableFilter<$PrismaModel = never> = { + equals?: number | FloatFieldRefInput<$PrismaModel> | null + in?: number[] | ListFloatFieldRefInput<$PrismaModel> | null + notIn?: number[] | ListFloatFieldRefInput<$PrismaModel> | null + lt?: number | FloatFieldRefInput<$PrismaModel> + lte?: number | FloatFieldRefInput<$PrismaModel> + gt?: number | FloatFieldRefInput<$PrismaModel> + gte?: number | FloatFieldRefInput<$PrismaModel> + not?: NestedFloatNullableFilter<$PrismaModel> | number | null + } + export type NestedJsonFilter<$PrismaModel = never> = + | PatchUndefined< + Either>, Exclude>, 'path'>>, + Required> + > + | OptionalFlat>, 'path'>> + + export type NestedJsonFilterBase<$PrismaModel = never> = { + equals?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + path?: string[] + string_contains?: string | StringFieldRefInput<$PrismaModel> + string_starts_with?: string | StringFieldRefInput<$PrismaModel> + string_ends_with?: string | StringFieldRefInput<$PrismaModel> + array_contains?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_starts_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + lt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + lte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + not?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + } + + export type NestedBoolFilter<$PrismaModel = never> = { + equals?: boolean | BooleanFieldRefInput<$PrismaModel> + not?: NestedBoolFilter<$PrismaModel> | boolean + } + + export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | BooleanFieldRefInput<$PrismaModel> + not?: NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedBoolFilter<$PrismaModel> + _max?: NestedBoolFilter<$PrismaModel> + } + + export type EventSignupCreateWithoutEventInput = { + id?: string + guildId: string + userId: string + createdAt?: Date | string + canceledAt?: Date | string | null + } + + export type EventSignupUncheckedCreateWithoutEventInput = { + id?: string + guildId: string + userId: string + createdAt?: Date | string + canceledAt?: Date | string | null + } + + export type EventSignupCreateOrConnectWithoutEventInput = { + where: EventSignupWhereUniqueInput + create: XOR + } + + export type EventSignupCreateManyEventInputEnvelope = { + data: EventSignupCreateManyEventInput | EventSignupCreateManyEventInput[] + skipDuplicates?: boolean + } + + export type EventSignupUpsertWithWhereUniqueWithoutEventInput = { + where: EventSignupWhereUniqueInput + update: XOR + create: XOR + } + + export type EventSignupUpdateWithWhereUniqueWithoutEventInput = { + where: EventSignupWhereUniqueInput + data: XOR + } + + export type EventSignupUpdateManyWithWhereWithoutEventInput = { + where: EventSignupScalarWhereInput + data: XOR + } + + export type EventSignupScalarWhereInput = { + AND?: EventSignupScalarWhereInput | EventSignupScalarWhereInput[] + OR?: EventSignupScalarWhereInput[] + NOT?: EventSignupScalarWhereInput | EventSignupScalarWhereInput[] + id?: StringFilter<"EventSignup"> | string + eventId?: StringFilter<"EventSignup"> | string + guildId?: StringFilter<"EventSignup"> | string + userId?: StringFilter<"EventSignup"> | string + createdAt?: DateTimeFilter<"EventSignup"> | Date | string + canceledAt?: DateTimeNullableFilter<"EventSignup"> | Date | string | null + } + + export type EventCreateWithoutSignupsInput = { + id?: string + guildId: string + title: string + description?: string | null + channelId: string + startTime: Date | string + repeatType?: string + repeatConfig?: NullableJsonNullValueInput | InputJsonValue + reminderOffsetMinutes?: number + roleId?: string | null + isActive?: boolean + lastReminderAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type EventUncheckedCreateWithoutSignupsInput = { + id?: string + guildId: string + title: string + description?: string | null + channelId: string + startTime: Date | string + repeatType?: string + repeatConfig?: NullableJsonNullValueInput | InputJsonValue + reminderOffsetMinutes?: number + roleId?: string | null + isActive?: boolean + lastReminderAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type EventCreateOrConnectWithoutSignupsInput = { + where: EventWhereUniqueInput + create: XOR + } + + export type EventUpsertWithoutSignupsInput = { + update: XOR + create: XOR + where?: EventWhereInput + } + + export type EventUpdateToOneWithWhereWithoutSignupsInput = { + where?: EventWhereInput + data: XOR + } + + export type EventUpdateWithoutSignupsInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + channelId?: StringFieldUpdateOperationsInput | string + startTime?: DateTimeFieldUpdateOperationsInput | Date | string + repeatType?: StringFieldUpdateOperationsInput | string + repeatConfig?: NullableJsonNullValueInput | InputJsonValue + reminderOffsetMinutes?: IntFieldUpdateOperationsInput | number + roleId?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + lastReminderAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type EventUncheckedUpdateWithoutSignupsInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + channelId?: StringFieldUpdateOperationsInput | string + startTime?: DateTimeFieldUpdateOperationsInput | Date | string + repeatType?: StringFieldUpdateOperationsInput | string + repeatConfig?: NullableJsonNullValueInput | InputJsonValue + reminderOffsetMinutes?: IntFieldUpdateOperationsInput | number + roleId?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + lastReminderAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type EventSignupCreateManyEventInput = { + id?: string + guildId: string + userId: string + createdAt?: Date | string + canceledAt?: Date | string | null + } + + export type EventSignupUpdateWithoutEventInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + canceledAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type EventSignupUncheckedUpdateWithoutEventInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + canceledAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type EventSignupUncheckedUpdateManyWithoutEventInput = { + id?: StringFieldUpdateOperationsInput | string + guildId?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + canceledAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + + + /** + * Aliases for legacy arg types + */ + /** + * @deprecated Use EventCountOutputTypeDefaultArgs instead + */ + export type EventCountOutputTypeArgs = EventCountOutputTypeDefaultArgs + /** + * @deprecated Use GuildSettingsDefaultArgs instead + */ + export type GuildSettingsArgs = GuildSettingsDefaultArgs + /** + * @deprecated Use TicketDefaultArgs instead + */ + export type TicketArgs = TicketDefaultArgs + /** + * @deprecated Use LevelDefaultArgs instead + */ + export type LevelArgs = LevelDefaultArgs + /** + * @deprecated Use TicketSupportSessionDefaultArgs instead + */ + export type TicketSupportSessionArgs = TicketSupportSessionDefaultArgs + /** + * @deprecated Use BirthdayDefaultArgs instead + */ + export type BirthdayArgs = BirthdayDefaultArgs + /** + * @deprecated Use ReactionRoleSetDefaultArgs instead + */ + export type ReactionRoleSetArgs = ReactionRoleSetDefaultArgs + /** + * @deprecated Use EventDefaultArgs instead + */ + export type EventArgs = EventDefaultArgs + /** + * @deprecated Use EventSignupDefaultArgs instead + */ + export type EventSignupArgs = EventSignupDefaultArgs + + /** + * Batch Payload for updateMany & deleteMany & createMany + */ + + export type BatchPayload = { + count: number + } + + /** + * DMMF + */ + export const dmmf: runtime.BaseDMMF +} \ No newline at end of file diff --git a/node_modules/.prisma/client/index.js b/node_modules/.prisma/client/index.js index 1938e5c..22a5fa0 100644 --- a/node_modules/.prisma/client/index.js +++ b/node_modules/.prisma/client/index.js @@ -1,65 +1,331 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -// src/scripts/default-index.ts -var default_index_exports = {}; -__export(default_index_exports, { - Prisma: () => Prisma, - PrismaClient: () => PrismaClient, - default: () => default_index_default -}); -module.exports = __toCommonJS(default_index_exports); +Object.defineProperty(exports, "__esModule", { value: true }); -// ../../node_modules/.pnpm/@prisma+engines-version@5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2/node_modules/@prisma/engines-version/package.json -var prisma = { - enginesVersion: "605197351a3c8bdd595af2d2a9bc3025bca48ea2" -}; +const { + PrismaClientKnownRequestError, + PrismaClientUnknownRequestError, + PrismaClientRustPanicError, + PrismaClientInitializationError, + PrismaClientValidationError, + NotFoundError, + getPrismaClient, + sqltag, + empty, + join, + raw, + skip, + Decimal, + Debug, + objectEnumValues, + makeStrictEnum, + Extensions, + warnOnce, + defineDmmfProperty, + Public, + getRuntime +} = require('@prisma/client/runtime/library.js') -// package.json -var version = "5.22.0"; -// src/runtime/utils/clientVersion.ts -var clientVersion = version; +const Prisma = {} -// src/scripts/default-index.ts -var PrismaClient = class { - constructor() { - throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.'); - } -}; -function defineExtension(ext) { - if (typeof ext === "function") { - return ext; - } - return (client) => client.$extends(ext); +exports.Prisma = Prisma +exports.$Enums = {} + +/** + * Prisma Client JS version: 5.22.0 + * Query Engine version: 605197351a3c8bdd595af2d2a9bc3025bca48ea2 + */ +Prisma.prismaVersion = { + client: "5.22.0", + engine: "605197351a3c8bdd595af2d2a9bc3025bca48ea2" } -function getExtensionContext(that) { - return that; + +Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError; +Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError +Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError +Prisma.PrismaClientInitializationError = PrismaClientInitializationError +Prisma.PrismaClientValidationError = PrismaClientValidationError +Prisma.NotFoundError = NotFoundError +Prisma.Decimal = Decimal + +/** + * Re-export of sql-template-tag + */ +Prisma.sql = sqltag +Prisma.empty = empty +Prisma.join = join +Prisma.raw = raw +Prisma.validator = Public.validator + +/** +* Extensions +*/ +Prisma.getExtensionContext = Extensions.getExtensionContext +Prisma.defineExtension = Extensions.defineExtension + +/** + * Shorthand utilities for JSON filtering + */ +Prisma.DbNull = objectEnumValues.instances.DbNull +Prisma.JsonNull = objectEnumValues.instances.JsonNull +Prisma.AnyNull = objectEnumValues.instances.AnyNull + +Prisma.NullTypes = { + DbNull: objectEnumValues.classes.DbNull, + JsonNull: objectEnumValues.classes.JsonNull, + AnyNull: objectEnumValues.classes.AnyNull } -var Prisma = { - defineExtension, - getExtensionContext, - prismaVersion: { client: clientVersion, engine: prisma.enginesVersion } -}; -var default_index_default = { Prisma }; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Prisma, - PrismaClient + + + + + const path = require('path') + +/** + * Enums + */ +exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' }); + +exports.Prisma.GuildSettingsScalarFieldEnum = { + guildId: 'guildId', + welcomeChannelId: 'welcomeChannelId', + logChannelId: 'logChannelId', + automodEnabled: 'automodEnabled', + automodConfig: 'automodConfig', + levelingEnabled: 'levelingEnabled', + ticketsEnabled: 'ticketsEnabled', + musicEnabled: 'musicEnabled', + statuspageEnabled: 'statuspageEnabled', + statuspageConfig: 'statuspageConfig', + dynamicVoiceEnabled: 'dynamicVoiceEnabled', + dynamicVoiceConfig: 'dynamicVoiceConfig', + supportLoginConfig: 'supportLoginConfig', + birthdayEnabled: 'birthdayEnabled', + birthdayConfig: 'birthdayConfig', + reactionRolesEnabled: 'reactionRolesEnabled', + reactionRolesConfig: 'reactionRolesConfig', + eventsEnabled: 'eventsEnabled', + supportRoleId: 'supportRoleId', + updatedAt: 'updatedAt', + createdAt: 'createdAt' +}; + +exports.Prisma.TicketScalarFieldEnum = { + id: 'id', + ticketNumber: 'ticketNumber', + userId: 'userId', + channelId: 'channelId', + guildId: 'guildId', + topic: 'topic', + priority: 'priority', + status: 'status', + claimedBy: 'claimedBy', + transcript: 'transcript', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.LevelScalarFieldEnum = { + id: 'id', + userId: 'userId', + guildId: 'guildId', + xp: 'xp', + level: 'level', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.TicketSupportSessionScalarFieldEnum = { + id: 'id', + guildId: 'guildId', + userId: 'userId', + roleId: 'roleId', + startedAt: 'startedAt', + endedAt: 'endedAt', + durationSeconds: 'durationSeconds' +}; + +exports.Prisma.BirthdayScalarFieldEnum = { + id: 'id', + userId: 'userId', + guildId: 'guildId', + birthDate: 'birthDate', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.ReactionRoleSetScalarFieldEnum = { + id: 'id', + guildId: 'guildId', + channelId: 'channelId', + messageId: 'messageId', + title: 'title', + description: 'description', + entries: 'entries', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.EventScalarFieldEnum = { + id: 'id', + guildId: 'guildId', + title: 'title', + description: 'description', + channelId: 'channelId', + startTime: 'startTime', + repeatType: 'repeatType', + repeatConfig: 'repeatConfig', + reminderOffsetMinutes: 'reminderOffsetMinutes', + roleId: 'roleId', + isActive: 'isActive', + lastReminderAt: 'lastReminderAt', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.EventSignupScalarFieldEnum = { + id: 'id', + eventId: 'eventId', + guildId: 'guildId', + userId: 'userId', + createdAt: 'createdAt', + canceledAt: 'canceledAt' +}; + +exports.Prisma.SortOrder = { + asc: 'asc', + desc: 'desc' +}; + +exports.Prisma.NullableJsonNullValueInput = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull +}; + +exports.Prisma.JsonNullValueInput = { + JsonNull: Prisma.JsonNull +}; + +exports.Prisma.QueryMode = { + default: 'default', + insensitive: 'insensitive' +}; + +exports.Prisma.JsonNullValueFilter = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull, + AnyNull: Prisma.AnyNull +}; + +exports.Prisma.NullsOrder = { + first: 'first', + last: 'last' +}; + + +exports.Prisma.ModelName = { + GuildSettings: 'GuildSettings', + Ticket: 'Ticket', + Level: 'Level', + TicketSupportSession: 'TicketSupportSession', + Birthday: 'Birthday', + ReactionRoleSet: 'ReactionRoleSet', + Event: 'Event', + EventSignup: 'EventSignup' +}; +/** + * Create the Client + */ +const config = { + "generator": { + "name": "client", + "provider": { + "fromEnvVar": null, + "value": "prisma-client-js" + }, + "output": { + "value": "C:\\Users\\Pascal.Priessnitz\\Documents\\Development\\PapoV2\\Papo\\node_modules\\@prisma\\client", + "fromEnvVar": null + }, + "config": { + "engineType": "library" + }, + "binaryTargets": [ + { + "fromEnvVar": null, + "value": "windows", + "native": true + } + ], + "previewFeatures": [], + "sourceFilePath": "C:\\Users\\Pascal.Priessnitz\\Documents\\Development\\PapoV2\\Papo\\src\\database\\schema.prisma" + }, + "relativeEnvPaths": { + "rootEnvPath": null, + "schemaEnvPath": "../../../.env" + }, + "relativePath": "../../../src/database", + "clientVersion": "5.22.0", + "engineVersion": "605197351a3c8bdd595af2d2a9bc3025bca48ea2", + "datasourceNames": [ + "db" + ], + "activeProvider": "postgresql", + "postinstall": false, + "inlineDatasources": { + "db": { + "url": { + "fromEnvVar": "DATABASE_URL", + "value": null + } + } + }, + "inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel GuildSettings {\n guildId String @id\n welcomeChannelId String?\n logChannelId String?\n automodEnabled Boolean?\n automodConfig Json?\n levelingEnabled Boolean?\n ticketsEnabled Boolean?\n musicEnabled Boolean?\n statuspageEnabled Boolean?\n statuspageConfig Json?\n dynamicVoiceEnabled Boolean?\n dynamicVoiceConfig Json?\n supportLoginConfig Json?\n birthdayEnabled Boolean?\n birthdayConfig Json?\n reactionRolesEnabled Boolean?\n reactionRolesConfig Json?\n eventsEnabled Boolean?\n supportRoleId String?\n updatedAt DateTime @updatedAt\n createdAt DateTime @default(now())\n}\n\nmodel Ticket {\n id String @id @default(cuid())\n ticketNumber Int @default(autoincrement())\n userId String\n channelId String\n guildId String\n topic String?\n priority String @default(\"normal\")\n status String\n claimedBy String?\n transcript String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n}\n\nmodel Level {\n id String @id @default(cuid())\n userId String\n guildId String\n xp Int @default(0)\n level Int @default(0)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([userId, guildId], name: \"userId_guildId\")\n}\n\nmodel TicketSupportSession {\n id String @id @default(cuid())\n guildId String\n userId String\n roleId String\n startedAt DateTime @default(now())\n endedAt DateTime?\n durationSeconds Int?\n\n @@index([guildId, userId, endedAt])\n}\n\nmodel Birthday {\n id String @id @default(cuid())\n userId String\n guildId String\n birthDate String\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@unique([userId, guildId], name: \"birthday_user_guild\")\n @@index([guildId])\n}\n\nmodel ReactionRoleSet {\n id String @id @default(cuid())\n guildId String\n channelId String\n messageId String?\n title String?\n description String?\n entries Json\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([guildId])\n @@index([guildId, messageId])\n}\n\nmodel Event {\n id String @id @default(cuid())\n guildId String\n title String\n description String?\n channelId String\n startTime DateTime\n repeatType String @default(\"none\")\n repeatConfig Json?\n reminderOffsetMinutes Int @default(60)\n roleId String?\n isActive Boolean @default(true)\n lastReminderAt DateTime?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n signups EventSignup[]\n\n @@index([guildId])\n @@index([guildId, startTime])\n}\n\nmodel EventSignup {\n id String @id @default(cuid())\n eventId String\n guildId String\n userId String\n createdAt DateTime @default(now())\n canceledAt DateTime?\n\n event Event @relation(fields: [eventId], references: [id])\n\n @@unique([eventId, userId])\n @@index([guildId, eventId])\n}\n", + "inlineSchemaHash": "568c90a02123b5936efbb0bcba9292354eae27a5022567e88b12cb219e10d706", + "copyEngine": true +} + +const fs = require('fs') + +config.dirname = __dirname +if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) { + const alternativePaths = [ + "node_modules/.prisma/client", + ".prisma/client", + ] + + const alternativePath = alternativePaths.find((altPath) => { + return fs.existsSync(path.join(process.cwd(), altPath, 'schema.prisma')) + }) ?? alternativePaths[0] + + config.dirname = path.join(process.cwd(), alternativePath) + config.isBundled = true +} + +config.runtimeDataModel = JSON.parse("{\"models\":{\"GuildSettings\":{\"dbName\":null,\"fields\":[{\"name\":\"guildId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"welcomeChannelId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"logChannelId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"automodEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"automodConfig\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"levelingEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ticketsEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"musicEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"statuspageEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"statuspageConfig\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"dynamicVoiceEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"dynamicVoiceConfig\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"supportLoginConfig\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"birthdayEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"birthdayConfig\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"reactionRolesEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"reactionRolesConfig\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"eventsEnabled\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"supportRoleId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Ticket\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ticketNumber\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"channelId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"guildId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"topic\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"priority\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":\"normal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"claimedBy\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"transcript\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Level\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"guildId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"xp\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"level\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[[\"userId\",\"guildId\"]],\"uniqueIndexes\":[{\"name\":\"userId_guildId\",\"fields\":[\"userId\",\"guildId\"]}],\"isGenerated\":false},\"TicketSupportSession\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"guildId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"roleId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"startedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"endedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"durationSeconds\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Birthday\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"guildId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"birthDate\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[[\"userId\",\"guildId\"]],\"uniqueIndexes\":[{\"name\":\"birthday_user_guild\",\"fields\":[\"userId\",\"guildId\"]}],\"isGenerated\":false},\"ReactionRoleSet\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"guildId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"channelId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"messageId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entries\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Event\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"guildId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"channelId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"startTime\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"repeatType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":\"none\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"repeatConfig\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"reminderOffsetMinutes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":60,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"roleId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastReminderAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"signups\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"EventSignup\",\"relationName\":\"EventToEventSignup\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"EventSignup\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"eventId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"guildId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"canceledAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"event\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Event\",\"relationName\":\"EventToEventSignup\",\"relationFromFields\":[\"eventId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"eventId\",\"userId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"eventId\",\"userId\"]}],\"isGenerated\":false}},\"enums\":{},\"types\":{}}") +defineDmmfProperty(exports.Prisma, config.runtimeDataModel) +config.engineWasm = undefined + + +const { warnEnvConflicts } = require('@prisma/client/runtime/library.js') + +warnEnvConflicts({ + rootEnvPath: config.relativeEnvPaths.rootEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.rootEnvPath), + schemaEnvPath: config.relativeEnvPaths.schemaEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.schemaEnvPath) +}) + +const PrismaClient = getPrismaClient(config) +exports.PrismaClient = PrismaClient +Object.assign(exports, Prisma) + +// file annotations for bundling tools to include these files +path.join(__dirname, "query_engine-windows.dll.node"); +path.join(process.cwd(), "node_modules/.prisma/client/query_engine-windows.dll.node") +// file annotations for bundling tools to include these files +path.join(__dirname, "schema.prisma"); +path.join(process.cwd(), "node_modules/.prisma/client/schema.prisma") diff --git a/node_modules/.prisma/client/wasm.d.ts b/node_modules/.prisma/client/wasm.d.ts index bac7a5c..bc20c6c 100644 --- a/node_modules/.prisma/client/wasm.d.ts +++ b/node_modules/.prisma/client/wasm.d.ts @@ -1,110 +1 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ - -import * as runtime from '@prisma/client/runtime/library' - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare const PrismaClient: any - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare type PrismaClient = any - -export declare class PrismaClientExtends< - ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, -> { - $extends: { extArgs: ExtArgs } & (< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ) => PrismaClientExtends & Args['client']) - - $transaction( - fn: (prisma: Omit) => Promise, - options?: { maxWait?: number; timeout?: number; isolationLevel?: string }, - ): Promise - $transaction

[]>( - arg: [...P], - options?: { isolationLevel?: string }, - ): Promise> -} - -export declare const dmmf: any -export declare type dmmf = any - -/** - * Get the type of the value, that the Promise holds. - */ -export declare type PromiseType> = T extends PromiseLike ? U : T - -/** - * Get the return type of a function which returns a Promise. - */ -export declare type PromiseReturnType Promise> = PromiseType> - -export namespace Prisma { - export type TransactionClient = any - - export function defineExtension< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ): (client: any) => PrismaClientExtends - - export type Extension = runtime.Types.Extensions.UserArgs - export import getExtensionContext = runtime.Extensions.getExtensionContext - export import Args = runtime.Types.Public.Args - export import Payload = runtime.Types.Public.Payload - export import Result = runtime.Types.Public.Result - export import Exact = runtime.Types.Public.Exact - export import PrismaPromise = runtime.Types.Public.PrismaPromise - - export const prismaVersion: { - client: string - engine: string - } -} +export * from "./index" \ No newline at end of file diff --git a/node_modules/.prisma/client/wasm.js b/node_modules/.prisma/client/wasm.js index 1938e5c..ecb40d9 100644 --- a/node_modules/.prisma/client/wasm.js +++ b/node_modules/.prisma/client/wasm.js @@ -1,65 +1,302 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -// src/scripts/default-index.ts -var default_index_exports = {}; -__export(default_index_exports, { - Prisma: () => Prisma, - PrismaClient: () => PrismaClient, - default: () => default_index_default +Object.defineProperty(exports, "__esModule", { value: true }); + +const { + Decimal, + objectEnumValues, + makeStrictEnum, + Public, + getRuntime, + skip +} = require('@prisma/client/runtime/index-browser.js') + + +const Prisma = {} + +exports.Prisma = Prisma +exports.$Enums = {} + +/** + * Prisma Client JS version: 5.22.0 + * Query Engine version: 605197351a3c8bdd595af2d2a9bc3025bca48ea2 + */ +Prisma.prismaVersion = { + client: "5.22.0", + engine: "605197351a3c8bdd595af2d2a9bc3025bca48ea2" +} + +Prisma.PrismaClientKnownRequestError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)}; +Prisma.PrismaClientUnknownRequestError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.PrismaClientRustPanicError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.PrismaClientInitializationError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.PrismaClientValidationError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.NotFoundError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.Decimal = Decimal + +/** + * Re-export of sql-template-tag + */ +Prisma.sql = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.empty = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.join = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.raw = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.validator = Public.validator + +/** +* Extensions +*/ +Prisma.getExtensionContext = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.defineExtension = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} + +/** + * Shorthand utilities for JSON filtering + */ +Prisma.DbNull = objectEnumValues.instances.DbNull +Prisma.JsonNull = objectEnumValues.instances.JsonNull +Prisma.AnyNull = objectEnumValues.instances.AnyNull + +Prisma.NullTypes = { + DbNull: objectEnumValues.classes.DbNull, + JsonNull: objectEnumValues.classes.JsonNull, + AnyNull: objectEnumValues.classes.AnyNull +} + + + +/** + * Enums + */ + +exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' }); -module.exports = __toCommonJS(default_index_exports); -// ../../node_modules/.pnpm/@prisma+engines-version@5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2/node_modules/@prisma/engines-version/package.json -var prisma = { - enginesVersion: "605197351a3c8bdd595af2d2a9bc3025bca48ea2" +exports.Prisma.GuildSettingsScalarFieldEnum = { + guildId: 'guildId', + welcomeChannelId: 'welcomeChannelId', + logChannelId: 'logChannelId', + automodEnabled: 'automodEnabled', + automodConfig: 'automodConfig', + levelingEnabled: 'levelingEnabled', + ticketsEnabled: 'ticketsEnabled', + musicEnabled: 'musicEnabled', + statuspageEnabled: 'statuspageEnabled', + statuspageConfig: 'statuspageConfig', + dynamicVoiceEnabled: 'dynamicVoiceEnabled', + dynamicVoiceConfig: 'dynamicVoiceConfig', + supportLoginConfig: 'supportLoginConfig', + birthdayEnabled: 'birthdayEnabled', + birthdayConfig: 'birthdayConfig', + reactionRolesEnabled: 'reactionRolesEnabled', + reactionRolesConfig: 'reactionRolesConfig', + eventsEnabled: 'eventsEnabled', + supportRoleId: 'supportRoleId', + updatedAt: 'updatedAt', + createdAt: 'createdAt' }; -// package.json -var version = "5.22.0"; +exports.Prisma.TicketScalarFieldEnum = { + id: 'id', + ticketNumber: 'ticketNumber', + userId: 'userId', + channelId: 'channelId', + guildId: 'guildId', + topic: 'topic', + priority: 'priority', + status: 'status', + claimedBy: 'claimedBy', + transcript: 'transcript', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; -// src/runtime/utils/clientVersion.ts -var clientVersion = version; +exports.Prisma.LevelScalarFieldEnum = { + id: 'id', + userId: 'userId', + guildId: 'guildId', + xp: 'xp', + level: 'level', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; -// src/scripts/default-index.ts -var PrismaClient = class { +exports.Prisma.TicketSupportSessionScalarFieldEnum = { + id: 'id', + guildId: 'guildId', + userId: 'userId', + roleId: 'roleId', + startedAt: 'startedAt', + endedAt: 'endedAt', + durationSeconds: 'durationSeconds' +}; + +exports.Prisma.BirthdayScalarFieldEnum = { + id: 'id', + userId: 'userId', + guildId: 'guildId', + birthDate: 'birthDate', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.ReactionRoleSetScalarFieldEnum = { + id: 'id', + guildId: 'guildId', + channelId: 'channelId', + messageId: 'messageId', + title: 'title', + description: 'description', + entries: 'entries', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.EventScalarFieldEnum = { + id: 'id', + guildId: 'guildId', + title: 'title', + description: 'description', + channelId: 'channelId', + startTime: 'startTime', + repeatType: 'repeatType', + repeatConfig: 'repeatConfig', + reminderOffsetMinutes: 'reminderOffsetMinutes', + roleId: 'roleId', + isActive: 'isActive', + lastReminderAt: 'lastReminderAt', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.EventSignupScalarFieldEnum = { + id: 'id', + eventId: 'eventId', + guildId: 'guildId', + userId: 'userId', + createdAt: 'createdAt', + canceledAt: 'canceledAt' +}; + +exports.Prisma.SortOrder = { + asc: 'asc', + desc: 'desc' +}; + +exports.Prisma.NullableJsonNullValueInput = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull +}; + +exports.Prisma.JsonNullValueInput = { + JsonNull: Prisma.JsonNull +}; + +exports.Prisma.QueryMode = { + default: 'default', + insensitive: 'insensitive' +}; + +exports.Prisma.JsonNullValueFilter = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull, + AnyNull: Prisma.AnyNull +}; + +exports.Prisma.NullsOrder = { + first: 'first', + last: 'last' +}; + + +exports.Prisma.ModelName = { + GuildSettings: 'GuildSettings', + Ticket: 'Ticket', + Level: 'Level', + TicketSupportSession: 'TicketSupportSession', + Birthday: 'Birthday', + ReactionRoleSet: 'ReactionRoleSet', + Event: 'Event', + EventSignup: 'EventSignup' +}; + +/** + * This is a stub Prisma Client that will error at runtime if called. + */ +class PrismaClient { constructor() { - throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.'); + return new Proxy(this, { + get(target, prop) { + let message + const runtime = getRuntime() + if (runtime.isEdge) { + message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either: +- Use Prisma Accelerate: https://pris.ly/d/accelerate +- Use Driver Adapters: https://pris.ly/d/driver-adapters +`; + } else { + message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).' + } + + message += ` +If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report` + + throw new Error(message) + } + }) } -}; -function defineExtension(ext) { - if (typeof ext === "function") { - return ext; - } - return (client) => client.$extends(ext); } -function getExtensionContext(that) { - return that; -} -var Prisma = { - defineExtension, - getExtensionContext, - prismaVersion: { client: clientVersion, engine: prisma.enginesVersion } -}; -var default_index_default = { Prisma }; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Prisma, - PrismaClient -}); + +exports.PrismaClient = PrismaClient + +Object.assign(exports, Prisma) diff --git a/node_modules/@discordjs/voice/README.md b/node_modules/@discordjs/voice/README.md index 3a2c4e3..a32dfd0 100644 --- a/node_modules/@discordjs/voice/README.md +++ b/node_modules/@discordjs/voice/README.md @@ -8,8 +8,9 @@ Discord server npm version npm downloads - Build status - Code coverage + Build status + Last commit. + Code coverage

Vercel @@ -24,7 +25,7 @@ **Features:** - Send and receive\* audio in Discord voice-based channels -- A strong focus on reliability and predictable behaviour +- A strong focus on reliability and predictable behavior - Horizontal scalability and libraries other than [discord.js](https://discord.js.org/) are supported with custom adapters - A robust audio processing system that can handle a wide range of audio sources @@ -32,7 +33,7 @@ ## Installation -**Node.js 16.11.0 or newer is required.** +**Node.js 22.12.0 or newer is required.** ```sh npm install @discordjs/voice @@ -51,9 +52,13 @@ try installing another. **Encryption Libraries (npm install):** +> [!NOTE] +> You only need to install one of these libraries if your system does not support `aes-256-gcm` (verify by running `require('node:crypto').getCiphers().includes('aes-256-gcm')`). + - `sodium-native`: ^3.3.0 - `sodium`: ^3.0.2 -- `tweetnacl`: ^1.0.3 +- `@stablelib/xchacha20poly1305`: ^2.0.0 +- `@noble/ciphers`: ^1.0.0 - `libsodium-wrappers`: ^0.7.9 **Opus Libraries (npm install):** @@ -77,7 +82,7 @@ The [voice-examples][voice-examples] repository contains examples on how to use - [Guide][guide] ([source][guide-source]) Also see the v13 to v14 [Update Guide][guide-update], which includes updated and removed items from the library. - [discord.js Discord server][discord] -- [Discord API Discord server][discord-api] +- [Discord Developers Discord server][discord-developers] - [GitHub][source] - [npm][npm] - [Related libraries][related-libs] @@ -99,7 +104,7 @@ If you don't understand something in the documentation, you are experiencing pro [guide-source]: https://github.com/discordjs/guide [guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html [discord]: https://discord.gg/djs -[discord-api]: https://discord.gg/discord-api +[discord-developers]: https://discord.gg/discord-developers [source]: https://github.com/discordjs/discord.js/tree/main/packages/voice [npm]: https://www.npmjs.com/package/@discordjs/voice [related-libs]: https://discord.com/developers/docs/topics/community-resources#libraries diff --git a/node_modules/@discordjs/voice/dist/index.d.mts b/node_modules/@discordjs/voice/dist/index.d.mts index 03dd136..231fd20 100644 --- a/node_modules/@discordjs/voice/dist/index.d.mts +++ b/node_modules/@discordjs/voice/dist/index.d.mts @@ -2,6 +2,7 @@ import { Buffer } from 'node:buffer'; import { EventEmitter } from 'node:events'; import { Readable, ReadableOptions } from 'node:stream'; import prism from 'prism-media'; +import { VoiceDavePrepareTransitionData, VoiceDavePrepareEpochData, VoiceOpcodes, VoiceSendPayload, VoiceReceivePayload } from 'discord-api-types/voice/v8'; import WebSocket, { MessageEvent } from 'ws'; import { GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData } from 'discord-api-types/v10'; @@ -442,11 +443,11 @@ declare class AudioPlayer extends EventEmitter { private unsubscribe; /** * The state that the player is in. + * + * @remarks + * The setter will perform clean-up operations where necessary. */ get state(): AudioPlayerState; - /** - * Sets a new state for the player, performing clean-up operations where necessary. - */ set state(newState: AudioPlayerState); /** * Plays a new resource on the player. If the player is already playing a resource, the existing resource is destroyed @@ -556,6 +557,174 @@ declare function getVoiceConnections(group: string): Map; + processCommit(commit: Buffer): void; + processProposals(optype: 0 | 1, proposals: Buffer, recognizedUserIds?: string[]): ProposalsResult; + processWelcome(welcome: Buffer): void; + ready: boolean; + reinit(protocolVersion: number, userId: string, channelId: string): void; + reset(): void; + setExternalSender(externalSender: Buffer): void; + setPassthroughMode(passthrough: boolean, expiry: number): void; + voicePrivacyCode: string; +} +interface ProposalsResult { + commit?: Buffer; + welcome?: Buffer; +} +interface TransitionResult { + success: boolean; + transitionId: number; +} +/** + * Options that dictate the session behavior. + */ +interface DAVESessionOptions { + decryptionFailureTolerance?: number | undefined; +} +interface DAVESession extends EventEmitter { + on(event: 'error', listener: (error: Error) => void): this; + on(event: 'debug', listener: (message: string) => void): this; + on(event: 'keyPackage', listener: (message: Buffer) => void): this; + on(event: 'invalidateTransition', listener: (transitionId: number) => void): this; +} +/** + * Manages the DAVE protocol group session. + */ +declare class DAVESession extends EventEmitter { + /** + * The channel id represented by this session. + */ + channelId: string; + /** + * The user id represented by this session. + */ + userId: string; + /** + * The protocol version being used. + */ + protocolVersion: number; + /** + * The last transition id executed. + */ + lastTransitionId?: number | undefined; + /** + * The pending transition. + */ + private pendingTransition?; + /** + * Whether this session was downgraded previously. + */ + private downgraded; + /** + * The amount of consecutive failures encountered when decrypting. + */ + private consecutiveFailures; + /** + * The amount of consecutive failures needed to attempt to recover. + */ + private readonly failureTolerance; + /** + * Whether this session is currently re-initializing due to an invalid transition. + */ + reinitializing: boolean; + /** + * The underlying DAVE Session of this wrapper. + */ + session: SessionMethods | undefined; + constructor(protocolVersion: number, userId: string, channelId: string, options: DAVESessionOptions); + /** + * The current voice privacy code of the session. Will be `null` if there is no session. + */ + get voicePrivacyCode(): string | null; + /** + * Gets the verification code for a user in the session. + * + * @throws Will throw if there is not an active session or the user id provided is invalid or not in the session. + */ + getVerificationCode(userId: string): Promise; + /** + * Re-initializes (or initializes) the underlying session. + */ + reinit(): void; + /** + * Set the external sender for this session. + * + * @param externalSender - The external sender + */ + setExternalSender(externalSender: Buffer): void; + /** + * Prepare for a transition. + * + * @param data - The transition data + * @returns Whether we should signal to the voice server that we are ready + */ + prepareTransition(data: VoiceDavePrepareTransitionData): boolean; + /** + * Execute a transition. + * + * @param transitionId - The transition id to execute on + */ + executeTransition(transitionId: number): boolean | undefined; + /** + * Prepare for a new epoch. + * + * @param data - The epoch data + */ + prepareEpoch(data: VoiceDavePrepareEpochData): void; + /** + * Recover from an invalid transition by re-initializing. + * + * @param transitionId - The transition id to invalidate + */ + recoverFromInvalidTransition(transitionId: number): void; + /** + * Processes proposals from the MLS group. + * + * @param payload - The binary message payload + * @param connectedClients - The set of connected client IDs + * @returns The payload to send back to the voice server, if there is one + */ + processProposals(payload: Buffer, connectedClients: Set): Buffer | undefined; + /** + * Processes a commit from the MLS group. + * + * @param payload - The payload + * @returns The transaction id and whether it was successful + */ + processCommit(payload: Buffer): TransitionResult; + /** + * Processes a welcome from the MLS group. + * + * @param payload - The payload + * @returns The transaction id and whether it was successful + */ + processWelcome(payload: Buffer): TransitionResult; + /** + * Encrypt a packet using end-to-end encryption. + * + * @param packet - The packet to encrypt + */ + encrypt(packet: Buffer): Buffer; + /** + * Decrypt a packet using end-to-end encryption. + * + * @param packet - The packet to decrypt + * @param userId - The user id that sent the packet + * @returns The decrypted packet, or `null` if the decryption failed but should be ignored + */ + decrypt(packet: Buffer, userId: string): Buffer | null; + /** + * Resets the session. + */ + destroy(): void; +} + /** * Stores an IP address and port. Used to store socket details for the local client as well as * for Discord. @@ -634,6 +803,14 @@ declare class VoiceUDPSocket extends EventEmitter { performIPDiscovery(ssrc: number): Promise; } +/** + * A binary WebSocket message. + */ +interface BinaryWebSocketMessage { + op: VoiceOpcodes; + payload: Buffer; + seq: number; +} interface VoiceWebSocket extends EventEmitter { on(event: 'error', listener: (error: Error) => void): this; on(event: 'open', listener: (event: WebSocket.Event) => void): this; @@ -650,6 +827,12 @@ interface VoiceWebSocket extends EventEmitter { * @eventProperty */ on(event: 'packet', listener: (packet: any) => void): this; + /** + * Binary message event. + * + * @eventProperty + */ + on(event: 'binary', listener: (message: BinaryWebSocketMessage) => void): this; } /** * An extension of the WebSocket class to provide helper functionality when interacting @@ -678,6 +861,10 @@ declare class VoiceWebSocket extends EventEmitter { * The last recorded ping. */ ping?: number; + /** + * The last sequence number acknowledged from Discord. Will be `-1` if no sequence numbered messages have been received. + */ + sequence: number; /** * The debug logger function, if debugging is enabled. */ @@ -698,7 +885,7 @@ declare class VoiceWebSocket extends EventEmitter { destroy(): void; /** * Handles message events on the WebSocket. Attempts to JSON parse the messages and emit them - * as packets. + * as packets. Binary messages will be parsed and emitted. * * @param event - The message event */ @@ -708,7 +895,14 @@ declare class VoiceWebSocket extends EventEmitter { * * @param packet - The packet to send */ - sendPacket(packet: any): void; + sendPacket(packet: VoiceSendPayload): void; + /** + * Sends a binary message over the WebSocket. + * + * @param opcode - The opcode to use + * @param payload - The payload to send + */ + sendBinaryMessage(opcode: VoiceOpcodes, payload: Buffer): void; /** * Sends a heartbeat over the WebSocket. */ @@ -758,7 +952,7 @@ interface NetworkingIdentifyingState { */ interface NetworkingUdpHandshakingState { code: NetworkingStatusCode.UdpHandshaking; - connectionData: Pick; + connectionData: Pick; connectionOptions: ConnectionOptions; udp: VoiceUDPSocket; ws: VoiceWebSocket; @@ -768,7 +962,7 @@ interface NetworkingUdpHandshakingState { */ interface NetworkingSelectingProtocolState { code: NetworkingStatusCode.SelectingProtocol; - connectionData: Pick; + connectionData: Pick; connectionOptions: ConnectionOptions; udp: VoiceUDPSocket; ws: VoiceWebSocket; @@ -781,6 +975,7 @@ interface NetworkingReadyState { code: NetworkingStatusCode.Ready; connectionData: ConnectionData; connectionOptions: ConnectionOptions; + dave?: DAVESession | undefined; preparedPacket?: Buffer | undefined; udp: VoiceUDPSocket; ws: VoiceWebSocket; @@ -793,6 +988,7 @@ interface NetworkingResumingState { code: NetworkingStatusCode.Resuming; connectionData: ConnectionData; connectionOptions: ConnectionOptions; + dave?: DAVESession | undefined; preparedPacket?: Buffer | undefined; udp: VoiceUDPSocket; ws: VoiceWebSocket; @@ -814,6 +1010,7 @@ type NetworkingState = NetworkingClosedState | NetworkingIdentifyingState | Netw * and VOICE_STATE_UPDATE packets. */ interface ConnectionOptions { + channelId: string; endpoint: string; serverId: string; sessionId: string; @@ -825,6 +1022,7 @@ interface ConnectionOptions { * the connection, timing information for playback of streams. */ interface ConnectionData { + connectedClients: Set; encryptionMode: string; nonce: number; nonceBuffer: Buffer; @@ -835,6 +1033,14 @@ interface ConnectionData { ssrc: number; timestamp: number; } +/** + * Options for networking that dictate behavior. + */ +interface NetworkingOptions { + daveEncryption?: boolean | undefined; + debug?: boolean | undefined; + decryptionFailureTolerance?: number | undefined; +} interface Networking extends EventEmitter { /** * Debug event for Networking. @@ -845,6 +1051,7 @@ interface Networking extends EventEmitter { on(event: 'error', listener: (error: Error) => void): this; on(event: 'stateChange', listener: (oldState: NetworkingState, newState: NetworkingState) => void): this; on(event: 'close', listener: (code: number) => void): this; + on(event: 'transitioned', listener: (transitionId: number) => void): this; } /** * Manages the networking required to maintain a voice connection and dispatch audio packets @@ -855,30 +1062,41 @@ declare class Networking extends EventEmitter { * The debug logger function, if debugging is enabled. */ private readonly debug; + /** + * The options used to create this Networking instance. + */ + private readonly options; /** * Creates a new Networking instance. */ - constructor(options: ConnectionOptions, debug: boolean); + constructor(connectionOptions: ConnectionOptions, options: NetworkingOptions); /** * Destroys the Networking instance, transitioning it into the Closed state. */ destroy(): void; /** * The current state of the networking instance. + * + * @remarks + * The setter will perform clean-up operations where necessary. */ get state(): NetworkingState; - /** - * Sets a new state for the networking instance, performing clean-up operations where necessary. - */ set state(newState: NetworkingState); /** * Creates a new WebSocket to a Discord Voice gateway. * * @param endpoint - The endpoint to connect to + * @param lastSequence - The last sequence to set for this WebSocket */ private createWebSocket; /** - * Propagates errors from the children VoiceWebSocket and VoiceUDPSocket. + * Creates a new DAVE session for this voice connection if we can create one. + * + * @param protocolVersion - The protocol version to use + */ + private createDaveSession; + /** + * Propagates errors from the children VoiceWebSocket, VoiceUDPSocket and DAVESession. * * @param error - The error that was emitted by a child */ @@ -906,6 +1124,24 @@ declare class Networking extends EventEmitter { * @param packet - The received packet */ private onWsPacket; + /** + * Called when a binary message is received on the connection's WebSocket. + * + * @param message - The received message + */ + private onWsBinary; + /** + * Called when a new key package is ready to be sent to the voice server. + * + * @param keyPackage - The new key package + */ + private onDaveKeyPackage; + /** + * Called when the DAVE session wants to invalidate their transition and re-initialize. + * + * @param transitionId - The transition to invalidate + */ + private onDaveInvalidateTransition; /** * Propagates debug messages from the child WebSocket. * @@ -918,6 +1154,12 @@ declare class Networking extends EventEmitter { * @param message - The emitted debug message */ private onUdpDebug; + /** + * Propagates debug messages from the child DAVESession. + * + * @param message - The emitted debug message + */ + private onDaveDebug; /** * Prepares an Opus packet for playback. This includes attaching metadata to it and encrypting it. * It will be stored within the instance, and can be played by dispatchAudio() @@ -953,6 +1195,7 @@ declare class Networking extends EventEmitter { * * @param opusPacket - The Opus packet to prepare * @param connectionData - The current connection data of the instance + * @param daveSession - The DAVE session to use for encryption */ private createAudioPacket; /** @@ -960,6 +1203,7 @@ declare class Networking extends EventEmitter { * * @param opusPacket - The Opus packet to encrypt * @param connectionData - The current connection data of the instance + * @param daveSession - The DAVE session to use for encryption */ private encryptOpusPacket; } @@ -1001,7 +1245,7 @@ declare class AudioReceiveStream extends Readable { */ readonly end: EndBehavior; private endTimeout?; - constructor({ end, ...options }: AudioReceiveStreamOptions); + constructor(options: AudioReceiveStreamOptions); push(buffer: Buffer | null): boolean; private renewEndTimeout; _read(): void; @@ -1128,7 +1372,7 @@ declare class VoiceReceiver { * @param packet - The received packet * @internal */ - onWsPacket(packet: any): void; + onWsPacket(packet: VoiceReceivePayload): void; private decrypt; /** * Parses an audio packet, decrypting it to yield an Opus packet. @@ -1137,6 +1381,7 @@ declare class VoiceReceiver { * @param mode - The encryption mode * @param nonce - The nonce buffer used by the connection for encryption * @param secretKey - The secret key used by the connection for encryption + * @param userId - The user id that sent the packet * @returns The parsed Opus packet */ private parsePacket; @@ -1341,6 +1586,12 @@ interface VoiceConnection extends EventEmitter { * @eventProperty */ on(event: 'stateChange', listener: (oldState: VoiceConnectionState, newState: VoiceConnectionState) => void): this; + /** + * Emitted when the end-to-end encrypted session has transitioned + * + * @eventProperty + */ + on(event: 'transitioned', listener: (transitionId: number) => void): this; /** * Emitted when the state of the voice connection changes to a specific status * @@ -1383,6 +1634,10 @@ declare class VoiceConnection extends EventEmitter { * The debug logger function, if debugging is enabled. */ private readonly debug; + /** + * The options used to create this voice connection. + */ + private readonly options; /** * Creates a new voice connection. * @@ -1392,11 +1647,11 @@ declare class VoiceConnection extends EventEmitter { constructor(joinConfig: JoinConfig, options: CreateVoiceConnectionOptions); /** * The current state of the voice connection. + * + * @remarks + * The setter will perform clean-up operations where necessary. */ get state(): VoiceConnectionState; - /** - * Updates the state of the voice connection, performing clean-up operations where necessary. - */ set state(newState: VoiceConnectionState); /** * Registers a `VOICE_SERVER_UPDATE` packet to the voice connection. This will cause it to reconnect using the @@ -1463,6 +1718,12 @@ declare class VoiceConnection extends EventEmitter { * @param message - The debug message to propagate */ private onNetworkingDebug; + /** + * Propagates transitions from the underlying network instance. + * + * @param transitionId - The transition id + */ + private onNetworkingTransitioned; /** * Prepares an audio packet for dispatch. * @@ -1530,6 +1791,20 @@ declare class VoiceConnection extends EventEmitter { ws: number | undefined; udp: number | undefined; }; + /** + * The current voice privacy code of the encrypted session. + * + * @remarks + * For this data to be available, the VoiceConnection must be in the Ready state, + * and the connection would have to be end-to-end encrypted. + */ + get voicePrivacyCode(): string | undefined; + /** + * Gets the verification code for a user in the session. + * + * @throws Will throw if end-to-end encryption is not on or if the user id provided is not in the session. + */ + getVerificationCode(userId: string): Promise; /** * Called when a subscription of this voice connection to an audio player is removed. * @@ -1543,11 +1818,20 @@ declare class VoiceConnection extends EventEmitter { */ interface CreateVoiceConnectionOptions { adapterCreator: DiscordGatewayAdapterCreator; + /** + * Whether to use the DAVE protocol for end-to-end encryption. Defaults to true. + */ + daveEncryption?: boolean | undefined; /** * If true, debug messages will be enabled for the voice connection and its * related components. Defaults to false. */ debug?: boolean | undefined; + /** + * The amount of consecutive decryption failures needed to try to + * re-initialize the end-to-end encrypted session to recover. Defaults to 24. + */ + decryptionFailureTolerance?: number | undefined; } /** * The options that can be given when joining a voice channel. @@ -1641,4 +1925,4 @@ declare function demuxProbe(stream: Readable, probeSize?: number, validator?: ty */ declare const version: string; -export { AudioPlayer, type AudioPlayerBufferingState, AudioPlayerError, type AudioPlayerIdleState, type AudioPlayerPausedState, type AudioPlayerPlayingState, type AudioPlayerState, AudioPlayerStatus, AudioReceiveStream, type AudioReceiveStreamOptions, AudioResource, type CreateAudioPlayerOptions, type CreateAudioResourceOptions, type CreateVoiceConnectionOptions, type DiscordGatewayAdapterCreator, type DiscordGatewayAdapterImplementerMethods, type DiscordGatewayAdapterLibraryMethods, type EndBehavior, EndBehaviorType, type JoinConfig, type JoinVoiceChannelOptions, NoSubscriberBehavior, PlayerSubscription, type ProbeInfo, SSRCMap, SpeakingMap, StreamType, VoiceConnection, type VoiceConnectionConnectingState, type VoiceConnectionDestroyedState, VoiceConnectionDisconnectReason, type VoiceConnectionDisconnectedBaseState, type VoiceConnectionDisconnectedOtherState, type VoiceConnectionDisconnectedState, type VoiceConnectionDisconnectedWebSocketState, type VoiceConnectionReadyState, type VoiceConnectionSignallingState, type VoiceConnectionState, VoiceConnectionStatus, VoiceReceiver, type VoiceUserData, createAudioPlayer, createAudioResource, createDefaultAudioReceiveStreamOptions, demuxProbe, entersState, generateDependencyReport, getGroups, getVoiceConnection, getVoiceConnections, joinVoiceChannel, validateDiscordOpusHead, version }; +export { AudioPlayer, type AudioPlayerBufferingState, AudioPlayerError, type AudioPlayerIdleState, type AudioPlayerPausedState, type AudioPlayerPlayingState, type AudioPlayerState, AudioPlayerStatus, AudioReceiveStream, type AudioReceiveStreamOptions, AudioResource, type ConnectionData, type ConnectionOptions, type CreateAudioPlayerOptions, type CreateAudioResourceOptions, type CreateVoiceConnectionOptions, DAVESession, type DiscordGatewayAdapterCreator, type DiscordGatewayAdapterImplementerMethods, type DiscordGatewayAdapterLibraryMethods, type Edge, type EndBehavior, EndBehaviorType, type JoinConfig, type JoinVoiceChannelOptions, Networking, type NetworkingClosedState, type NetworkingIdentifyingState, type NetworkingOpeningWsState, type NetworkingReadyState, type NetworkingResumingState, type NetworkingSelectingProtocolState, type NetworkingState, NetworkingStatusCode, type NetworkingUdpHandshakingState, NoSubscriberBehavior, Node, PlayerSubscription, type ProbeInfo, SSRCMap, type SocketConfig, SpeakingMap, StreamType, TransformerType, VoiceConnection, type VoiceConnectionConnectingState, type VoiceConnectionDestroyedState, VoiceConnectionDisconnectReason, type VoiceConnectionDisconnectedBaseState, type VoiceConnectionDisconnectedOtherState, type VoiceConnectionDisconnectedState, type VoiceConnectionDisconnectedWebSocketState, type VoiceConnectionReadyState, type VoiceConnectionSignallingState, type VoiceConnectionState, VoiceConnectionStatus, VoiceReceiver, VoiceUDPSocket, type VoiceUserData, VoiceWebSocket, createAudioPlayer, createAudioResource, createDefaultAudioReceiveStreamOptions, demuxProbe, entersState, generateDependencyReport, getGroups, getVoiceConnection, getVoiceConnections, joinVoiceChannel, validateDiscordOpusHead, version }; diff --git a/node_modules/@discordjs/voice/dist/index.d.ts b/node_modules/@discordjs/voice/dist/index.d.ts index 03dd136..231fd20 100644 --- a/node_modules/@discordjs/voice/dist/index.d.ts +++ b/node_modules/@discordjs/voice/dist/index.d.ts @@ -2,6 +2,7 @@ import { Buffer } from 'node:buffer'; import { EventEmitter } from 'node:events'; import { Readable, ReadableOptions } from 'node:stream'; import prism from 'prism-media'; +import { VoiceDavePrepareTransitionData, VoiceDavePrepareEpochData, VoiceOpcodes, VoiceSendPayload, VoiceReceivePayload } from 'discord-api-types/voice/v8'; import WebSocket, { MessageEvent } from 'ws'; import { GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData } from 'discord-api-types/v10'; @@ -442,11 +443,11 @@ declare class AudioPlayer extends EventEmitter { private unsubscribe; /** * The state that the player is in. + * + * @remarks + * The setter will perform clean-up operations where necessary. */ get state(): AudioPlayerState; - /** - * Sets a new state for the player, performing clean-up operations where necessary. - */ set state(newState: AudioPlayerState); /** * Plays a new resource on the player. If the player is already playing a resource, the existing resource is destroyed @@ -556,6 +557,174 @@ declare function getVoiceConnections(group: string): Map; + processCommit(commit: Buffer): void; + processProposals(optype: 0 | 1, proposals: Buffer, recognizedUserIds?: string[]): ProposalsResult; + processWelcome(welcome: Buffer): void; + ready: boolean; + reinit(protocolVersion: number, userId: string, channelId: string): void; + reset(): void; + setExternalSender(externalSender: Buffer): void; + setPassthroughMode(passthrough: boolean, expiry: number): void; + voicePrivacyCode: string; +} +interface ProposalsResult { + commit?: Buffer; + welcome?: Buffer; +} +interface TransitionResult { + success: boolean; + transitionId: number; +} +/** + * Options that dictate the session behavior. + */ +interface DAVESessionOptions { + decryptionFailureTolerance?: number | undefined; +} +interface DAVESession extends EventEmitter { + on(event: 'error', listener: (error: Error) => void): this; + on(event: 'debug', listener: (message: string) => void): this; + on(event: 'keyPackage', listener: (message: Buffer) => void): this; + on(event: 'invalidateTransition', listener: (transitionId: number) => void): this; +} +/** + * Manages the DAVE protocol group session. + */ +declare class DAVESession extends EventEmitter { + /** + * The channel id represented by this session. + */ + channelId: string; + /** + * The user id represented by this session. + */ + userId: string; + /** + * The protocol version being used. + */ + protocolVersion: number; + /** + * The last transition id executed. + */ + lastTransitionId?: number | undefined; + /** + * The pending transition. + */ + private pendingTransition?; + /** + * Whether this session was downgraded previously. + */ + private downgraded; + /** + * The amount of consecutive failures encountered when decrypting. + */ + private consecutiveFailures; + /** + * The amount of consecutive failures needed to attempt to recover. + */ + private readonly failureTolerance; + /** + * Whether this session is currently re-initializing due to an invalid transition. + */ + reinitializing: boolean; + /** + * The underlying DAVE Session of this wrapper. + */ + session: SessionMethods | undefined; + constructor(protocolVersion: number, userId: string, channelId: string, options: DAVESessionOptions); + /** + * The current voice privacy code of the session. Will be `null` if there is no session. + */ + get voicePrivacyCode(): string | null; + /** + * Gets the verification code for a user in the session. + * + * @throws Will throw if there is not an active session or the user id provided is invalid or not in the session. + */ + getVerificationCode(userId: string): Promise; + /** + * Re-initializes (or initializes) the underlying session. + */ + reinit(): void; + /** + * Set the external sender for this session. + * + * @param externalSender - The external sender + */ + setExternalSender(externalSender: Buffer): void; + /** + * Prepare for a transition. + * + * @param data - The transition data + * @returns Whether we should signal to the voice server that we are ready + */ + prepareTransition(data: VoiceDavePrepareTransitionData): boolean; + /** + * Execute a transition. + * + * @param transitionId - The transition id to execute on + */ + executeTransition(transitionId: number): boolean | undefined; + /** + * Prepare for a new epoch. + * + * @param data - The epoch data + */ + prepareEpoch(data: VoiceDavePrepareEpochData): void; + /** + * Recover from an invalid transition by re-initializing. + * + * @param transitionId - The transition id to invalidate + */ + recoverFromInvalidTransition(transitionId: number): void; + /** + * Processes proposals from the MLS group. + * + * @param payload - The binary message payload + * @param connectedClients - The set of connected client IDs + * @returns The payload to send back to the voice server, if there is one + */ + processProposals(payload: Buffer, connectedClients: Set): Buffer | undefined; + /** + * Processes a commit from the MLS group. + * + * @param payload - The payload + * @returns The transaction id and whether it was successful + */ + processCommit(payload: Buffer): TransitionResult; + /** + * Processes a welcome from the MLS group. + * + * @param payload - The payload + * @returns The transaction id and whether it was successful + */ + processWelcome(payload: Buffer): TransitionResult; + /** + * Encrypt a packet using end-to-end encryption. + * + * @param packet - The packet to encrypt + */ + encrypt(packet: Buffer): Buffer; + /** + * Decrypt a packet using end-to-end encryption. + * + * @param packet - The packet to decrypt + * @param userId - The user id that sent the packet + * @returns The decrypted packet, or `null` if the decryption failed but should be ignored + */ + decrypt(packet: Buffer, userId: string): Buffer | null; + /** + * Resets the session. + */ + destroy(): void; +} + /** * Stores an IP address and port. Used to store socket details for the local client as well as * for Discord. @@ -634,6 +803,14 @@ declare class VoiceUDPSocket extends EventEmitter { performIPDiscovery(ssrc: number): Promise; } +/** + * A binary WebSocket message. + */ +interface BinaryWebSocketMessage { + op: VoiceOpcodes; + payload: Buffer; + seq: number; +} interface VoiceWebSocket extends EventEmitter { on(event: 'error', listener: (error: Error) => void): this; on(event: 'open', listener: (event: WebSocket.Event) => void): this; @@ -650,6 +827,12 @@ interface VoiceWebSocket extends EventEmitter { * @eventProperty */ on(event: 'packet', listener: (packet: any) => void): this; + /** + * Binary message event. + * + * @eventProperty + */ + on(event: 'binary', listener: (message: BinaryWebSocketMessage) => void): this; } /** * An extension of the WebSocket class to provide helper functionality when interacting @@ -678,6 +861,10 @@ declare class VoiceWebSocket extends EventEmitter { * The last recorded ping. */ ping?: number; + /** + * The last sequence number acknowledged from Discord. Will be `-1` if no sequence numbered messages have been received. + */ + sequence: number; /** * The debug logger function, if debugging is enabled. */ @@ -698,7 +885,7 @@ declare class VoiceWebSocket extends EventEmitter { destroy(): void; /** * Handles message events on the WebSocket. Attempts to JSON parse the messages and emit them - * as packets. + * as packets. Binary messages will be parsed and emitted. * * @param event - The message event */ @@ -708,7 +895,14 @@ declare class VoiceWebSocket extends EventEmitter { * * @param packet - The packet to send */ - sendPacket(packet: any): void; + sendPacket(packet: VoiceSendPayload): void; + /** + * Sends a binary message over the WebSocket. + * + * @param opcode - The opcode to use + * @param payload - The payload to send + */ + sendBinaryMessage(opcode: VoiceOpcodes, payload: Buffer): void; /** * Sends a heartbeat over the WebSocket. */ @@ -758,7 +952,7 @@ interface NetworkingIdentifyingState { */ interface NetworkingUdpHandshakingState { code: NetworkingStatusCode.UdpHandshaking; - connectionData: Pick; + connectionData: Pick; connectionOptions: ConnectionOptions; udp: VoiceUDPSocket; ws: VoiceWebSocket; @@ -768,7 +962,7 @@ interface NetworkingUdpHandshakingState { */ interface NetworkingSelectingProtocolState { code: NetworkingStatusCode.SelectingProtocol; - connectionData: Pick; + connectionData: Pick; connectionOptions: ConnectionOptions; udp: VoiceUDPSocket; ws: VoiceWebSocket; @@ -781,6 +975,7 @@ interface NetworkingReadyState { code: NetworkingStatusCode.Ready; connectionData: ConnectionData; connectionOptions: ConnectionOptions; + dave?: DAVESession | undefined; preparedPacket?: Buffer | undefined; udp: VoiceUDPSocket; ws: VoiceWebSocket; @@ -793,6 +988,7 @@ interface NetworkingResumingState { code: NetworkingStatusCode.Resuming; connectionData: ConnectionData; connectionOptions: ConnectionOptions; + dave?: DAVESession | undefined; preparedPacket?: Buffer | undefined; udp: VoiceUDPSocket; ws: VoiceWebSocket; @@ -814,6 +1010,7 @@ type NetworkingState = NetworkingClosedState | NetworkingIdentifyingState | Netw * and VOICE_STATE_UPDATE packets. */ interface ConnectionOptions { + channelId: string; endpoint: string; serverId: string; sessionId: string; @@ -825,6 +1022,7 @@ interface ConnectionOptions { * the connection, timing information for playback of streams. */ interface ConnectionData { + connectedClients: Set; encryptionMode: string; nonce: number; nonceBuffer: Buffer; @@ -835,6 +1033,14 @@ interface ConnectionData { ssrc: number; timestamp: number; } +/** + * Options for networking that dictate behavior. + */ +interface NetworkingOptions { + daveEncryption?: boolean | undefined; + debug?: boolean | undefined; + decryptionFailureTolerance?: number | undefined; +} interface Networking extends EventEmitter { /** * Debug event for Networking. @@ -845,6 +1051,7 @@ interface Networking extends EventEmitter { on(event: 'error', listener: (error: Error) => void): this; on(event: 'stateChange', listener: (oldState: NetworkingState, newState: NetworkingState) => void): this; on(event: 'close', listener: (code: number) => void): this; + on(event: 'transitioned', listener: (transitionId: number) => void): this; } /** * Manages the networking required to maintain a voice connection and dispatch audio packets @@ -855,30 +1062,41 @@ declare class Networking extends EventEmitter { * The debug logger function, if debugging is enabled. */ private readonly debug; + /** + * The options used to create this Networking instance. + */ + private readonly options; /** * Creates a new Networking instance. */ - constructor(options: ConnectionOptions, debug: boolean); + constructor(connectionOptions: ConnectionOptions, options: NetworkingOptions); /** * Destroys the Networking instance, transitioning it into the Closed state. */ destroy(): void; /** * The current state of the networking instance. + * + * @remarks + * The setter will perform clean-up operations where necessary. */ get state(): NetworkingState; - /** - * Sets a new state for the networking instance, performing clean-up operations where necessary. - */ set state(newState: NetworkingState); /** * Creates a new WebSocket to a Discord Voice gateway. * * @param endpoint - The endpoint to connect to + * @param lastSequence - The last sequence to set for this WebSocket */ private createWebSocket; /** - * Propagates errors from the children VoiceWebSocket and VoiceUDPSocket. + * Creates a new DAVE session for this voice connection if we can create one. + * + * @param protocolVersion - The protocol version to use + */ + private createDaveSession; + /** + * Propagates errors from the children VoiceWebSocket, VoiceUDPSocket and DAVESession. * * @param error - The error that was emitted by a child */ @@ -906,6 +1124,24 @@ declare class Networking extends EventEmitter { * @param packet - The received packet */ private onWsPacket; + /** + * Called when a binary message is received on the connection's WebSocket. + * + * @param message - The received message + */ + private onWsBinary; + /** + * Called when a new key package is ready to be sent to the voice server. + * + * @param keyPackage - The new key package + */ + private onDaveKeyPackage; + /** + * Called when the DAVE session wants to invalidate their transition and re-initialize. + * + * @param transitionId - The transition to invalidate + */ + private onDaveInvalidateTransition; /** * Propagates debug messages from the child WebSocket. * @@ -918,6 +1154,12 @@ declare class Networking extends EventEmitter { * @param message - The emitted debug message */ private onUdpDebug; + /** + * Propagates debug messages from the child DAVESession. + * + * @param message - The emitted debug message + */ + private onDaveDebug; /** * Prepares an Opus packet for playback. This includes attaching metadata to it and encrypting it. * It will be stored within the instance, and can be played by dispatchAudio() @@ -953,6 +1195,7 @@ declare class Networking extends EventEmitter { * * @param opusPacket - The Opus packet to prepare * @param connectionData - The current connection data of the instance + * @param daveSession - The DAVE session to use for encryption */ private createAudioPacket; /** @@ -960,6 +1203,7 @@ declare class Networking extends EventEmitter { * * @param opusPacket - The Opus packet to encrypt * @param connectionData - The current connection data of the instance + * @param daveSession - The DAVE session to use for encryption */ private encryptOpusPacket; } @@ -1001,7 +1245,7 @@ declare class AudioReceiveStream extends Readable { */ readonly end: EndBehavior; private endTimeout?; - constructor({ end, ...options }: AudioReceiveStreamOptions); + constructor(options: AudioReceiveStreamOptions); push(buffer: Buffer | null): boolean; private renewEndTimeout; _read(): void; @@ -1128,7 +1372,7 @@ declare class VoiceReceiver { * @param packet - The received packet * @internal */ - onWsPacket(packet: any): void; + onWsPacket(packet: VoiceReceivePayload): void; private decrypt; /** * Parses an audio packet, decrypting it to yield an Opus packet. @@ -1137,6 +1381,7 @@ declare class VoiceReceiver { * @param mode - The encryption mode * @param nonce - The nonce buffer used by the connection for encryption * @param secretKey - The secret key used by the connection for encryption + * @param userId - The user id that sent the packet * @returns The parsed Opus packet */ private parsePacket; @@ -1341,6 +1586,12 @@ interface VoiceConnection extends EventEmitter { * @eventProperty */ on(event: 'stateChange', listener: (oldState: VoiceConnectionState, newState: VoiceConnectionState) => void): this; + /** + * Emitted when the end-to-end encrypted session has transitioned + * + * @eventProperty + */ + on(event: 'transitioned', listener: (transitionId: number) => void): this; /** * Emitted when the state of the voice connection changes to a specific status * @@ -1383,6 +1634,10 @@ declare class VoiceConnection extends EventEmitter { * The debug logger function, if debugging is enabled. */ private readonly debug; + /** + * The options used to create this voice connection. + */ + private readonly options; /** * Creates a new voice connection. * @@ -1392,11 +1647,11 @@ declare class VoiceConnection extends EventEmitter { constructor(joinConfig: JoinConfig, options: CreateVoiceConnectionOptions); /** * The current state of the voice connection. + * + * @remarks + * The setter will perform clean-up operations where necessary. */ get state(): VoiceConnectionState; - /** - * Updates the state of the voice connection, performing clean-up operations where necessary. - */ set state(newState: VoiceConnectionState); /** * Registers a `VOICE_SERVER_UPDATE` packet to the voice connection. This will cause it to reconnect using the @@ -1463,6 +1718,12 @@ declare class VoiceConnection extends EventEmitter { * @param message - The debug message to propagate */ private onNetworkingDebug; + /** + * Propagates transitions from the underlying network instance. + * + * @param transitionId - The transition id + */ + private onNetworkingTransitioned; /** * Prepares an audio packet for dispatch. * @@ -1530,6 +1791,20 @@ declare class VoiceConnection extends EventEmitter { ws: number | undefined; udp: number | undefined; }; + /** + * The current voice privacy code of the encrypted session. + * + * @remarks + * For this data to be available, the VoiceConnection must be in the Ready state, + * and the connection would have to be end-to-end encrypted. + */ + get voicePrivacyCode(): string | undefined; + /** + * Gets the verification code for a user in the session. + * + * @throws Will throw if end-to-end encryption is not on or if the user id provided is not in the session. + */ + getVerificationCode(userId: string): Promise; /** * Called when a subscription of this voice connection to an audio player is removed. * @@ -1543,11 +1818,20 @@ declare class VoiceConnection extends EventEmitter { */ interface CreateVoiceConnectionOptions { adapterCreator: DiscordGatewayAdapterCreator; + /** + * Whether to use the DAVE protocol for end-to-end encryption. Defaults to true. + */ + daveEncryption?: boolean | undefined; /** * If true, debug messages will be enabled for the voice connection and its * related components. Defaults to false. */ debug?: boolean | undefined; + /** + * The amount of consecutive decryption failures needed to try to + * re-initialize the end-to-end encrypted session to recover. Defaults to 24. + */ + decryptionFailureTolerance?: number | undefined; } /** * The options that can be given when joining a voice channel. @@ -1641,4 +1925,4 @@ declare function demuxProbe(stream: Readable, probeSize?: number, validator?: ty */ declare const version: string; -export { AudioPlayer, type AudioPlayerBufferingState, AudioPlayerError, type AudioPlayerIdleState, type AudioPlayerPausedState, type AudioPlayerPlayingState, type AudioPlayerState, AudioPlayerStatus, AudioReceiveStream, type AudioReceiveStreamOptions, AudioResource, type CreateAudioPlayerOptions, type CreateAudioResourceOptions, type CreateVoiceConnectionOptions, type DiscordGatewayAdapterCreator, type DiscordGatewayAdapterImplementerMethods, type DiscordGatewayAdapterLibraryMethods, type EndBehavior, EndBehaviorType, type JoinConfig, type JoinVoiceChannelOptions, NoSubscriberBehavior, PlayerSubscription, type ProbeInfo, SSRCMap, SpeakingMap, StreamType, VoiceConnection, type VoiceConnectionConnectingState, type VoiceConnectionDestroyedState, VoiceConnectionDisconnectReason, type VoiceConnectionDisconnectedBaseState, type VoiceConnectionDisconnectedOtherState, type VoiceConnectionDisconnectedState, type VoiceConnectionDisconnectedWebSocketState, type VoiceConnectionReadyState, type VoiceConnectionSignallingState, type VoiceConnectionState, VoiceConnectionStatus, VoiceReceiver, type VoiceUserData, createAudioPlayer, createAudioResource, createDefaultAudioReceiveStreamOptions, demuxProbe, entersState, generateDependencyReport, getGroups, getVoiceConnection, getVoiceConnections, joinVoiceChannel, validateDiscordOpusHead, version }; +export { AudioPlayer, type AudioPlayerBufferingState, AudioPlayerError, type AudioPlayerIdleState, type AudioPlayerPausedState, type AudioPlayerPlayingState, type AudioPlayerState, AudioPlayerStatus, AudioReceiveStream, type AudioReceiveStreamOptions, AudioResource, type ConnectionData, type ConnectionOptions, type CreateAudioPlayerOptions, type CreateAudioResourceOptions, type CreateVoiceConnectionOptions, DAVESession, type DiscordGatewayAdapterCreator, type DiscordGatewayAdapterImplementerMethods, type DiscordGatewayAdapterLibraryMethods, type Edge, type EndBehavior, EndBehaviorType, type JoinConfig, type JoinVoiceChannelOptions, Networking, type NetworkingClosedState, type NetworkingIdentifyingState, type NetworkingOpeningWsState, type NetworkingReadyState, type NetworkingResumingState, type NetworkingSelectingProtocolState, type NetworkingState, NetworkingStatusCode, type NetworkingUdpHandshakingState, NoSubscriberBehavior, Node, PlayerSubscription, type ProbeInfo, SSRCMap, type SocketConfig, SpeakingMap, StreamType, TransformerType, VoiceConnection, type VoiceConnectionConnectingState, type VoiceConnectionDestroyedState, VoiceConnectionDisconnectReason, type VoiceConnectionDisconnectedBaseState, type VoiceConnectionDisconnectedOtherState, type VoiceConnectionDisconnectedState, type VoiceConnectionDisconnectedWebSocketState, type VoiceConnectionReadyState, type VoiceConnectionSignallingState, type VoiceConnectionState, VoiceConnectionStatus, VoiceReceiver, VoiceUDPSocket, type VoiceUserData, VoiceWebSocket, createAudioPlayer, createAudioResource, createDefaultAudioReceiveStreamOptions, demuxProbe, entersState, generateDependencyReport, getGroups, getVoiceConnection, getVoiceConnections, joinVoiceChannel, validateDiscordOpusHead, version }; diff --git a/node_modules/@discordjs/voice/dist/index.js b/node_modules/@discordjs/voice/dist/index.js index c5dc0e9..e8f7a5e 100644 --- a/node_modules/@discordjs/voice/dist/index.js +++ b/node_modules/@discordjs/voice/dist/index.js @@ -29,23 +29,30 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/index.ts -var src_exports = {}; -__export(src_exports, { +var index_exports = {}; +__export(index_exports, { AudioPlayer: () => AudioPlayer, AudioPlayerError: () => AudioPlayerError, AudioPlayerStatus: () => AudioPlayerStatus, AudioReceiveStream: () => AudioReceiveStream, AudioResource: () => AudioResource, + DAVESession: () => DAVESession, EndBehaviorType: () => EndBehaviorType, + Networking: () => Networking, + NetworkingStatusCode: () => NetworkingStatusCode, NoSubscriberBehavior: () => NoSubscriberBehavior, + Node: () => Node, PlayerSubscription: () => PlayerSubscription, SSRCMap: () => SSRCMap, SpeakingMap: () => SpeakingMap, StreamType: () => StreamType, + TransformerType: () => TransformerType, VoiceConnection: () => VoiceConnection, VoiceConnectionDisconnectReason: () => VoiceConnectionDisconnectReason, VoiceConnectionStatus: () => VoiceConnectionStatus, VoiceReceiver: () => VoiceReceiver, + VoiceUDPSocket: () => VoiceUDPSocket, + VoiceWebSocket: () => VoiceWebSocket, createAudioPlayer: () => createAudioPlayer, createAudioResource: () => createAudioResource, createDefaultAudioReceiveStreamOptions: () => createDefaultAudioReceiveStreamOptions, @@ -59,10 +66,10 @@ __export(src_exports, { validateDiscordOpusHead: () => validateDiscordOpusHead, version: () => version2 }); -module.exports = __toCommonJS(src_exports); +module.exports = __toCommonJS(index_exports); // src/VoiceConnection.ts -var import_node_events7 = require("events"); +var import_node_events8 = require("events"); // src/DataStore.ts var import_v10 = require("discord-api-types/v10"); @@ -83,8 +90,7 @@ var groups = /* @__PURE__ */ new Map(); groups.set("default", /* @__PURE__ */ new Map()); function getOrCreateGroup(group) { const existing = groups.get(group); - if (existing) - return existing; + if (existing) return existing; const map = /* @__PURE__ */ new Map(); groups.set(group, map); return map; @@ -115,8 +121,7 @@ var audioCycleInterval; var nextTime = -1; var audioPlayers = []; function audioCycleStep() { - if (nextTime === -1) - return; + if (nextTime === -1) return; nextTime += FRAME_LENGTH; const available = audioPlayers.filter((player) => player.checkPlayable()); for (const player of available) { @@ -142,8 +147,7 @@ function hasAudioPlayer(target) { } __name(hasAudioPlayer, "hasAudioPlayer"); function addAudioPlayer(player) { - if (hasAudioPlayer(player)) - return player; + if (hasAudioPlayer(player)) return player; audioPlayers.push(player); if (audioPlayers.length === 1) { nextTime = Date.now(); @@ -154,755 +158,107 @@ function addAudioPlayer(player) { __name(addAudioPlayer, "addAudioPlayer"); function deleteAudioPlayer(player) { const index = audioPlayers.indexOf(player); - if (index === -1) - return; + if (index === -1) return; audioPlayers.splice(index, 1); if (audioPlayers.length === 0) { nextTime = -1; - if (audioCycleInterval !== void 0) - clearTimeout(audioCycleInterval); + if (audioCycleInterval !== void 0) clearTimeout(audioCycleInterval); } } __name(deleteAudioPlayer, "deleteAudioPlayer"); // src/networking/Networking.ts -var import_node_buffer3 = require("buffer"); -var import_node_events3 = require("events"); -var import_v42 = require("discord-api-types/voice/v4"); +var import_node_buffer6 = require("buffer"); +var import_node_crypto = __toESM(require("crypto")); +var import_node_events5 = require("events"); +var import_v82 = require("discord-api-types/voice/v8"); // src/util/Secretbox.ts var import_node_buffer = require("buffer"); var libs = { - "sodium-native": (sodium) => ({ - open: (buffer, nonce2, secretKey) => { - if (buffer) { - const output = import_node_buffer.Buffer.allocUnsafe(buffer.length - sodium.crypto_box_MACBYTES); - if (sodium.crypto_secretbox_open_easy(output, buffer, nonce2, secretKey)) - return output; - } - return null; + "sodium-native": /* @__PURE__ */ __name((sodium) => ({ + crypto_aead_xchacha20poly1305_ietf_decrypt: /* @__PURE__ */ __name((cipherText, additionalData, nonce2, key) => { + const message = import_node_buffer.Buffer.alloc(cipherText.length - sodium.crypto_aead_xchacha20poly1305_ietf_ABYTES); + sodium.crypto_aead_xchacha20poly1305_ietf_decrypt(message, null, cipherText, additionalData, nonce2, key); + return message; + }, "crypto_aead_xchacha20poly1305_ietf_decrypt"), + crypto_aead_xchacha20poly1305_ietf_encrypt: /* @__PURE__ */ __name((plaintext, additionalData, nonce2, key) => { + const cipherText = import_node_buffer.Buffer.alloc(plaintext.length + sodium.crypto_aead_xchacha20poly1305_ietf_ABYTES); + sodium.crypto_aead_xchacha20poly1305_ietf_encrypt(cipherText, plaintext, additionalData, null, nonce2, key); + return cipherText; + }, "crypto_aead_xchacha20poly1305_ietf_encrypt") + }), "sodium-native"), + sodium: /* @__PURE__ */ __name((sodium) => ({ + crypto_aead_xchacha20poly1305_ietf_decrypt: /* @__PURE__ */ __name((cipherText, additionalData, nonce2, key) => sodium.api.crypto_aead_xchacha20poly1305_ietf_decrypt(cipherText, additionalData, null, nonce2, key), "crypto_aead_xchacha20poly1305_ietf_decrypt"), + crypto_aead_xchacha20poly1305_ietf_encrypt: /* @__PURE__ */ __name((plaintext, additionalData, nonce2, key) => sodium.api.crypto_aead_xchacha20poly1305_ietf_encrypt(plaintext, additionalData, null, nonce2, key), "crypto_aead_xchacha20poly1305_ietf_encrypt") + }), "sodium"), + "libsodium-wrappers": /* @__PURE__ */ __name((sodium) => ({ + crypto_aead_xchacha20poly1305_ietf_decrypt: /* @__PURE__ */ __name((cipherText, additionalData, nonce2, key) => sodium.crypto_aead_xchacha20poly1305_ietf_decrypt(null, cipherText, additionalData, nonce2, key), "crypto_aead_xchacha20poly1305_ietf_decrypt"), + crypto_aead_xchacha20poly1305_ietf_encrypt: /* @__PURE__ */ __name((plaintext, additionalData, nonce2, key) => sodium.crypto_aead_xchacha20poly1305_ietf_encrypt(plaintext, additionalData, null, nonce2, key), "crypto_aead_xchacha20poly1305_ietf_encrypt") + }), "libsodium-wrappers"), + "@stablelib/xchacha20poly1305": /* @__PURE__ */ __name((stablelib) => ({ + crypto_aead_xchacha20poly1305_ietf_decrypt(plaintext, additionalData, nonce2, key) { + const crypto3 = new stablelib.XChaCha20Poly1305(key); + return crypto3.open(nonce2, plaintext, additionalData); }, - close: (opusPacket, nonce2, secretKey) => { - const output = import_node_buffer.Buffer.allocUnsafe(opusPacket.length + sodium.crypto_box_MACBYTES); - sodium.crypto_secretbox_easy(output, opusPacket, nonce2, secretKey); - return output; + crypto_aead_xchacha20poly1305_ietf_encrypt(cipherText, additionalData, nonce2, key) { + const crypto3 = new stablelib.XChaCha20Poly1305(key); + return crypto3.seal(nonce2, cipherText, additionalData); + } + }), "@stablelib/xchacha20poly1305"), + "@noble/ciphers/chacha": /* @__PURE__ */ __name((noble) => ({ + crypto_aead_xchacha20poly1305_ietf_decrypt(cipherText, additionalData, nonce2, key) { + const chacha = noble.xchacha20poly1305(key, nonce2, additionalData); + return chacha.decrypt(cipherText); }, - random: (num, buffer = import_node_buffer.Buffer.allocUnsafe(num)) => { - sodium.randombytes_buf(buffer); - return buffer; + crypto_aead_xchacha20poly1305_ietf_encrypt(plaintext, additionalData, nonce2, key) { + const chacha = noble.xchacha20poly1305(key, nonce2, additionalData); + return chacha.encrypt(plaintext); } - }), - sodium: (sodium) => ({ - open: sodium.api.crypto_secretbox_open_easy, - close: sodium.api.crypto_secretbox_easy, - random: (num, buffer = import_node_buffer.Buffer.allocUnsafe(num)) => { - sodium.api.randombytes_buf(buffer); - return buffer; - } - }), - "libsodium-wrappers": (sodium) => ({ - open: sodium.crypto_secretbox_open_easy, - close: sodium.crypto_secretbox_easy, - random: sodium.randombytes_buf - }), - tweetnacl: (tweetnacl) => ({ - open: tweetnacl.secretbox.open, - close: tweetnacl.secretbox, - random: tweetnacl.randomBytes - }) + }), "@noble/ciphers/chacha") }; var fallbackError = /* @__PURE__ */ __name(() => { throw new Error( `Cannot play audio as no valid encryption package is installed. -- Install sodium, libsodium-wrappers, or tweetnacl. +- Install one of: + - sodium + - libsodium-wrappers + - @stablelib/xchacha20poly1305 + - @noble/ciphers. - Use the generateDependencyReport() function for more information. ` ); }, "fallbackError"); var methods = { - open: fallbackError, - close: fallbackError, - random: fallbackError + crypto_aead_xchacha20poly1305_ietf_encrypt: fallbackError, + crypto_aead_xchacha20poly1305_ietf_decrypt: fallbackError }; -void (async () => { +var secretboxLoadPromise = new Promise(async (resolve2) => { for (const libName of Object.keys(libs)) { try { - const lib = require(libName); - if (libName === "libsodium-wrappers" && lib.ready) + const lib = await import(libName); + if (libName === "libsodium-wrappers" && lib.ready) { await lib.ready; + } Object.assign(methods, libs[libName](lib)); break; } catch { } } -})(); + resolve2(); +}); // src/util/util.ts var noop = /* @__PURE__ */ __name(() => { }, "noop"); -// src/networking/VoiceUDPSocket.ts -var import_node_buffer2 = require("buffer"); -var import_node_dgram = require("dgram"); -var import_node_events = require("events"); -var import_node_net = require("net"); -function parseLocalPacket(message) { - const packet = import_node_buffer2.Buffer.from(message); - const ip = packet.slice(8, packet.indexOf(0, 8)).toString("utf8"); - if (!(0, import_node_net.isIPv4)(ip)) { - throw new Error("Malformed IP address"); - } - const port = packet.readUInt16BE(packet.length - 2); - return { ip, port }; -} -__name(parseLocalPacket, "parseLocalPacket"); -var KEEP_ALIVE_INTERVAL = 5e3; -var MAX_COUNTER_VALUE = 2 ** 32 - 1; -var VoiceUDPSocket = class extends import_node_events.EventEmitter { - static { - __name(this, "VoiceUDPSocket"); - } - /** - * The underlying network Socket for the VoiceUDPSocket. - */ - socket; - /** - * The socket details for Discord (remote) - */ - remote; - /** - * The counter used in the keep alive mechanism. - */ - keepAliveCounter = 0; - /** - * The buffer used to write the keep alive counter into. - */ - keepAliveBuffer; - /** - * The Node.js interval for the keep-alive mechanism. - */ - keepAliveInterval; - /** - * The time taken to receive a response to keep alive messages. - * - * @deprecated This field is no longer updated as keep alive messages are no longer tracked. - */ - ping; - /** - * Creates a new VoiceUDPSocket. - * - * @param remote - Details of the remote socket - */ - constructor(remote) { - super(); - this.socket = (0, import_node_dgram.createSocket)("udp4"); - this.socket.on("error", (error) => this.emit("error", error)); - this.socket.on("message", (buffer) => this.onMessage(buffer)); - this.socket.on("close", () => this.emit("close")); - this.remote = remote; - this.keepAliveBuffer = import_node_buffer2.Buffer.alloc(8); - this.keepAliveInterval = setInterval(() => this.keepAlive(), KEEP_ALIVE_INTERVAL); - setImmediate(() => this.keepAlive()); - } - /** - * Called when a message is received on the UDP socket. - * - * @param buffer - The received buffer - */ - onMessage(buffer) { - this.emit("message", buffer); - } - /** - * Called at a regular interval to check whether we are still able to send datagrams to Discord. - */ - keepAlive() { - this.keepAliveBuffer.writeUInt32LE(this.keepAliveCounter, 0); - this.send(this.keepAliveBuffer); - this.keepAliveCounter++; - if (this.keepAliveCounter > MAX_COUNTER_VALUE) { - this.keepAliveCounter = 0; - } - } - /** - * Sends a buffer to Discord. - * - * @param buffer - The buffer to send - */ - send(buffer) { - this.socket.send(buffer, this.remote.port, this.remote.ip); - } - /** - * Closes the socket, the instance will not be able to be reused. - */ - destroy() { - try { - this.socket.close(); - } catch { - } - clearInterval(this.keepAliveInterval); - } - /** - * Performs IP discovery to discover the local address and port to be used for the voice connection. - * - * @param ssrc - The SSRC received from Discord - */ - async performIPDiscovery(ssrc) { - return new Promise((resolve2, reject) => { - const listener = /* @__PURE__ */ __name((message) => { - try { - if (message.readUInt16BE(0) !== 2) - return; - const packet = parseLocalPacket(message); - this.socket.off("message", listener); - resolve2(packet); - } catch { - } - }, "listener"); - this.socket.on("message", listener); - this.socket.once("close", () => reject(new Error("Cannot perform IP discovery - socket closed"))); - const discoveryBuffer = import_node_buffer2.Buffer.alloc(74); - discoveryBuffer.writeUInt16BE(1, 0); - discoveryBuffer.writeUInt16BE(70, 2); - discoveryBuffer.writeUInt32BE(ssrc, 4); - this.send(discoveryBuffer); - }); - } -}; - -// src/networking/VoiceWebSocket.ts +// src/networking/DAVESession.ts +var import_node_buffer3 = require("buffer"); var import_node_events2 = require("events"); -var import_v4 = require("discord-api-types/voice/v4"); -var import_ws = __toESM(require("ws")); -var VoiceWebSocket = class extends import_node_events2.EventEmitter { - static { - __name(this, "VoiceWebSocket"); - } - /** - * The current heartbeat interval, if any. - */ - heartbeatInterval; - /** - * The time (milliseconds since UNIX epoch) that the last heartbeat acknowledgement packet was received. - * This is set to 0 if an acknowledgement packet hasn't been received yet. - */ - lastHeartbeatAck; - /** - * The time (milliseconds since UNIX epoch) that the last heartbeat was sent. This is set to 0 if a heartbeat - * hasn't been sent yet. - */ - lastHeartbeatSend; - /** - * The number of consecutively missed heartbeats. - */ - missedHeartbeats = 0; - /** - * The last recorded ping. - */ - ping; - /** - * The debug logger function, if debugging is enabled. - */ - debug; - /** - * The underlying WebSocket of this wrapper. - */ - ws; - /** - * Creates a new VoiceWebSocket. - * - * @param address - The address to connect to - */ - constructor(address, debug) { - super(); - this.ws = new import_ws.default(address); - this.ws.onmessage = (err) => this.onMessage(err); - this.ws.onopen = (err) => this.emit("open", err); - this.ws.onerror = (err) => this.emit("error", err instanceof Error ? err : err.error); - this.ws.onclose = (err) => this.emit("close", err); - this.lastHeartbeatAck = 0; - this.lastHeartbeatSend = 0; - this.debug = debug ? (message) => this.emit("debug", message) : null; - } - /** - * Destroys the VoiceWebSocket. The heartbeat interval is cleared, and the connection is closed. - */ - destroy() { - try { - this.debug?.("destroyed"); - this.setHeartbeatInterval(-1); - this.ws.close(1e3); - } catch (error) { - const err = error; - this.emit("error", err); - } - } - /** - * Handles message events on the WebSocket. Attempts to JSON parse the messages and emit them - * as packets. - * - * @param event - The message event - */ - onMessage(event) { - if (typeof event.data !== "string") - return; - this.debug?.(`<< ${event.data}`); - let packet; - try { - packet = JSON.parse(event.data); - } catch (error) { - const err = error; - this.emit("error", err); - return; - } - if (packet.op === import_v4.VoiceOpcodes.HeartbeatAck) { - this.lastHeartbeatAck = Date.now(); - this.missedHeartbeats = 0; - this.ping = this.lastHeartbeatAck - this.lastHeartbeatSend; - } - this.emit("packet", packet); - } - /** - * Sends a JSON-stringifiable packet over the WebSocket. - * - * @param packet - The packet to send - */ - sendPacket(packet) { - try { - const stringified = JSON.stringify(packet); - this.debug?.(`>> ${stringified}`); - this.ws.send(stringified); - } catch (error) { - const err = error; - this.emit("error", err); - } - } - /** - * Sends a heartbeat over the WebSocket. - */ - sendHeartbeat() { - this.lastHeartbeatSend = Date.now(); - this.missedHeartbeats++; - const nonce2 = this.lastHeartbeatSend; - this.sendPacket({ - op: import_v4.VoiceOpcodes.Heartbeat, - // eslint-disable-next-line id-length - d: nonce2 - }); - } - /** - * Sets/clears an interval to send heartbeats over the WebSocket. - * - * @param ms - The interval in milliseconds. If negative, the interval will be unset - */ - setHeartbeatInterval(ms) { - if (this.heartbeatInterval !== void 0) - clearInterval(this.heartbeatInterval); - if (ms > 0) { - this.heartbeatInterval = setInterval(() => { - if (this.lastHeartbeatSend !== 0 && this.missedHeartbeats >= 3) { - this.ws.close(); - this.setHeartbeatInterval(-1); - } - this.sendHeartbeat(); - }, ms); - } - } -}; - -// src/networking/Networking.ts -var CHANNELS = 2; -var TIMESTAMP_INC = 48e3 / 100 * CHANNELS; -var MAX_NONCE_SIZE = 2 ** 32 - 1; -var SUPPORTED_ENCRYPTION_MODES = ["xsalsa20_poly1305_lite", "xsalsa20_poly1305_suffix", "xsalsa20_poly1305"]; -var nonce = import_node_buffer3.Buffer.alloc(24); -function stringifyState(state) { - return JSON.stringify({ - ...state, - ws: Reflect.has(state, "ws"), - udp: Reflect.has(state, "udp") - }); -} -__name(stringifyState, "stringifyState"); -function chooseEncryptionMode(options) { - const option = options.find((option2) => SUPPORTED_ENCRYPTION_MODES.includes(option2)); - if (!option) { - throw new Error(`No compatible encryption modes. Available include: ${options.join(", ")}`); - } - return option; -} -__name(chooseEncryptionMode, "chooseEncryptionMode"); -function randomNBit(numberOfBits) { - return Math.floor(Math.random() * 2 ** numberOfBits); -} -__name(randomNBit, "randomNBit"); -var Networking = class extends import_node_events3.EventEmitter { - static { - __name(this, "Networking"); - } - _state; - /** - * The debug logger function, if debugging is enabled. - */ - debug; - /** - * Creates a new Networking instance. - */ - constructor(options, debug) { - super(); - this.onWsOpen = this.onWsOpen.bind(this); - this.onChildError = this.onChildError.bind(this); - this.onWsPacket = this.onWsPacket.bind(this); - this.onWsClose = this.onWsClose.bind(this); - this.onWsDebug = this.onWsDebug.bind(this); - this.onUdpDebug = this.onUdpDebug.bind(this); - this.onUdpClose = this.onUdpClose.bind(this); - this.debug = debug ? (message) => this.emit("debug", message) : null; - this._state = { - code: 0 /* OpeningWs */, - ws: this.createWebSocket(options.endpoint), - connectionOptions: options - }; - } - /** - * Destroys the Networking instance, transitioning it into the Closed state. - */ - destroy() { - this.state = { - code: 6 /* Closed */ - }; - } - /** - * The current state of the networking instance. - */ - get state() { - return this._state; - } - /** - * Sets a new state for the networking instance, performing clean-up operations where necessary. - */ - set state(newState) { - const oldWs = Reflect.get(this._state, "ws"); - const newWs = Reflect.get(newState, "ws"); - if (oldWs && oldWs !== newWs) { - oldWs.off("debug", this.onWsDebug); - oldWs.on("error", noop); - oldWs.off("error", this.onChildError); - oldWs.off("open", this.onWsOpen); - oldWs.off("packet", this.onWsPacket); - oldWs.off("close", this.onWsClose); - oldWs.destroy(); - } - const oldUdp = Reflect.get(this._state, "udp"); - const newUdp = Reflect.get(newState, "udp"); - if (oldUdp && oldUdp !== newUdp) { - oldUdp.on("error", noop); - oldUdp.off("error", this.onChildError); - oldUdp.off("close", this.onUdpClose); - oldUdp.off("debug", this.onUdpDebug); - oldUdp.destroy(); - } - const oldState = this._state; - this._state = newState; - this.emit("stateChange", oldState, newState); - this.debug?.(`state change: -from ${stringifyState(oldState)} -to ${stringifyState(newState)}`); - } - /** - * Creates a new WebSocket to a Discord Voice gateway. - * - * @param endpoint - The endpoint to connect to - */ - createWebSocket(endpoint) { - const ws = new VoiceWebSocket(`wss://${endpoint}?v=4`, Boolean(this.debug)); - ws.on("error", this.onChildError); - ws.once("open", this.onWsOpen); - ws.on("packet", this.onWsPacket); - ws.once("close", this.onWsClose); - ws.on("debug", this.onWsDebug); - return ws; - } - /** - * Propagates errors from the children VoiceWebSocket and VoiceUDPSocket. - * - * @param error - The error that was emitted by a child - */ - onChildError(error) { - this.emit("error", error); - } - /** - * Called when the WebSocket opens. Depending on the state that the instance is in, - * it will either identify with a new session, or it will attempt to resume an existing session. - */ - onWsOpen() { - if (this.state.code === 0 /* OpeningWs */) { - const packet = { - op: import_v42.VoiceOpcodes.Identify, - d: { - server_id: this.state.connectionOptions.serverId, - user_id: this.state.connectionOptions.userId, - session_id: this.state.connectionOptions.sessionId, - token: this.state.connectionOptions.token - } - }; - this.state.ws.sendPacket(packet); - this.state = { - ...this.state, - code: 1 /* Identifying */ - }; - } else if (this.state.code === 5 /* Resuming */) { - const packet = { - op: import_v42.VoiceOpcodes.Resume, - d: { - server_id: this.state.connectionOptions.serverId, - session_id: this.state.connectionOptions.sessionId, - token: this.state.connectionOptions.token - } - }; - this.state.ws.sendPacket(packet); - } - } - /** - * Called when the WebSocket closes. Based on the reason for closing (given by the code parameter), - * the instance will either attempt to resume, or enter the closed state and emit a 'close' event - * with the close code, allowing the user to decide whether or not they would like to reconnect. - * - * @param code - The close code - */ - onWsClose({ code }) { - const canResume = code === 4015 || code < 4e3; - if (canResume && this.state.code === 4 /* Ready */) { - this.state = { - ...this.state, - code: 5 /* Resuming */, - ws: this.createWebSocket(this.state.connectionOptions.endpoint) - }; - } else if (this.state.code !== 6 /* Closed */) { - this.destroy(); - this.emit("close", code); - } - } - /** - * Called when the UDP socket has closed itself if it has stopped receiving replies from Discord. - */ - onUdpClose() { - if (this.state.code === 4 /* Ready */) { - this.state = { - ...this.state, - code: 5 /* Resuming */, - ws: this.createWebSocket(this.state.connectionOptions.endpoint) - }; - } - } - /** - * Called when a packet is received on the connection's WebSocket. - * - * @param packet - The received packet - */ - onWsPacket(packet) { - if (packet.op === import_v42.VoiceOpcodes.Hello && this.state.code !== 6 /* Closed */) { - this.state.ws.setHeartbeatInterval(packet.d.heartbeat_interval); - } else if (packet.op === import_v42.VoiceOpcodes.Ready && this.state.code === 1 /* Identifying */) { - const { ip, port, ssrc, modes } = packet.d; - const udp = new VoiceUDPSocket({ ip, port }); - udp.on("error", this.onChildError); - udp.on("debug", this.onUdpDebug); - udp.once("close", this.onUdpClose); - udp.performIPDiscovery(ssrc).then((localConfig) => { - if (this.state.code !== 2 /* UdpHandshaking */) - return; - this.state.ws.sendPacket({ - op: import_v42.VoiceOpcodes.SelectProtocol, - d: { - protocol: "udp", - data: { - address: localConfig.ip, - port: localConfig.port, - mode: chooseEncryptionMode(modes) - } - } - }); - this.state = { - ...this.state, - code: 3 /* SelectingProtocol */ - }; - }).catch((error) => this.emit("error", error)); - this.state = { - ...this.state, - code: 2 /* UdpHandshaking */, - udp, - connectionData: { - ssrc - } - }; - } else if (packet.op === import_v42.VoiceOpcodes.SessionDescription && this.state.code === 3 /* SelectingProtocol */) { - const { mode: encryptionMode, secret_key: secretKey } = packet.d; - this.state = { - ...this.state, - code: 4 /* Ready */, - connectionData: { - ...this.state.connectionData, - encryptionMode, - secretKey: new Uint8Array(secretKey), - sequence: randomNBit(16), - timestamp: randomNBit(32), - nonce: 0, - nonceBuffer: import_node_buffer3.Buffer.alloc(24), - speaking: false, - packetsPlayed: 0 - } - }; - } else if (packet.op === import_v42.VoiceOpcodes.Resumed && this.state.code === 5 /* Resuming */) { - this.state = { - ...this.state, - code: 4 /* Ready */ - }; - this.state.connectionData.speaking = false; - } - } - /** - * Propagates debug messages from the child WebSocket. - * - * @param message - The emitted debug message - */ - onWsDebug(message) { - this.debug?.(`[WS] ${message}`); - } - /** - * Propagates debug messages from the child UDPSocket. - * - * @param message - The emitted debug message - */ - onUdpDebug(message) { - this.debug?.(`[UDP] ${message}`); - } - /** - * Prepares an Opus packet for playback. This includes attaching metadata to it and encrypting it. - * It will be stored within the instance, and can be played by dispatchAudio() - * - * @remarks - * Calling this method while there is already a prepared audio packet that has not yet been dispatched - * will overwrite the existing audio packet. This should be avoided. - * @param opusPacket - The Opus packet to encrypt - * @returns The audio packet that was prepared - */ - prepareAudioPacket(opusPacket) { - const state = this.state; - if (state.code !== 4 /* Ready */) - return; - state.preparedPacket = this.createAudioPacket(opusPacket, state.connectionData); - return state.preparedPacket; - } - /** - * Dispatches the audio packet previously prepared by prepareAudioPacket(opusPacket). The audio packet - * is consumed and cannot be dispatched again. - */ - dispatchAudio() { - const state = this.state; - if (state.code !== 4 /* Ready */) - return false; - if (state.preparedPacket !== void 0) { - this.playAudioPacket(state.preparedPacket); - state.preparedPacket = void 0; - return true; - } - return false; - } - /** - * Plays an audio packet, updating timing metadata used for playback. - * - * @param audioPacket - The audio packet to play - */ - playAudioPacket(audioPacket) { - const state = this.state; - if (state.code !== 4 /* Ready */) - return; - const { connectionData } = state; - connectionData.packetsPlayed++; - connectionData.sequence++; - connectionData.timestamp += TIMESTAMP_INC; - if (connectionData.sequence >= 2 ** 16) - connectionData.sequence = 0; - if (connectionData.timestamp >= 2 ** 32) - connectionData.timestamp = 0; - this.setSpeaking(true); - state.udp.send(audioPacket); - } - /** - * Sends a packet to the voice gateway indicating that the client has start/stopped sending - * audio. - * - * @param speaking - Whether or not the client should be shown as speaking - */ - setSpeaking(speaking) { - const state = this.state; - if (state.code !== 4 /* Ready */) - return; - if (state.connectionData.speaking === speaking) - return; - state.connectionData.speaking = speaking; - state.ws.sendPacket({ - op: import_v42.VoiceOpcodes.Speaking, - d: { - speaking: speaking ? 1 : 0, - delay: 0, - ssrc: state.connectionData.ssrc - } - }); - } - /** - * Creates a new audio packet from an Opus packet. This involves encrypting the packet, - * then prepending a header that includes metadata. - * - * @param opusPacket - The Opus packet to prepare - * @param connectionData - The current connection data of the instance - */ - createAudioPacket(opusPacket, connectionData) { - const packetBuffer = import_node_buffer3.Buffer.alloc(12); - packetBuffer[0] = 128; - packetBuffer[1] = 120; - const { sequence, timestamp, ssrc } = connectionData; - packetBuffer.writeUIntBE(sequence, 2, 2); - packetBuffer.writeUIntBE(timestamp, 4, 4); - packetBuffer.writeUIntBE(ssrc, 8, 4); - packetBuffer.copy(nonce, 0, 0, 12); - return import_node_buffer3.Buffer.concat([packetBuffer, ...this.encryptOpusPacket(opusPacket, connectionData)]); - } - /** - * Encrypts an Opus packet using the format agreed upon by the instance and Discord. - * - * @param opusPacket - The Opus packet to encrypt - * @param connectionData - The current connection data of the instance - */ - encryptOpusPacket(opusPacket, connectionData) { - const { secretKey, encryptionMode } = connectionData; - if (encryptionMode === "xsalsa20_poly1305_lite") { - connectionData.nonce++; - if (connectionData.nonce > MAX_NONCE_SIZE) - connectionData.nonce = 0; - connectionData.nonceBuffer.writeUInt32BE(connectionData.nonce, 0); - return [ - methods.close(opusPacket, connectionData.nonceBuffer, secretKey), - connectionData.nonceBuffer.slice(0, 4) - ]; - } else if (encryptionMode === "xsalsa20_poly1305_suffix") { - const random = methods.random(24, connectionData.nonceBuffer); - return [methods.close(opusPacket, random, secretKey), random]; - } - return [methods.close(opusPacket, nonce, secretKey)]; - } -}; - -// src/receive/VoiceReceiver.ts -var import_node_buffer5 = require("buffer"); -var import_v43 = require("discord-api-types/voice/v4"); - -// src/receive/AudioReceiveStream.ts -var import_node_stream = require("stream"); // src/audio/AudioPlayer.ts -var import_node_buffer4 = require("buffer"); -var import_node_events4 = require("events"); +var import_node_buffer2 = require("buffer"); +var import_node_events = require("events"); // src/audio/AudioPlayerError.ts var AudioPlayerError = class extends Error { @@ -949,7 +305,7 @@ var PlayerSubscription = class { }; // src/audio/AudioPlayer.ts -var SILENCE_FRAME = import_node_buffer4.Buffer.from([248, 255, 254]); +var SILENCE_FRAME = import_node_buffer2.Buffer.from([248, 255, 254]); var NoSubscriberBehavior = /* @__PURE__ */ ((NoSubscriberBehavior2) => { NoSubscriberBehavior2["Pause"] = "pause"; NoSubscriberBehavior2["Play"] = "play"; @@ -964,15 +320,15 @@ var AudioPlayerStatus = /* @__PURE__ */ ((AudioPlayerStatus2) => { AudioPlayerStatus2["Playing"] = "playing"; return AudioPlayerStatus2; })(AudioPlayerStatus || {}); -function stringifyState2(state) { +function stringifyState(state) { return JSON.stringify({ ...state, resource: Reflect.has(state, "resource"), stepTimeout: Reflect.has(state, "stepTimeout") }); } -__name(stringifyState2, "stringifyState"); -var AudioPlayer = class extends import_node_events4.EventEmitter { +__name(stringifyState, "stringifyState"); +var AudioPlayer = class extends import_node_events.EventEmitter { static { __name(this, "AudioPlayer"); } @@ -1053,13 +409,13 @@ var AudioPlayer = class extends import_node_events4.EventEmitter { } /** * The state that the player is in. + * + * @remarks + * The setter will perform clean-up operations where necessary. */ get state() { return this._state; } - /** - * Sets a new state for the player, performing clean-up operations where necessary. - */ set state(newState) { const oldState = this._state; const newResource = Reflect.get(newState, "resource"); @@ -1090,8 +446,8 @@ var AudioPlayer = class extends import_node_events4.EventEmitter { this.emit(newState.status, oldState, this._state); } this.debug?.(`state change: -from ${stringifyState2(oldState)} -to ${stringifyState2(newState)}`); +from ${stringifyState(oldState)} +to ${stringifyState(newState)}`); } /** * Plays a new resource on the player. If the player is already playing a resource, the existing resource is destroyed @@ -1175,8 +531,7 @@ to ${stringifyState2(newState)}`); * @returns `true` if the player was successfully paused, otherwise `false` */ pause(interpolateSilence = true) { - if (this.state.status !== "playing" /* Playing */) - return false; + if (this.state.status !== "playing" /* Playing */) return false; this.state = { ...this.state, status: "paused" /* Paused */, @@ -1190,8 +545,7 @@ to ${stringifyState2(newState)}`); * @returns `true` if the player was successfully unpaused, otherwise `false` */ unpause() { - if (this.state.status !== "paused" /* Paused */) - return false; + if (this.state.status !== "paused" /* Paused */) return false; this.state = { ...this.state, status: "playing" /* Playing */, @@ -1207,8 +561,7 @@ to ${stringifyState2(newState)}`); * @returns `true` if the player will come to a stop, otherwise `false` */ stop(force = false) { - if (this.state.status === "idle" /* Idle */) - return false; + if (this.state.status === "idle" /* Idle */) return false; if (force || this.state.resource.silencePaddingFrames === 0) { this.state = { status: "idle" /* Idle */ @@ -1225,8 +578,7 @@ to ${stringifyState2(newState)}`); */ checkPlayable() { const state = this._state; - if (state.status === "idle" /* Idle */ || state.status === "buffering" /* Buffering */) - return false; + if (state.status === "idle" /* Idle */ || state.status === "buffering" /* Buffering */) return false; if (!state.resource.readable) { this.state = { status: "idle" /* Idle */ @@ -1242,8 +594,7 @@ to ${stringifyState2(newState)}`); // @ts-ignore _stepDispatch() { const state = this._state; - if (state.status === "idle" /* Idle */ || state.status === "buffering" /* Buffering */) - return; + if (state.status === "idle" /* Idle */ || state.status === "buffering" /* Buffering */) return; for (const connection of this.playable) { connection.dispatchAudio(); } @@ -1256,8 +607,7 @@ to ${stringifyState2(newState)}`); // @ts-ignore _stepPrepare() { const state = this._state; - if (state.status === "idle" /* Idle */ || state.status === "buffering" /* Buffering */) - return; + if (state.status === "idle" /* Idle */ || state.status === "buffering" /* Buffering */) return; const playable = this.playable; if (state.status === "autopaused" /* AutoPaused */ && playable.length > 0) { this.state = { @@ -1330,7 +680,1180 @@ function createAudioPlayer(options) { } __name(createAudioPlayer, "createAudioPlayer"); +// src/networking/DAVESession.ts +var Davey = null; +var TRANSITION_EXPIRY = 10; +var TRANSITION_EXPIRY_PENDING_DOWNGRADE = 24; +var DEFAULT_DECRYPTION_FAILURE_TOLERANCE = 36; +var daveLoadPromise = new Promise(async (resolve2) => { + try { + const lib = await import("@snazzah/davey"); + Davey = lib; + } catch { + } + resolve2(); +}); +function getMaxProtocolVersion() { + return Davey?.DAVE_PROTOCOL_VERSION; +} +__name(getMaxProtocolVersion, "getMaxProtocolVersion"); +var DAVESession = class extends import_node_events2.EventEmitter { + static { + __name(this, "DAVESession"); + } + /** + * The channel id represented by this session. + */ + channelId; + /** + * The user id represented by this session. + */ + userId; + /** + * The protocol version being used. + */ + protocolVersion; + /** + * The last transition id executed. + */ + lastTransitionId; + /** + * The pending transition. + */ + pendingTransition; + /** + * Whether this session was downgraded previously. + */ + downgraded = false; + /** + * The amount of consecutive failures encountered when decrypting. + */ + consecutiveFailures = 0; + /** + * The amount of consecutive failures needed to attempt to recover. + */ + failureTolerance; + /** + * Whether this session is currently re-initializing due to an invalid transition. + */ + reinitializing = false; + /** + * The underlying DAVE Session of this wrapper. + */ + session; + constructor(protocolVersion, userId, channelId, options) { + if (Davey === null) + throw new Error( + `Cannot utilize the DAVE protocol as the @snazzah/davey package has not been installed. +- Use the generateDependencyReport() function for more information. +` + ); + super(); + this.protocolVersion = protocolVersion; + this.userId = userId; + this.channelId = channelId; + this.failureTolerance = options.decryptionFailureTolerance ?? DEFAULT_DECRYPTION_FAILURE_TOLERANCE; + } + /** + * The current voice privacy code of the session. Will be `null` if there is no session. + */ + get voicePrivacyCode() { + if (this.protocolVersion === 0 || !this.session?.voicePrivacyCode) { + return null; + } + return this.session.voicePrivacyCode; + } + /** + * Gets the verification code for a user in the session. + * + * @throws Will throw if there is not an active session or the user id provided is invalid or not in the session. + */ + async getVerificationCode(userId) { + if (!this.session) throw new Error("Session not available"); + return this.session.getVerificationCode(userId); + } + /** + * Re-initializes (or initializes) the underlying session. + */ + reinit() { + if (this.protocolVersion > 0) { + if (this.session) { + this.session.reinit(this.protocolVersion, this.userId, this.channelId); + this.emit("debug", `Session reinitialized for protocol version ${this.protocolVersion}`); + } else { + this.session = new Davey.DAVESession(this.protocolVersion, this.userId, this.channelId); + this.emit("debug", `Session initialized for protocol version ${this.protocolVersion}`); + } + this.emit("keyPackage", this.session.getSerializedKeyPackage()); + } else if (this.session) { + this.session.reset(); + this.session.setPassthroughMode(true, TRANSITION_EXPIRY); + this.emit("debug", "Session reset"); + } + } + /** + * Set the external sender for this session. + * + * @param externalSender - The external sender + */ + setExternalSender(externalSender) { + if (!this.session) throw new Error("No session available"); + this.session.setExternalSender(externalSender); + this.emit("debug", "Set MLS external sender"); + } + /** + * Prepare for a transition. + * + * @param data - The transition data + * @returns Whether we should signal to the voice server that we are ready + */ + prepareTransition(data) { + this.emit("debug", `Preparing for transition (${data.transition_id}, v${data.protocol_version})`); + this.pendingTransition = data; + if (data.transition_id === 0) { + this.executeTransition(data.transition_id); + } else { + if (data.protocol_version === 0) this.session?.setPassthroughMode(true, TRANSITION_EXPIRY_PENDING_DOWNGRADE); + return true; + } + return false; + } + /** + * Execute a transition. + * + * @param transitionId - The transition id to execute on + */ + executeTransition(transitionId) { + this.emit("debug", `Executing transition (${transitionId})`); + if (!this.pendingTransition) { + this.emit("debug", `Received execute transition, but we don't have a pending transition for ${transitionId}`); + return; + } + let transitioned = false; + if (transitionId === this.pendingTransition.transition_id) { + const oldVersion = this.protocolVersion; + this.protocolVersion = this.pendingTransition.protocol_version; + if (oldVersion !== this.protocolVersion && this.protocolVersion === 0) { + this.downgraded = true; + this.emit("debug", "Session downgraded"); + } else if (transitionId > 0 && this.downgraded) { + this.downgraded = false; + this.session?.setPassthroughMode(true, TRANSITION_EXPIRY); + this.emit("debug", "Session upgraded"); + } + transitioned = true; + this.reinitializing = false; + this.lastTransitionId = transitionId; + this.emit("debug", `Transition executed (v${oldVersion} -> v${this.protocolVersion}, id: ${transitionId})`); + } else { + this.emit( + "debug", + `Received execute transition for an unexpected transition id (expected: ${this.pendingTransition.transition_id}, actual: ${transitionId})` + ); + } + this.pendingTransition = void 0; + return transitioned; + } + /** + * Prepare for a new epoch. + * + * @param data - The epoch data + */ + prepareEpoch(data) { + this.emit("debug", `Preparing for epoch (${data.epoch})`); + if (data.epoch === 1) { + this.protocolVersion = data.protocol_version; + this.reinit(); + } + } + /** + * Recover from an invalid transition by re-initializing. + * + * @param transitionId - The transition id to invalidate + */ + recoverFromInvalidTransition(transitionId) { + if (this.reinitializing) return; + this.emit("debug", `Invalidating transition ${transitionId}`); + this.reinitializing = true; + this.consecutiveFailures = 0; + this.emit("invalidateTransition", transitionId); + this.reinit(); + } + /** + * Processes proposals from the MLS group. + * + * @param payload - The binary message payload + * @param connectedClients - The set of connected client IDs + * @returns The payload to send back to the voice server, if there is one + */ + processProposals(payload, connectedClients) { + if (!this.session) throw new Error("No session available"); + const optype = payload.readUInt8(0); + const { commit, welcome } = this.session.processProposals( + optype, + payload.subarray(1), + Array.from(connectedClients) + ); + this.emit("debug", "MLS proposals processed"); + if (!commit) return; + return welcome ? import_node_buffer3.Buffer.concat([commit, welcome]) : commit; + } + /** + * Processes a commit from the MLS group. + * + * @param payload - The payload + * @returns The transaction id and whether it was successful + */ + processCommit(payload) { + if (!this.session) throw new Error("No session available"); + const transitionId = payload.readUInt16BE(0); + try { + this.session.processCommit(payload.subarray(2)); + if (transitionId === 0) { + this.reinitializing = false; + this.lastTransitionId = transitionId; + } else { + this.pendingTransition = { transition_id: transitionId, protocol_version: this.protocolVersion }; + } + this.emit("debug", `MLS commit processed (transition id: ${transitionId})`); + return { transitionId, success: true }; + } catch (error) { + this.emit("debug", `MLS commit errored from transition ${transitionId}: ${error}`); + this.recoverFromInvalidTransition(transitionId); + return { transitionId, success: false }; + } + } + /** + * Processes a welcome from the MLS group. + * + * @param payload - The payload + * @returns The transaction id and whether it was successful + */ + processWelcome(payload) { + if (!this.session) throw new Error("No session available"); + const transitionId = payload.readUInt16BE(0); + try { + this.session.processWelcome(payload.subarray(2)); + if (transitionId === 0) { + this.reinitializing = false; + this.lastTransitionId = transitionId; + } else { + this.pendingTransition = { transition_id: transitionId, protocol_version: this.protocolVersion }; + } + this.emit("debug", `MLS welcome processed (transition id: ${transitionId})`); + return { transitionId, success: true }; + } catch (error) { + this.emit("debug", `MLS welcome errored from transition ${transitionId}: ${error}`); + this.recoverFromInvalidTransition(transitionId); + return { transitionId, success: false }; + } + } + /** + * Encrypt a packet using end-to-end encryption. + * + * @param packet - The packet to encrypt + */ + encrypt(packet) { + if (this.protocolVersion === 0 || !this.session?.ready || packet.equals(SILENCE_FRAME)) return packet; + return this.session.encryptOpus(packet); + } + /** + * Decrypt a packet using end-to-end encryption. + * + * @param packet - The packet to decrypt + * @param userId - The user id that sent the packet + * @returns The decrypted packet, or `null` if the decryption failed but should be ignored + */ + decrypt(packet, userId) { + const canDecrypt = this.session?.ready && (this.protocolVersion !== 0 || this.session?.canPassthrough(userId)); + if (packet.equals(SILENCE_FRAME) || !canDecrypt || !this.session) return packet; + try { + const buffer = this.session.decrypt(userId, Davey.MediaType.AUDIO, packet); + this.consecutiveFailures = 0; + return buffer; + } catch (error) { + if (!this.reinitializing && !this.pendingTransition) { + this.consecutiveFailures++; + this.emit("debug", `Failed to decrypt a packet (${this.consecutiveFailures} consecutive fails)`); + if (this.consecutiveFailures > this.failureTolerance) { + if (this.lastTransitionId) this.recoverFromInvalidTransition(this.lastTransitionId); + else throw error; + } + } else if (this.reinitializing) { + this.emit("debug", "Failed to decrypt a packet (reinitializing session)"); + } else if (this.pendingTransition) { + this.emit( + "debug", + `Failed to decrypt a packet (pending transition ${this.pendingTransition.transition_id} to v${this.pendingTransition.protocol_version})` + ); + } + } + return null; + } + /** + * Resets the session. + */ + destroy() { + try { + this.session?.reset(); + } catch { + } + } +}; + +// src/networking/VoiceUDPSocket.ts +var import_node_buffer4 = require("buffer"); +var import_node_dgram = require("dgram"); +var import_node_events3 = require("events"); +var import_node_net = require("net"); +function parseLocalPacket(message) { + const packet = import_node_buffer4.Buffer.from(message); + const ip = packet.slice(8, packet.indexOf(0, 8)).toString("utf8"); + if (!(0, import_node_net.isIPv4)(ip)) { + throw new Error("Malformed IP address"); + } + const port = packet.readUInt16BE(packet.length - 2); + return { ip, port }; +} +__name(parseLocalPacket, "parseLocalPacket"); +var KEEP_ALIVE_INTERVAL = 5e3; +var MAX_COUNTER_VALUE = 2 ** 32 - 1; +var VoiceUDPSocket = class extends import_node_events3.EventEmitter { + static { + __name(this, "VoiceUDPSocket"); + } + /** + * The underlying network Socket for the VoiceUDPSocket. + */ + socket; + /** + * The socket details for Discord (remote) + */ + remote; + /** + * The counter used in the keep alive mechanism. + */ + keepAliveCounter = 0; + /** + * The buffer used to write the keep alive counter into. + */ + keepAliveBuffer; + /** + * The Node.js interval for the keep-alive mechanism. + */ + keepAliveInterval; + /** + * The time taken to receive a response to keep alive messages. + * + * @deprecated This field is no longer updated as keep alive messages are no longer tracked. + */ + ping; + /** + * Creates a new VoiceUDPSocket. + * + * @param remote - Details of the remote socket + */ + constructor(remote) { + super(); + this.socket = (0, import_node_dgram.createSocket)("udp4"); + this.socket.on("error", (error) => this.emit("error", error)); + this.socket.on("message", (buffer) => this.onMessage(buffer)); + this.socket.on("close", () => this.emit("close")); + this.remote = remote; + this.keepAliveBuffer = import_node_buffer4.Buffer.alloc(8); + this.keepAliveInterval = setInterval(() => this.keepAlive(), KEEP_ALIVE_INTERVAL); + setImmediate(() => this.keepAlive()); + } + /** + * Called when a message is received on the UDP socket. + * + * @param buffer - The received buffer + */ + onMessage(buffer) { + this.emit("message", buffer); + } + /** + * Called at a regular interval to check whether we are still able to send datagrams to Discord. + */ + keepAlive() { + this.keepAliveBuffer.writeUInt32LE(this.keepAliveCounter, 0); + this.send(this.keepAliveBuffer); + this.keepAliveCounter++; + if (this.keepAliveCounter > MAX_COUNTER_VALUE) { + this.keepAliveCounter = 0; + } + } + /** + * Sends a buffer to Discord. + * + * @param buffer - The buffer to send + */ + send(buffer) { + this.socket.send(buffer, this.remote.port, this.remote.ip); + } + /** + * Closes the socket, the instance will not be able to be reused. + */ + destroy() { + try { + this.socket.close(); + } catch { + } + clearInterval(this.keepAliveInterval); + } + /** + * Performs IP discovery to discover the local address and port to be used for the voice connection. + * + * @param ssrc - The SSRC received from Discord + */ + async performIPDiscovery(ssrc) { + return new Promise((resolve2, reject) => { + const listener = /* @__PURE__ */ __name((message) => { + try { + if (message.readUInt16BE(0) !== 2) return; + const packet = parseLocalPacket(message); + this.socket.off("message", listener); + resolve2(packet); + } catch { + } + }, "listener"); + this.socket.on("message", listener); + this.socket.once("close", () => reject(new Error("Cannot perform IP discovery - socket closed"))); + const discoveryBuffer = import_node_buffer4.Buffer.alloc(74); + discoveryBuffer.writeUInt16BE(1, 0); + discoveryBuffer.writeUInt16BE(70, 2); + discoveryBuffer.writeUInt32BE(ssrc, 4); + this.send(discoveryBuffer); + }); + } +}; + +// src/networking/VoiceWebSocket.ts +var import_node_buffer5 = require("buffer"); +var import_node_events4 = require("events"); +var import_v8 = require("discord-api-types/voice/v8"); +var import_ws = __toESM(require("ws")); +var VoiceWebSocket = class extends import_node_events4.EventEmitter { + static { + __name(this, "VoiceWebSocket"); + } + /** + * The current heartbeat interval, if any. + */ + heartbeatInterval; + /** + * The time (milliseconds since UNIX epoch) that the last heartbeat acknowledgement packet was received. + * This is set to 0 if an acknowledgement packet hasn't been received yet. + */ + lastHeartbeatAck; + /** + * The time (milliseconds since UNIX epoch) that the last heartbeat was sent. This is set to 0 if a heartbeat + * hasn't been sent yet. + */ + lastHeartbeatSend; + /** + * The number of consecutively missed heartbeats. + */ + missedHeartbeats = 0; + /** + * The last recorded ping. + */ + ping; + /** + * The last sequence number acknowledged from Discord. Will be `-1` if no sequence numbered messages have been received. + */ + sequence = -1; + /** + * The debug logger function, if debugging is enabled. + */ + debug; + /** + * The underlying WebSocket of this wrapper. + */ + ws; + /** + * Creates a new VoiceWebSocket. + * + * @param address - The address to connect to + */ + constructor(address, debug) { + super(); + this.ws = new import_ws.default(address); + this.ws.onmessage = (err) => this.onMessage(err); + this.ws.onopen = (err) => this.emit("open", err); + this.ws.onerror = (err) => this.emit("error", err instanceof Error ? err : err.error); + this.ws.onclose = (err) => this.emit("close", err); + this.lastHeartbeatAck = 0; + this.lastHeartbeatSend = 0; + this.debug = debug ? (message) => this.emit("debug", message) : null; + } + /** + * Destroys the VoiceWebSocket. The heartbeat interval is cleared, and the connection is closed. + */ + destroy() { + try { + this.debug?.("destroyed"); + this.setHeartbeatInterval(-1); + this.ws.close(1e3); + } catch (error) { + const err = error; + this.emit("error", err); + } + } + /** + * Handles message events on the WebSocket. Attempts to JSON parse the messages and emit them + * as packets. Binary messages will be parsed and emitted. + * + * @param event - The message event + */ + onMessage(event) { + if (event.data instanceof import_node_buffer5.Buffer || event.data instanceof ArrayBuffer) { + const buffer = event.data instanceof ArrayBuffer ? import_node_buffer5.Buffer.from(event.data) : event.data; + const seq = buffer.readUInt16BE(0); + const op = buffer.readUInt8(2); + const payload = buffer.subarray(3); + this.sequence = seq; + this.debug?.(`<< [bin] opcode ${op}, seq ${seq}, ${payload.byteLength} bytes`); + this.emit("binary", { op, seq, payload }); + return; + } else if (typeof event.data !== "string") { + return; + } + this.debug?.(`<< ${event.data}`); + let packet; + try { + packet = JSON.parse(event.data); + } catch (error) { + const err = error; + this.emit("error", err); + return; + } + if (packet.seq) { + this.sequence = packet.seq; + } + if (packet.op === import_v8.VoiceOpcodes.HeartbeatAck) { + this.lastHeartbeatAck = Date.now(); + this.missedHeartbeats = 0; + this.ping = this.lastHeartbeatAck - this.lastHeartbeatSend; + } + this.emit("packet", packet); + } + /** + * Sends a JSON-stringifiable packet over the WebSocket. + * + * @param packet - The packet to send + */ + sendPacket(packet) { + try { + const stringified = JSON.stringify(packet); + this.debug?.(`>> ${stringified}`); + this.ws.send(stringified); + } catch (error) { + const err = error; + this.emit("error", err); + } + } + /** + * Sends a binary message over the WebSocket. + * + * @param opcode - The opcode to use + * @param payload - The payload to send + */ + sendBinaryMessage(opcode, payload) { + try { + const message = import_node_buffer5.Buffer.concat([new Uint8Array([opcode]), payload]); + this.debug?.(`>> [bin] opcode ${opcode}, ${payload.byteLength} bytes`); + this.ws.send(message); + } catch (error) { + const err = error; + this.emit("error", err); + } + } + /** + * Sends a heartbeat over the WebSocket. + */ + sendHeartbeat() { + this.lastHeartbeatSend = Date.now(); + this.missedHeartbeats++; + const nonce2 = this.lastHeartbeatSend; + this.sendPacket({ + op: import_v8.VoiceOpcodes.Heartbeat, + // eslint-disable-next-line id-length + d: { + // eslint-disable-next-line id-length + t: nonce2, + seq_ack: this.sequence + } + }); + } + /** + * Sets/clears an interval to send heartbeats over the WebSocket. + * + * @param ms - The interval in milliseconds. If negative, the interval will be unset + */ + setHeartbeatInterval(ms) { + if (this.heartbeatInterval !== void 0) clearInterval(this.heartbeatInterval); + if (ms > 0) { + this.heartbeatInterval = setInterval(() => { + if (this.lastHeartbeatSend !== 0 && this.missedHeartbeats >= 3) { + this.ws.close(); + this.setHeartbeatInterval(-1); + } + this.sendHeartbeat(); + }, ms); + } + } +}; + +// src/networking/Networking.ts +var CHANNELS = 2; +var TIMESTAMP_INC = 48e3 / 100 * CHANNELS; +var MAX_NONCE_SIZE = 2 ** 32 - 1; +var SUPPORTED_ENCRYPTION_MODES = [import_v82.VoiceEncryptionMode.AeadXChaCha20Poly1305RtpSize]; +if (import_node_crypto.default.getCiphers().includes("aes-256-gcm")) { + SUPPORTED_ENCRYPTION_MODES.unshift(import_v82.VoiceEncryptionMode.AeadAes256GcmRtpSize); +} +var NetworkingStatusCode = /* @__PURE__ */ ((NetworkingStatusCode2) => { + NetworkingStatusCode2[NetworkingStatusCode2["OpeningWs"] = 0] = "OpeningWs"; + NetworkingStatusCode2[NetworkingStatusCode2["Identifying"] = 1] = "Identifying"; + NetworkingStatusCode2[NetworkingStatusCode2["UdpHandshaking"] = 2] = "UdpHandshaking"; + NetworkingStatusCode2[NetworkingStatusCode2["SelectingProtocol"] = 3] = "SelectingProtocol"; + NetworkingStatusCode2[NetworkingStatusCode2["Ready"] = 4] = "Ready"; + NetworkingStatusCode2[NetworkingStatusCode2["Resuming"] = 5] = "Resuming"; + NetworkingStatusCode2[NetworkingStatusCode2["Closed"] = 6] = "Closed"; + return NetworkingStatusCode2; +})(NetworkingStatusCode || {}); +var nonce = import_node_buffer6.Buffer.alloc(24); +function stringifyState2(state) { + return JSON.stringify({ + ...state, + ws: Reflect.has(state, "ws"), + udp: Reflect.has(state, "udp") + }); +} +__name(stringifyState2, "stringifyState"); +function chooseEncryptionMode(options) { + const option = options.find((option2) => SUPPORTED_ENCRYPTION_MODES.includes(option2)); + if (!option) { + throw new Error(`No compatible encryption modes. Available include: ${options.join(", ")}`); + } + return option; +} +__name(chooseEncryptionMode, "chooseEncryptionMode"); +function randomNBit(numberOfBits) { + return Math.floor(Math.random() * 2 ** numberOfBits); +} +__name(randomNBit, "randomNBit"); +var Networking = class extends import_node_events5.EventEmitter { + static { + __name(this, "Networking"); + } + _state; + /** + * The debug logger function, if debugging is enabled. + */ + debug; + /** + * The options used to create this Networking instance. + */ + options; + /** + * Creates a new Networking instance. + */ + constructor(connectionOptions, options) { + super(); + this.onWsOpen = this.onWsOpen.bind(this); + this.onChildError = this.onChildError.bind(this); + this.onWsPacket = this.onWsPacket.bind(this); + this.onWsBinary = this.onWsBinary.bind(this); + this.onWsClose = this.onWsClose.bind(this); + this.onWsDebug = this.onWsDebug.bind(this); + this.onUdpDebug = this.onUdpDebug.bind(this); + this.onUdpClose = this.onUdpClose.bind(this); + this.onDaveDebug = this.onDaveDebug.bind(this); + this.onDaveKeyPackage = this.onDaveKeyPackage.bind(this); + this.onDaveInvalidateTransition = this.onDaveInvalidateTransition.bind(this); + this.debug = options?.debug ? (message) => this.emit("debug", message) : null; + this._state = { + code: 0 /* OpeningWs */, + ws: this.createWebSocket(connectionOptions.endpoint), + connectionOptions + }; + this.options = options; + } + /** + * Destroys the Networking instance, transitioning it into the Closed state. + */ + destroy() { + this.state = { + code: 6 /* Closed */ + }; + } + /** + * The current state of the networking instance. + * + * @remarks + * The setter will perform clean-up operations where necessary. + */ + get state() { + return this._state; + } + set state(newState) { + const oldWs = Reflect.get(this._state, "ws"); + const newWs = Reflect.get(newState, "ws"); + if (oldWs && oldWs !== newWs) { + oldWs.off("debug", this.onWsDebug); + oldWs.on("error", noop); + oldWs.off("error", this.onChildError); + oldWs.off("open", this.onWsOpen); + oldWs.off("packet", this.onWsPacket); + oldWs.off("binary", this.onWsBinary); + oldWs.off("close", this.onWsClose); + oldWs.destroy(); + } + const oldUdp = Reflect.get(this._state, "udp"); + const newUdp = Reflect.get(newState, "udp"); + if (oldUdp && oldUdp !== newUdp) { + oldUdp.on("error", noop); + oldUdp.off("error", this.onChildError); + oldUdp.off("close", this.onUdpClose); + oldUdp.off("debug", this.onUdpDebug); + oldUdp.destroy(); + } + const oldDave = Reflect.get(this._state, "dave"); + const newDave = Reflect.get(newState, "dave"); + if (oldDave && oldDave !== newDave) { + oldDave.off("error", this.onChildError); + oldDave.off("debug", this.onDaveDebug); + oldDave.off("keyPackage", this.onDaveKeyPackage); + oldDave.off("invalidateTransition", this.onDaveInvalidateTransition); + oldDave.destroy(); + } + const oldState = this._state; + this._state = newState; + this.emit("stateChange", oldState, newState); + this.debug?.(`state change: +from ${stringifyState2(oldState)} +to ${stringifyState2(newState)}`); + } + /** + * Creates a new WebSocket to a Discord Voice gateway. + * + * @param endpoint - The endpoint to connect to + * @param lastSequence - The last sequence to set for this WebSocket + */ + createWebSocket(endpoint, lastSequence) { + const ws = new VoiceWebSocket(`wss://${endpoint}?v=8`, Boolean(this.debug)); + if (lastSequence !== void 0) { + ws.sequence = lastSequence; + } + ws.on("error", this.onChildError); + ws.once("open", this.onWsOpen); + ws.on("packet", this.onWsPacket); + ws.on("binary", this.onWsBinary); + ws.once("close", this.onWsClose); + ws.on("debug", this.onWsDebug); + return ws; + } + /** + * Creates a new DAVE session for this voice connection if we can create one. + * + * @param protocolVersion - The protocol version to use + */ + createDaveSession(protocolVersion) { + if (getMaxProtocolVersion() === null || this.options.daveEncryption === false || this.state.code !== 3 /* SelectingProtocol */ && this.state.code !== 4 /* Ready */ && this.state.code !== 5 /* Resuming */) { + return; + } + const session = new DAVESession( + protocolVersion, + this.state.connectionOptions.userId, + this.state.connectionOptions.channelId, + { + decryptionFailureTolerance: this.options.decryptionFailureTolerance + } + ); + session.on("error", this.onChildError); + session.on("debug", this.onDaveDebug); + session.on("keyPackage", this.onDaveKeyPackage); + session.on("invalidateTransition", this.onDaveInvalidateTransition); + session.reinit(); + return session; + } + /** + * Propagates errors from the children VoiceWebSocket, VoiceUDPSocket and DAVESession. + * + * @param error - The error that was emitted by a child + */ + onChildError(error) { + this.emit("error", error); + } + /** + * Called when the WebSocket opens. Depending on the state that the instance is in, + * it will either identify with a new session, or it will attempt to resume an existing session. + */ + onWsOpen() { + if (this.state.code === 0 /* OpeningWs */) { + this.state.ws.sendPacket({ + op: import_v82.VoiceOpcodes.Identify, + d: { + server_id: this.state.connectionOptions.serverId, + user_id: this.state.connectionOptions.userId, + session_id: this.state.connectionOptions.sessionId, + token: this.state.connectionOptions.token, + max_dave_protocol_version: this.options.daveEncryption === false ? 0 : getMaxProtocolVersion() ?? 0 + } + }); + this.state = { + ...this.state, + code: 1 /* Identifying */ + }; + } else if (this.state.code === 5 /* Resuming */) { + this.state.ws.sendPacket({ + op: import_v82.VoiceOpcodes.Resume, + d: { + server_id: this.state.connectionOptions.serverId, + session_id: this.state.connectionOptions.sessionId, + token: this.state.connectionOptions.token, + seq_ack: this.state.ws.sequence + } + }); + } + } + /** + * Called when the WebSocket closes. Based on the reason for closing (given by the code parameter), + * the instance will either attempt to resume, or enter the closed state and emit a 'close' event + * with the close code, allowing the user to decide whether or not they would like to reconnect. + * + * @param code - The close code + */ + onWsClose({ code }) { + const canResume = code === 4015 || code < 4e3; + if (canResume && this.state.code === 4 /* Ready */) { + const lastSequence = this.state.ws.sequence; + this.state = { + ...this.state, + code: 5 /* Resuming */, + ws: this.createWebSocket(this.state.connectionOptions.endpoint, lastSequence) + }; + } else if (this.state.code !== 6 /* Closed */) { + this.destroy(); + this.emit("close", code); + } + } + /** + * Called when the UDP socket has closed itself if it has stopped receiving replies from Discord. + */ + onUdpClose() { + if (this.state.code === 4 /* Ready */) { + const lastSequence = this.state.ws.sequence; + this.state = { + ...this.state, + code: 5 /* Resuming */, + ws: this.createWebSocket(this.state.connectionOptions.endpoint, lastSequence) + }; + } + } + /** + * Called when a packet is received on the connection's WebSocket. + * + * @param packet - The received packet + */ + onWsPacket(packet) { + if (packet.op === import_v82.VoiceOpcodes.Hello && this.state.code !== 6 /* Closed */) { + this.state.ws.setHeartbeatInterval(packet.d.heartbeat_interval); + } else if (packet.op === import_v82.VoiceOpcodes.Ready && this.state.code === 1 /* Identifying */) { + const { ip, port, ssrc, modes } = packet.d; + const udp = new VoiceUDPSocket({ ip, port }); + udp.on("error", this.onChildError); + udp.on("debug", this.onUdpDebug); + udp.once("close", this.onUdpClose); + udp.performIPDiscovery(ssrc).then((localConfig) => { + if (this.state.code !== 2 /* UdpHandshaking */) return; + this.state.ws.sendPacket({ + op: import_v82.VoiceOpcodes.SelectProtocol, + d: { + protocol: "udp", + data: { + address: localConfig.ip, + port: localConfig.port, + mode: chooseEncryptionMode(modes) + } + } + }); + this.state = { + ...this.state, + code: 3 /* SelectingProtocol */ + }; + }).catch((error) => this.emit("error", error)); + this.state = { + ...this.state, + code: 2 /* UdpHandshaking */, + udp, + connectionData: { + ssrc, + connectedClients: /* @__PURE__ */ new Set() + } + }; + } else if (packet.op === import_v82.VoiceOpcodes.SessionDescription && this.state.code === 3 /* SelectingProtocol */) { + const { mode: encryptionMode, secret_key: secretKey, dave_protocol_version: daveProtocolVersion } = packet.d; + this.state = { + ...this.state, + code: 4 /* Ready */, + dave: this.createDaveSession(daveProtocolVersion), + connectionData: { + ...this.state.connectionData, + encryptionMode, + secretKey: new Uint8Array(secretKey), + sequence: randomNBit(16), + timestamp: randomNBit(32), + nonce: 0, + nonceBuffer: encryptionMode === "aead_aes256_gcm_rtpsize" ? import_node_buffer6.Buffer.alloc(12) : import_node_buffer6.Buffer.alloc(24), + speaking: false, + packetsPlayed: 0 + } + }; + } else if (packet.op === import_v82.VoiceOpcodes.Resumed && this.state.code === 5 /* Resuming */) { + this.state = { + ...this.state, + code: 4 /* Ready */ + }; + this.state.connectionData.speaking = false; + } else if ((packet.op === import_v82.VoiceOpcodes.ClientsConnect || packet.op === import_v82.VoiceOpcodes.ClientDisconnect) && (this.state.code === 4 /* Ready */ || this.state.code === 2 /* UdpHandshaking */ || this.state.code === 3 /* SelectingProtocol */ || this.state.code === 5 /* Resuming */)) { + const { connectionData } = this.state; + if (packet.op === import_v82.VoiceOpcodes.ClientsConnect) + for (const id of packet.d.user_ids) connectionData.connectedClients.add(id); + else { + connectionData.connectedClients.delete(packet.d.user_id); + } + } else if ((this.state.code === 4 /* Ready */ || this.state.code === 5 /* Resuming */) && this.state.dave) { + if (packet.op === import_v82.VoiceOpcodes.DavePrepareTransition) { + const sendReady = this.state.dave.prepareTransition(packet.d); + if (sendReady) + this.state.ws.sendPacket({ + op: import_v82.VoiceOpcodes.DaveTransitionReady, + d: { transition_id: packet.d.transition_id } + }); + if (packet.d.transition_id === 0) { + this.emit("transitioned", 0); + } + } else if (packet.op === import_v82.VoiceOpcodes.DaveExecuteTransition) { + const transitioned = this.state.dave.executeTransition(packet.d.transition_id); + if (transitioned) this.emit("transitioned", packet.d.transition_id); + } else if (packet.op === import_v82.VoiceOpcodes.DavePrepareEpoch) this.state.dave.prepareEpoch(packet.d); + } + } + /** + * Called when a binary message is received on the connection's WebSocket. + * + * @param message - The received message + */ + onWsBinary(message) { + if (this.state.code === 4 /* Ready */ && this.state.dave) { + if (message.op === import_v82.VoiceOpcodes.DaveMlsExternalSender) { + this.state.dave.setExternalSender(message.payload); + } else if (message.op === import_v82.VoiceOpcodes.DaveMlsProposals) { + const payload = this.state.dave.processProposals(message.payload, this.state.connectionData.connectedClients); + if (payload) this.state.ws.sendBinaryMessage(import_v82.VoiceOpcodes.DaveMlsCommitWelcome, payload); + } else if (message.op === import_v82.VoiceOpcodes.DaveMlsAnnounceCommitTransition) { + const { transitionId, success } = this.state.dave.processCommit(message.payload); + if (success) { + if (transitionId === 0) this.emit("transitioned", transitionId); + else + this.state.ws.sendPacket({ + op: import_v82.VoiceOpcodes.DaveTransitionReady, + d: { transition_id: transitionId } + }); + } + } else if (message.op === import_v82.VoiceOpcodes.DaveMlsWelcome) { + const { transitionId, success } = this.state.dave.processWelcome(message.payload); + if (success) { + if (transitionId === 0) this.emit("transitioned", transitionId); + else + this.state.ws.sendPacket({ + op: import_v82.VoiceOpcodes.DaveTransitionReady, + d: { transition_id: transitionId } + }); + } + } + } + } + /** + * Called when a new key package is ready to be sent to the voice server. + * + * @param keyPackage - The new key package + */ + onDaveKeyPackage(keyPackage) { + if (this.state.code === 3 /* SelectingProtocol */ || this.state.code === 4 /* Ready */) + this.state.ws.sendBinaryMessage(import_v82.VoiceOpcodes.DaveMlsKeyPackage, keyPackage); + } + /** + * Called when the DAVE session wants to invalidate their transition and re-initialize. + * + * @param transitionId - The transition to invalidate + */ + onDaveInvalidateTransition(transitionId) { + if (this.state.code === 3 /* SelectingProtocol */ || this.state.code === 4 /* Ready */) + this.state.ws.sendPacket({ + op: import_v82.VoiceOpcodes.DaveMlsInvalidCommitWelcome, + d: { transition_id: transitionId } + }); + } + /** + * Propagates debug messages from the child WebSocket. + * + * @param message - The emitted debug message + */ + onWsDebug(message) { + this.debug?.(`[WS] ${message}`); + } + /** + * Propagates debug messages from the child UDPSocket. + * + * @param message - The emitted debug message + */ + onUdpDebug(message) { + this.debug?.(`[UDP] ${message}`); + } + /** + * Propagates debug messages from the child DAVESession. + * + * @param message - The emitted debug message + */ + onDaveDebug(message) { + this.debug?.(`[DAVE] ${message}`); + } + /** + * Prepares an Opus packet for playback. This includes attaching metadata to it and encrypting it. + * It will be stored within the instance, and can be played by dispatchAudio() + * + * @remarks + * Calling this method while there is already a prepared audio packet that has not yet been dispatched + * will overwrite the existing audio packet. This should be avoided. + * @param opusPacket - The Opus packet to encrypt + * @returns The audio packet that was prepared + */ + prepareAudioPacket(opusPacket) { + const state = this.state; + if (state.code !== 4 /* Ready */) return; + state.preparedPacket = this.createAudioPacket(opusPacket, state.connectionData, state.dave); + return state.preparedPacket; + } + /** + * Dispatches the audio packet previously prepared by prepareAudioPacket(opusPacket). The audio packet + * is consumed and cannot be dispatched again. + */ + dispatchAudio() { + const state = this.state; + if (state.code !== 4 /* Ready */) return false; + if (state.preparedPacket !== void 0) { + this.playAudioPacket(state.preparedPacket); + state.preparedPacket = void 0; + return true; + } + return false; + } + /** + * Plays an audio packet, updating timing metadata used for playback. + * + * @param audioPacket - The audio packet to play + */ + playAudioPacket(audioPacket) { + const state = this.state; + if (state.code !== 4 /* Ready */) return; + const { connectionData } = state; + connectionData.packetsPlayed++; + connectionData.sequence++; + connectionData.timestamp += TIMESTAMP_INC; + if (connectionData.sequence >= 2 ** 16) connectionData.sequence = 0; + if (connectionData.timestamp >= 2 ** 32) connectionData.timestamp = 0; + this.setSpeaking(true); + state.udp.send(audioPacket); + } + /** + * Sends a packet to the voice gateway indicating that the client has start/stopped sending + * audio. + * + * @param speaking - Whether or not the client should be shown as speaking + */ + setSpeaking(speaking) { + const state = this.state; + if (state.code !== 4 /* Ready */) return; + if (state.connectionData.speaking === speaking) return; + state.connectionData.speaking = speaking; + state.ws.sendPacket({ + op: import_v82.VoiceOpcodes.Speaking, + d: { + speaking: speaking ? 1 : 0, + delay: 0, + ssrc: state.connectionData.ssrc + } + }); + } + /** + * Creates a new audio packet from an Opus packet. This involves encrypting the packet, + * then prepending a header that includes metadata. + * + * @param opusPacket - The Opus packet to prepare + * @param connectionData - The current connection data of the instance + * @param daveSession - The DAVE session to use for encryption + */ + createAudioPacket(opusPacket, connectionData, daveSession) { + const rtpHeader = import_node_buffer6.Buffer.alloc(12); + rtpHeader[0] = 128; + rtpHeader[1] = 120; + const { sequence, timestamp, ssrc } = connectionData; + rtpHeader.writeUIntBE(sequence, 2, 2); + rtpHeader.writeUIntBE(timestamp, 4, 4); + rtpHeader.writeUIntBE(ssrc, 8, 4); + rtpHeader.copy(nonce, 0, 0, 12); + return import_node_buffer6.Buffer.concat([rtpHeader, ...this.encryptOpusPacket(opusPacket, connectionData, rtpHeader, daveSession)]); + } + /** + * Encrypts an Opus packet using the format agreed upon by the instance and Discord. + * + * @param opusPacket - The Opus packet to encrypt + * @param connectionData - The current connection data of the instance + * @param daveSession - The DAVE session to use for encryption + */ + encryptOpusPacket(opusPacket, connectionData, additionalData, daveSession) { + const { secretKey, encryptionMode } = connectionData; + const packet = daveSession?.encrypt(opusPacket) ?? opusPacket; + connectionData.nonce++; + if (connectionData.nonce > MAX_NONCE_SIZE) connectionData.nonce = 0; + connectionData.nonceBuffer.writeUInt32BE(connectionData.nonce, 0); + const noncePadding = connectionData.nonceBuffer.subarray(0, 4); + let encrypted; + switch (encryptionMode) { + case "aead_aes256_gcm_rtpsize": { + const cipher = import_node_crypto.default.createCipheriv("aes-256-gcm", secretKey, connectionData.nonceBuffer); + cipher.setAAD(additionalData); + encrypted = import_node_buffer6.Buffer.concat([cipher.update(packet), cipher.final(), cipher.getAuthTag()]); + return [encrypted, noncePadding]; + } + case "aead_xchacha20_poly1305_rtpsize": { + encrypted = methods.crypto_aead_xchacha20poly1305_ietf_encrypt( + packet, + additionalData, + connectionData.nonceBuffer, + secretKey + ); + return [encrypted, noncePadding]; + } + default: { + throw new RangeError(`Unsupported encryption method: ${encryptionMode}`); + } + } + } +}; + +// src/receive/VoiceReceiver.ts +var import_node_buffer7 = require("buffer"); +var import_node_crypto2 = __toESM(require("crypto")); +var import_v83 = require("discord-api-types/voice/v8"); + // src/receive/AudioReceiveStream.ts +var import_node_process = require("process"); +var import_node_stream = require("stream"); var EndBehaviorType = /* @__PURE__ */ ((EndBehaviorType2) => { EndBehaviorType2[EndBehaviorType2["Manual"] = 0] = "Manual"; EndBehaviorType2[EndBehaviorType2["AfterSilence"] = 1] = "AfterSilence"; @@ -1354,9 +1877,10 @@ var AudioReceiveStream = class extends import_node_stream.Readable { */ end; endTimeout; - constructor({ end, ...options }) { + constructor(options) { + const { end, ...rest } = options; super({ - ...options, + ...rest, objectMode: true }); this.end = end; @@ -1365,6 +1889,9 @@ var AudioReceiveStream = class extends import_node_stream.Readable { if (buffer && (this.end.behavior === 2 /* AfterInactivity */ || this.end.behavior === 1 /* AfterSilence */ && (buffer.compare(SILENCE_FRAME) !== 0 || this.endTimeout === void 0))) { this.renewEndTimeout(this.end); } + if (buffer === null) { + (0, import_node_process.nextTick)(() => this.destroy()); + } return super.push(buffer); } renewEndTimeout(end) { @@ -1378,8 +1905,8 @@ var AudioReceiveStream = class extends import_node_stream.Readable { }; // src/receive/SSRCMap.ts -var import_node_events5 = require("events"); -var SSRCMap = class extends import_node_events5.EventEmitter { +var import_node_events6 = require("events"); +var SSRCMap = class extends import_node_events6.EventEmitter { static { __name(this, "SSRCMap"); } @@ -1403,8 +1930,7 @@ var SSRCMap = class extends import_node_events5.EventEmitter { ...data }; this.map.set(data.audioSSRC, newValue); - if (!existing) - this.emit("create", newValue); + if (!existing) this.emit("create", newValue); this.emit("update", existing, newValue); } /** @@ -1450,8 +1976,8 @@ var SSRCMap = class extends import_node_events5.EventEmitter { }; // src/receive/SpeakingMap.ts -var import_node_events6 = require("events"); -var SpeakingMap = class _SpeakingMap extends import_node_events6.EventEmitter { +var import_node_events7 = require("events"); +var SpeakingMap = class _SpeakingMap extends import_node_events7.EventEmitter { static { __name(this, "SpeakingMap"); } @@ -1492,6 +2018,9 @@ var SpeakingMap = class _SpeakingMap extends import_node_events6.EventEmitter { }; // src/receive/VoiceReceiver.ts +var HEADER_EXTENSION_BYTE = import_node_buffer7.Buffer.from([190, 222]); +var UNPADDED_NONCE_LENGTH = 4; +var AUTH_TAG_LENGTH = 16; var VoiceReceiver = class { static { __name(this, "VoiceReceiver"); @@ -1534,33 +2063,44 @@ var VoiceReceiver = class { * @internal */ onWsPacket(packet) { - if (packet.op === import_v43.VoiceOpcodes.ClientDisconnect && typeof packet.d?.user_id === "string") { + if (packet.op === import_v83.VoiceOpcodes.ClientDisconnect) { this.ssrcMap.delete(packet.d.user_id); - } else if (packet.op === import_v43.VoiceOpcodes.Speaking && typeof packet.d?.user_id === "string" && typeof packet.d?.ssrc === "number") { + } else if (packet.op === import_v83.VoiceOpcodes.Speaking) { this.ssrcMap.update({ userId: packet.d.user_id, audioSSRC: packet.d.ssrc }); - } else if (packet.op === import_v43.VoiceOpcodes.ClientConnect && typeof packet.d?.user_id === "string" && typeof packet.d?.audio_ssrc === "number") { - this.ssrcMap.update({ - userId: packet.d.user_id, - audioSSRC: packet.d.audio_ssrc, - videoSSRC: packet.d.video_ssrc === 0 ? void 0 : packet.d.video_ssrc - }); } } decrypt(buffer, mode, nonce2, secretKey) { - let end; - if (mode === "xsalsa20_poly1305_lite") { - buffer.copy(nonce2, 0, buffer.length - 4); - end = buffer.length - 4; - } else if (mode === "xsalsa20_poly1305_suffix") { - buffer.copy(nonce2, 0, buffer.length - 24); - end = buffer.length - 24; - } else { - buffer.copy(nonce2, 0, 0, 12); + buffer.copy(nonce2, 0, buffer.length - UNPADDED_NONCE_LENGTH); + let headerSize = 12; + const first = buffer.readUint8(); + if (first >> 4 & 1) headerSize += 4; + const header = buffer.subarray(0, headerSize); + const encrypted = buffer.subarray(headerSize, buffer.length - AUTH_TAG_LENGTH - UNPADDED_NONCE_LENGTH); + const authTag = buffer.subarray( + buffer.length - AUTH_TAG_LENGTH - UNPADDED_NONCE_LENGTH, + buffer.length - UNPADDED_NONCE_LENGTH + ); + switch (mode) { + case "aead_aes256_gcm_rtpsize": { + const decipheriv = import_node_crypto2.default.createDecipheriv("aes-256-gcm", secretKey, nonce2); + decipheriv.setAAD(header); + decipheriv.setAuthTag(authTag); + return import_node_buffer7.Buffer.concat([decipheriv.update(encrypted), decipheriv.final()]); + } + case "aead_xchacha20_poly1305_rtpsize": { + return import_node_buffer7.Buffer.from( + methods.crypto_aead_xchacha20poly1305_ietf_decrypt( + import_node_buffer7.Buffer.concat([encrypted, authTag]), + header, + nonce2, + secretKey + ) + ); + } + default: { + throw new RangeError(`Unsupported decryption method: ${mode}`); + } } - const decrypted = methods.open(buffer.slice(12, end), nonce2, secretKey); - if (!decrypted) - return; - return import_node_buffer5.Buffer.from(decrypted); } /** * Parses an audio packet, decrypting it to yield an Opus packet. @@ -1569,15 +2109,19 @@ var VoiceReceiver = class { * @param mode - The encryption mode * @param nonce - The nonce buffer used by the connection for encryption * @param secretKey - The secret key used by the connection for encryption + * @param userId - The user id that sent the packet * @returns The parsed Opus packet */ - parsePacket(buffer, mode, nonce2, secretKey) { + parsePacket(buffer, mode, nonce2, secretKey, userId) { let packet = this.decrypt(buffer, mode, nonce2, secretKey); - if (!packet) - return; - if (packet[0] === 190 && packet[1] === 222) { - const headerExtensionLength = packet.readUInt16BE(2); - packet = packet.subarray(4 + 4 * headerExtensionLength); + if (!packet) throw new Error("Failed to parse packet"); + if (buffer.subarray(12, 14).compare(HEADER_EXTENSION_BYTE) === 0) { + const headerExtensionLength = buffer.subarray(14).readUInt16BE(); + packet = packet.subarray(4 * headerExtensionLength); + } + if (this.voiceConnection.state.status === "ready" /* Ready */ && (this.voiceConnection.state.networking.state.code === 4 /* Ready */ || this.voiceConnection.state.networking.state.code === 5 /* Resuming */)) { + const daveSession = this.voiceConnection.state.networking.state.dave; + if (daveSession) packet = daveSession.decrypt(packet, userId); } return packet; } @@ -1588,27 +2132,25 @@ var VoiceReceiver = class { * @internal */ onUdpMessage(msg) { - if (msg.length <= 8) - return; + if (msg.length <= 8) return; const ssrc = msg.readUInt32BE(8); const userData = this.ssrcMap.get(ssrc); - if (!userData) - return; + if (!userData) return; this.speaking.onPacket(userData.userId); const stream = this.subscriptions.get(userData.userId); - if (!stream) - return; + if (!stream) return; if (this.connectionData.encryptionMode && this.connectionData.nonceBuffer && this.connectionData.secretKey) { - const packet = this.parsePacket( - msg, - this.connectionData.encryptionMode, - this.connectionData.nonceBuffer, - this.connectionData.secretKey - ); - if (packet) { - stream.push(packet); - } else { - stream.destroy(new Error("Failed to parse packet")); + try { + const packet = this.parsePacket( + msg, + this.connectionData.encryptionMode, + this.connectionData.nonceBuffer, + this.connectionData.secretKey, + userData.userId + ); + if (packet) stream.push(packet); + } catch (error) { + stream.destroy(error); } } } @@ -1620,8 +2162,7 @@ var VoiceReceiver = class { */ subscribe(userId, options) { const existing = this.subscriptions.get(userId); - if (existing) - return existing; + if (existing) return existing; const stream = new AudioReceiveStream({ ...createDefaultAudioReceiveStreamOptions(), ...options @@ -1648,7 +2189,7 @@ var VoiceConnectionDisconnectReason = /* @__PURE__ */ ((VoiceConnectionDisconnec VoiceConnectionDisconnectReason2[VoiceConnectionDisconnectReason2["Manual"] = 3] = "Manual"; return VoiceConnectionDisconnectReason2; })(VoiceConnectionDisconnectReason || {}); -var VoiceConnection = class extends import_node_events7.EventEmitter { +var VoiceConnection = class extends import_node_events8.EventEmitter { static { __name(this, "VoiceConnection"); } @@ -1681,6 +2222,10 @@ var VoiceConnection = class extends import_node_events7.EventEmitter { * The debug logger function, if debugging is enabled. */ debug; + /** + * The options used to create this voice connection. + */ + options; /** * Creates a new voice connection. * @@ -1696,10 +2241,11 @@ var VoiceConnection = class extends import_node_events7.EventEmitter { this.onNetworkingStateChange = this.onNetworkingStateChange.bind(this); this.onNetworkingError = this.onNetworkingError.bind(this); this.onNetworkingDebug = this.onNetworkingDebug.bind(this); + this.onNetworkingTransitioned = this.onNetworkingTransitioned.bind(this); const adapter = options.adapterCreator({ - onVoiceServerUpdate: (data) => this.addServerPacket(data), - onVoiceStateUpdate: (data) => this.addStatePacket(data), - destroy: () => this.destroy(false) + onVoiceServerUpdate: /* @__PURE__ */ __name((data) => this.addServerPacket(data), "onVoiceServerUpdate"), + onVoiceStateUpdate: /* @__PURE__ */ __name((data) => this.addStatePacket(data), "onVoiceStateUpdate"), + destroy: /* @__PURE__ */ __name(() => this.destroy(false), "destroy") }); this._state = { status: "signalling" /* Signalling */, adapter }; this.packets = { @@ -1707,16 +2253,17 @@ var VoiceConnection = class extends import_node_events7.EventEmitter { state: void 0 }; this.joinConfig = joinConfig; + this.options = options; } /** * The current state of the voice connection. + * + * @remarks + * The setter will perform clean-up operations where necessary. */ get state() { return this._state; } - /** - * Updates the state of the voice connection, performing clean-up operations where necessary. - */ set state(newState) { const oldState = this._state; const oldNetworking = Reflect.get(oldState, "networking"); @@ -1730,17 +2277,16 @@ var VoiceConnection = class extends import_node_events7.EventEmitter { oldNetworking.off("error", this.onNetworkingError); oldNetworking.off("close", this.onNetworkingClose); oldNetworking.off("stateChange", this.onNetworkingStateChange); + oldNetworking.off("transitioned", this.onNetworkingTransitioned); oldNetworking.destroy(); } - if (newNetworking) - this.updateReceiveBindings(newNetworking.state, oldNetworking?.state); + if (newNetworking) this.updateReceiveBindings(newNetworking.state, oldNetworking?.state); } if (newState.status === "ready" /* Ready */) { this.rejoinAttempts = 0; } else if (newState.status === "destroyed" /* Destroyed */) { for (const stream of this.receiver.subscriptions.values()) { - if (!stream.destroyed) - stream.destroy(); + if (!stream.destroyed) stream.destroy(); } } if (oldState.status !== "destroyed" /* Destroyed */ && newState.status === "destroyed" /* Destroyed */) { @@ -1781,12 +2327,9 @@ var VoiceConnection = class extends import_node_events7.EventEmitter { */ addStatePacket(packet) { this.packets.state = packet; - if (packet.self_deaf !== void 0) - this.joinConfig.selfDeaf = packet.self_deaf; - if (packet.self_mute !== void 0) - this.joinConfig.selfMute = packet.self_mute; - if (packet.channel_id) - this.joinConfig.channelId = packet.channel_id; + if (packet.self_deaf !== void 0) this.joinConfig.selfDeaf = packet.self_deaf; + if (packet.self_mute !== void 0) this.joinConfig.selfMute = packet.self_mute; + if (packet.channel_id) this.joinConfig.channelId = packet.channel_id; } /** * Called when the networking state changes, and the new ws/udp packet/message handlers need to be rebound @@ -1823,22 +2366,27 @@ var VoiceConnection = class extends import_node_events7.EventEmitter { */ configureNetworking() { const { server, state } = this.packets; - if (!server || !state || this.state.status === "destroyed" /* Destroyed */ || !server.endpoint) - return; + if (!server || !state || this.state.status === "destroyed" /* Destroyed */ || !server.endpoint) return; const networking = new Networking( { endpoint: server.endpoint, serverId: server.guild_id, token: server.token, sessionId: state.session_id, - userId: state.user_id + userId: state.user_id, + channelId: state.channel_id }, - Boolean(this.debug) + { + debug: Boolean(this.debug), + daveEncryption: this.options.daveEncryption ?? true, + decryptionFailureTolerance: this.options.decryptionFailureTolerance + } ); networking.once("close", this.onNetworkingClose); networking.on("stateChange", this.onNetworkingStateChange); networking.on("error", this.onNetworkingError); networking.on("debug", this.onNetworkingDebug); + networking.on("transitioned", this.onNetworkingTransitioned); this.state = { ...this.state, status: "connecting" /* Connecting */, @@ -1857,8 +2405,7 @@ var VoiceConnection = class extends import_node_events7.EventEmitter { * @param code - The close code */ onNetworkingClose(code) { - if (this.state.status === "destroyed" /* Destroyed */) - return; + if (this.state.status === "destroyed" /* Destroyed */) return; if (code === 4014) { this.state = { ...this.state, @@ -1889,8 +2436,7 @@ var VoiceConnection = class extends import_node_events7.EventEmitter { */ onNetworkingStateChange(oldState, newState) { this.updateReceiveBindings(newState, oldState); - if (oldState.code === newState.code) - return; + if (oldState.code === newState.code) return; if (this.state.status !== "connecting" /* Connecting */ && this.state.status !== "ready" /* Ready */) return; if (newState.code === 4 /* Ready */) { @@ -1921,6 +2467,14 @@ var VoiceConnection = class extends import_node_events7.EventEmitter { onNetworkingDebug(message) { this.debug?.(`[NW] ${message}`); } + /** + * Propagates transitions from the underlying network instance. + * + * @param transitionId - The transition id + */ + onNetworkingTransitioned(transitionId) { + this.emit("transitioned", transitionId); + } /** * Prepares an audio packet for dispatch. * @@ -1928,8 +2482,7 @@ var VoiceConnection = class extends import_node_events7.EventEmitter { */ prepareAudioPacket(buffer) { const state = this.state; - if (state.status !== "ready" /* Ready */) - return; + if (state.status !== "ready" /* Ready */) return; return state.networking.prepareAudioPacket(buffer); } /** @@ -1937,8 +2490,7 @@ var VoiceConnection = class extends import_node_events7.EventEmitter { */ dispatchAudio() { const state = this.state; - if (state.status !== "ready" /* Ready */) - return; + if (state.status !== "ready" /* Ready */) return; return state.networking.dispatchAudio(); } /** @@ -1948,8 +2500,7 @@ var VoiceConnection = class extends import_node_events7.EventEmitter { */ playOpusPacket(buffer) { const state = this.state; - if (state.status !== "ready" /* Ready */) - return; + if (state.status !== "ready" /* Ready */) return; state.networking.prepareAudioPacket(buffer); return state.networking.dispatchAudio(); } @@ -2015,8 +2566,7 @@ var VoiceConnection = class extends import_node_events7.EventEmitter { return false; } const notReady = this.state.status !== "ready" /* Ready */; - if (notReady) - this.rejoinAttempts++; + if (notReady) this.rejoinAttempts++; Object.assign(this.joinConfig, joinConfig); if (this.state.adapter.sendPayload(createJoinVoiceChannelPayload(this.joinConfig))) { if (notReady) { @@ -2042,8 +2592,7 @@ var VoiceConnection = class extends import_node_events7.EventEmitter { * @param enabled - Whether or not to show as speaking */ setSpeaking(enabled) { - if (this.state.status !== "ready" /* Ready */) - return false; + if (this.state.status !== "ready" /* Ready */) return false; return this.state.networking.setSpeaking(enabled); } /** @@ -2053,8 +2602,7 @@ var VoiceConnection = class extends import_node_events7.EventEmitter { * @returns The created subscription */ subscribe(player) { - if (this.state.status === "destroyed" /* Destroyed */) - return; + if (this.state.status === "destroyed" /* Destroyed */) return; const subscription = player["subscribe"](this); this.state = { ...this.state, @@ -2082,6 +2630,30 @@ var VoiceConnection = class extends import_node_events7.EventEmitter { udp: void 0 }; } + /** + * The current voice privacy code of the encrypted session. + * + * @remarks + * For this data to be available, the VoiceConnection must be in the Ready state, + * and the connection would have to be end-to-end encrypted. + */ + get voicePrivacyCode() { + if (this.state.status === "ready" /* Ready */ && this.state.networking.state.code === 4 /* Ready */) { + return this.state.networking.state.dave?.voicePrivacyCode ?? void 0; + } + return void 0; + } + /** + * Gets the verification code for a user in the session. + * + * @throws Will throw if end-to-end encryption is not on or if the user id provided is not in the session. + */ + async getVerificationCode(userId) { + if (this.state.status === "ready" /* Ready */ && this.state.networking.state.code === 4 /* Ready */ && this.state.networking.state.dave) { + return this.state.networking.state.dave.getVerificationCode(userId); + } + throw new Error("Session not available"); + } /** * Called when a subscription of this voice connection to an audio player is removed. * @@ -2138,7 +2710,9 @@ function joinVoiceChannel(options) { }; return createVoiceConnection(joinConfig, { adapterCreator: options.adapterCreator, - debug: options.debug + debug: options.debug, + daveEncryption: options.daveEncryption, + decryptionFailureTolerance: options.decryptionFailureTolerance }); } __name(joinVoiceChannel, "joinVoiceChannel"); @@ -2172,6 +2746,16 @@ var StreamType = /* @__PURE__ */ ((StreamType2) => { StreamType2["WebmOpus"] = "webm/opus"; return StreamType2; })(StreamType || {}); +var TransformerType = /* @__PURE__ */ ((TransformerType2) => { + TransformerType2["FFmpegOgg"] = "ffmpeg ogg"; + TransformerType2["FFmpegPCM"] = "ffmpeg pcm"; + TransformerType2["InlineVolume"] = "volume transformer"; + TransformerType2["OggOpusDemuxer"] = "ogg/opus demuxer"; + TransformerType2["OpusDecoder"] = "opus decoder"; + TransformerType2["OpusEncoder"] = "opus encoder"; + TransformerType2["WebmOpusDemuxer"] = "webm/opus demuxer"; + return TransformerType2; +})(TransformerType || {}); var Node = class { static { __name(this, "Node"); @@ -2199,8 +2783,7 @@ var Node = class { var NODES = null; function getNode(type) { const node = (NODES ??= initializeNodes()).get(type); - if (!node) - throw new Error(`Node type '${type}' does not exist!`); + if (!node) throw new Error(`Node type '${type}' does not exist!`); return node; } __name(getNode, "getNode"); @@ -2221,33 +2804,33 @@ function initializeNodes() { type: "opus encoder" /* OpusEncoder */, to: nodes.get("opus" /* Opus */), cost: 1.5, - transformer: () => new import_prism_media.default.opus.Encoder({ rate: 48e3, channels: 2, frameSize: 960 }) + transformer: /* @__PURE__ */ __name(() => new import_prism_media.default.opus.Encoder({ rate: 48e3, channels: 2, frameSize: 960 }), "transformer") }); nodes.get("opus" /* Opus */).addEdge({ type: "opus decoder" /* OpusDecoder */, to: nodes.get("raw" /* Raw */), cost: 1.5, - transformer: () => new import_prism_media.default.opus.Decoder({ rate: 48e3, channels: 2, frameSize: 960 }) + transformer: /* @__PURE__ */ __name(() => new import_prism_media.default.opus.Decoder({ rate: 48e3, channels: 2, frameSize: 960 }), "transformer") }); nodes.get("ogg/opus" /* OggOpus */).addEdge({ type: "ogg/opus demuxer" /* OggOpusDemuxer */, to: nodes.get("opus" /* Opus */), cost: 1, - transformer: () => new import_prism_media.default.opus.OggDemuxer() + transformer: /* @__PURE__ */ __name(() => new import_prism_media.default.opus.OggDemuxer(), "transformer") }); nodes.get("webm/opus" /* WebmOpus */).addEdge({ type: "webm/opus demuxer" /* WebmOpusDemuxer */, to: nodes.get("opus" /* Opus */), cost: 1, - transformer: () => new import_prism_media.default.opus.WebmDemuxer() + transformer: /* @__PURE__ */ __name(() => new import_prism_media.default.opus.WebmDemuxer(), "transformer") }); const FFMPEG_PCM_EDGE = { type: "ffmpeg pcm" /* FFmpegPCM */, to: nodes.get("raw" /* Raw */), cost: 2, - transformer: (input) => new import_prism_media.default.FFmpeg({ + transformer: /* @__PURE__ */ __name((input) => new import_prism_media.default.FFmpeg({ args: ["-i", typeof input === "string" ? input : "-", ...FFMPEG_PCM_ARGUMENTS] - }) + }), "transformer") }; nodes.get("arbitrary" /* Arbitrary */).addEdge(FFMPEG_PCM_EDGE); nodes.get("ogg/opus" /* OggOpus */).addEdge(FFMPEG_PCM_EDGE); @@ -2256,16 +2839,16 @@ function initializeNodes() { type: "volume transformer" /* InlineVolume */, to: nodes.get("raw" /* Raw */), cost: 0.5, - transformer: () => new import_prism_media.default.VolumeTransformer({ type: "s16le" }) + transformer: /* @__PURE__ */ __name(() => new import_prism_media.default.VolumeTransformer({ type: "s16le" }), "transformer") }); if (canEnableFFmpegOptimizations()) { const FFMPEG_OGG_EDGE = { type: "ffmpeg ogg" /* FFmpegOgg */, to: nodes.get("ogg/opus" /* OggOpus */), cost: 2, - transformer: (input) => new import_prism_media.default.FFmpeg({ + transformer: /* @__PURE__ */ __name((input) => new import_prism_media.default.FFmpeg({ args: ["-i", typeof input === "string" ? input : "-", ...FFMPEG_OPUS_ARGUMENTS] - }) + }), "transformer") }; nodes.get("arbitrary" /* Arbitrary */).addEdge(FFMPEG_OGG_EDGE); nodes.get("ogg/opus" /* OggOpus */).addEdge(FFMPEG_OGG_EDGE); @@ -2282,8 +2865,7 @@ function findPath(from, constraints, goal = getNode("opus" /* Opus */), path = [ } let currentBest; for (const edge of from.edges) { - if (currentBest && edge.cost > currentBest.cost) - continue; + if (currentBest && edge.cost > currentBest.cost) continue; const next = findPath(edge.to, constraints, goal, [...path, edge], depth - 1); const cost = edge.cost + next.cost; if (!currentBest || cost < currentBest.cost) { @@ -2376,12 +2958,10 @@ var AudioResource = class { * while there are silence padding frames left to play. */ get readable() { - if (this.silenceRemaining === 0) - return false; + if (this.silenceRemaining === 0) return false; const real = this.playStream.readable; if (!real) { - if (this.silenceRemaining === -1) - this.silenceRemaining = this.silencePaddingFrames; + if (this.silenceRemaining === -1) this.silenceRemaining = this.silencePaddingFrames; return this.silenceRemaining !== 0; } return real; @@ -2445,8 +3025,7 @@ function createAudioResource(input, options = {}) { } const transformerPipeline = findPipeline(inputType, needsInlineVolume ? VOLUME_CONSTRAINT : NO_CONSTRAINT); if (transformerPipeline.length === 0) { - if (typeof input === "string") - throw new Error(`Invalid pipeline constructed for string resource '${input}'`); + if (typeof input === "string") throw new Error(`Invalid pipeline constructed for string resource '${input}'`); return new AudioResource( [], [input], @@ -2455,8 +3034,7 @@ function createAudioResource(input, options = {}) { ); } const streams = transformerPipeline.map((edge) => edge.transformer(input)); - if (typeof input !== "string") - streams.unshift(input); + if (typeof input !== "string") streams.unshift(input); return new AudioResource( transformerPipeline, streams, @@ -2467,16 +3045,15 @@ function createAudioResource(input, options = {}) { __name(createAudioResource, "createAudioResource"); // src/util/generateDependencyReport.ts +var import_node_crypto3 = require("crypto"); var import_node_path = require("path"); var import_prism_media3 = __toESM(require("prism-media")); function findPackageJSON(dir, packageName, depth) { - if (depth === 0) - return void 0; + if (depth === 0) return void 0; const attemptedPath = (0, import_node_path.resolve)(dir, "./package.json"); try { const pkg = require(attemptedPath); - if (pkg.name !== packageName) - throw new Error("package.json does not match"); + if (pkg.name !== packageName) throw new Error("package.json does not match"); return pkg; } catch { return findPackageJSON((0, import_node_path.resolve)(dir, ".."), packageName, depth - 1); @@ -2486,7 +3063,7 @@ __name(findPackageJSON, "findPackageJSON"); function version(name) { try { if (name === "@discordjs/voice") { - return "0.17.0"; + return "0.19.0"; } const pkg = findPackageJSON((0, import_node_path.dirname)(require.resolve(name)), name, 3); return pkg?.version ?? "not found"; @@ -2507,10 +3084,15 @@ function generateDependencyReport() { addVersion("opusscript"); report.push(""); report.push("Encryption Libraries"); + report.push(`- native crypto support for aes-256-gcm: ${(0, import_node_crypto3.getCiphers)().includes("aes-256-gcm") ? "yes" : "no"}`); addVersion("sodium-native"); addVersion("sodium"); addVersion("libsodium-wrappers"); - addVersion("tweetnacl"); + addVersion("@stablelib/xchacha20poly1305"); + addVersion("@noble/ciphers"); + report.push(""); + report.push("DAVE Libraries"); + addVersion("@snazzah/davey"); report.push(""); report.push("FFmpeg"); try { @@ -2525,7 +3107,7 @@ function generateDependencyReport() { __name(generateDependencyReport, "generateDependencyReport"); // src/util/entersState.ts -var import_node_events8 = require("events"); +var import_node_events9 = require("events"); // src/util/abortAfter.ts function abortAfter(delay) { @@ -2541,7 +3123,7 @@ async function entersState(target, status, timeoutOrSignal) { if (target.state.status !== status) { const [ac, signal] = typeof timeoutOrSignal === "number" ? abortAfter(timeoutOrSignal) : [void 0, timeoutOrSignal]; try { - await (0, import_node_events8.once)(target, status, { signal }); + await (0, import_node_events9.once)(target, status, { signal }); } finally { ac?.abort(); } @@ -2551,8 +3133,8 @@ async function entersState(target, status, timeoutOrSignal) { __name(entersState, "entersState"); // src/util/demuxProbe.ts -var import_node_buffer6 = require("buffer"); -var import_node_process = __toESM(require("process")); +var import_node_buffer8 = require("buffer"); +var import_node_process2 = __toESM(require("process")); var import_node_stream3 = require("stream"); var import_prism_media4 = __toESM(require("prism-media")); function validateDiscordOpusHead(opusHead) { @@ -2571,7 +3153,7 @@ async function demuxProbe(stream, probeSize = 1024, validator = validateDiscordO reject(new Error("Cannot probe a stream that has ended")); return; } - let readBuffer = import_node_buffer6.Buffer.alloc(0); + let readBuffer = import_node_buffer8.Buffer.alloc(0); let resolved; const finish = /* @__PURE__ */ __name((type) => { stream.off("data", onData); @@ -2611,13 +3193,13 @@ async function demuxProbe(stream, probeSize = 1024, validator = validateDiscordO } }, "onClose"); const onData = /* @__PURE__ */ __name((buffer) => { - readBuffer = import_node_buffer6.Buffer.concat([readBuffer, buffer]); + readBuffer = import_node_buffer8.Buffer.concat([readBuffer, buffer]); webm.write(buffer); ogg.write(buffer); if (readBuffer.length >= probeSize) { stream.off("data", onData); stream.pause(); - import_node_process.default.nextTick(onClose); + import_node_process2.default.nextTick(onClose); } }, "onData"); stream.once("error", reject); @@ -2629,7 +3211,7 @@ async function demuxProbe(stream, probeSize = 1024, validator = validateDiscordO __name(demuxProbe, "demuxProbe"); // src/index.ts -var version2 = "0.17.0"; +var version2 = "0.19.0"; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { AudioPlayer, @@ -2637,16 +3219,23 @@ var version2 = "0.17.0"; AudioPlayerStatus, AudioReceiveStream, AudioResource, + DAVESession, EndBehaviorType, + Networking, + NetworkingStatusCode, NoSubscriberBehavior, + Node, PlayerSubscription, SSRCMap, SpeakingMap, StreamType, + TransformerType, VoiceConnection, VoiceConnectionDisconnectReason, VoiceConnectionStatus, VoiceReceiver, + VoiceUDPSocket, + VoiceWebSocket, createAudioPlayer, createAudioResource, createDefaultAudioReceiveStreamOptions, diff --git a/node_modules/@discordjs/voice/dist/index.js.map b/node_modules/@discordjs/voice/dist/index.js.map index 79ab048..935e6fd 100644 --- a/node_modules/@discordjs/voice/dist/index.js.map +++ b/node_modules/@discordjs/voice/dist/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/index.ts","../src/VoiceConnection.ts","../src/DataStore.ts","../src/networking/Networking.ts","../src/util/Secretbox.ts","../src/util/util.ts","../src/networking/VoiceUDPSocket.ts","../src/networking/VoiceWebSocket.ts","../src/receive/VoiceReceiver.ts","../src/receive/AudioReceiveStream.ts","../src/audio/AudioPlayer.ts","../src/audio/AudioPlayerError.ts","../src/audio/PlayerSubscription.ts","../src/receive/SSRCMap.ts","../src/receive/SpeakingMap.ts","../src/joinVoiceChannel.ts","../src/audio/AudioResource.ts","../src/audio/TransformerGraph.ts","../src/util/generateDependencyReport.ts","../src/util/entersState.ts","../src/util/abortAfter.ts","../src/util/demuxProbe.ts"],"sourcesContent":["export * from './joinVoiceChannel';\nexport * from './audio/index';\nexport * from './util/index';\nexport * from './receive/index';\n\nexport {\n\tVoiceConnection,\n\ttype VoiceConnectionState,\n\tVoiceConnectionStatus,\n\ttype VoiceConnectionConnectingState,\n\ttype VoiceConnectionDestroyedState,\n\ttype VoiceConnectionDisconnectedState,\n\ttype VoiceConnectionDisconnectedBaseState,\n\ttype VoiceConnectionDisconnectedOtherState,\n\ttype VoiceConnectionDisconnectedWebSocketState,\n\tVoiceConnectionDisconnectReason,\n\ttype VoiceConnectionReadyState,\n\ttype VoiceConnectionSignallingState,\n} from './VoiceConnection';\n\nexport { type JoinConfig, getVoiceConnection, getVoiceConnections, getGroups } from './DataStore';\n\n/**\n * The {@link https://github.com/discordjs/discord.js/blob/main/packages/voice#readme | @discordjs/voice} version\n * that you are currently using.\n */\n// This needs to explicitly be `string` so it is not typed as a \"const string\" that gets injected by esbuild\nexport const version = '0.17.0' as string;\n","/* eslint-disable @typescript-eslint/unbound-method */\nimport type { Buffer } from 'node:buffer';\nimport { EventEmitter } from 'node:events';\nimport type { GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData } from 'discord-api-types/v10';\nimport type { JoinConfig } from './DataStore';\nimport {\n\tgetVoiceConnection,\n\tcreateJoinVoiceChannelPayload,\n\ttrackVoiceConnection,\n\tuntrackVoiceConnection,\n} from './DataStore';\nimport type { AudioPlayer } from './audio/AudioPlayer';\nimport type { PlayerSubscription } from './audio/PlayerSubscription';\nimport type { VoiceWebSocket, VoiceUDPSocket } from './networking';\nimport { Networking, NetworkingStatusCode, type NetworkingState } from './networking/Networking';\nimport { VoiceReceiver } from './receive/index';\nimport type { DiscordGatewayAdapterImplementerMethods } from './util/adapter';\nimport { noop } from './util/util';\nimport type { CreateVoiceConnectionOptions } from './index';\n\n/**\n * The various status codes a voice connection can hold at any one time.\n */\nexport enum VoiceConnectionStatus {\n\t/**\n\t * The `VOICE_SERVER_UPDATE` and `VOICE_STATE_UPDATE` packets have been received, now attempting to establish a voice connection.\n\t */\n\tConnecting = 'connecting',\n\n\t/**\n\t * The voice connection has been destroyed and untracked, it cannot be reused.\n\t */\n\tDestroyed = 'destroyed',\n\n\t/**\n\t * The voice connection has either been severed or not established.\n\t */\n\tDisconnected = 'disconnected',\n\n\t/**\n\t * A voice connection has been established, and is ready to be used.\n\t */\n\tReady = 'ready',\n\n\t/**\n\t * Sending a packet to the main Discord gateway to indicate we want to change our voice state.\n\t */\n\tSignalling = 'signalling',\n}\n\n/**\n * The state that a VoiceConnection will be in when it is waiting to receive a VOICE_SERVER_UPDATE and\n * VOICE_STATE_UPDATE packet from Discord, provided by the adapter.\n */\nexport interface VoiceConnectionSignallingState {\n\tadapter: DiscordGatewayAdapterImplementerMethods;\n\tstatus: VoiceConnectionStatus.Signalling;\n\tsubscription?: PlayerSubscription | undefined;\n}\n\n/**\n * The reasons a voice connection can be in the disconnected state.\n */\nexport enum VoiceConnectionDisconnectReason {\n\t/**\n\t * When the WebSocket connection has been closed.\n\t */\n\tWebSocketClose,\n\n\t/**\n\t * When the adapter was unable to send a message requested by the VoiceConnection.\n\t */\n\tAdapterUnavailable,\n\n\t/**\n\t * When a VOICE_SERVER_UPDATE packet is received with a null endpoint, causing the connection to be severed.\n\t */\n\tEndpointRemoved,\n\n\t/**\n\t * When a manual disconnect was requested.\n\t */\n\tManual,\n}\n\n/**\n * The state that a VoiceConnection will be in when it is not connected to a Discord voice server nor is\n * it attempting to connect. You can manually attempt to reconnect using VoiceConnection#reconnect.\n */\nexport interface VoiceConnectionDisconnectedBaseState {\n\tadapter: DiscordGatewayAdapterImplementerMethods;\n\tstatus: VoiceConnectionStatus.Disconnected;\n\tsubscription?: PlayerSubscription | undefined;\n}\n\n/**\n * The state that a VoiceConnection will be in when it is not connected to a Discord voice server nor is\n * it attempting to connect. You can manually attempt to reconnect using VoiceConnection#reconnect.\n */\nexport interface VoiceConnectionDisconnectedOtherState extends VoiceConnectionDisconnectedBaseState {\n\treason: Exclude;\n}\n\n/**\n * The state that a VoiceConnection will be in when its WebSocket connection was closed.\n * You can manually attempt to reconnect using VoiceConnection#reconnect.\n */\nexport interface VoiceConnectionDisconnectedWebSocketState extends VoiceConnectionDisconnectedBaseState {\n\t/**\n\t * The close code of the WebSocket connection to the Discord voice server.\n\t */\n\tcloseCode: number;\n\n\treason: VoiceConnectionDisconnectReason.WebSocketClose;\n}\n\n/**\n * The states that a VoiceConnection can be in when it is not connected to a Discord voice server nor is\n * it attempting to connect. You can manually attempt to connect using VoiceConnection#reconnect.\n */\nexport type VoiceConnectionDisconnectedState =\n\t| VoiceConnectionDisconnectedOtherState\n\t| VoiceConnectionDisconnectedWebSocketState;\n\n/**\n * The state that a VoiceConnection will be in when it is establishing a connection to a Discord\n * voice server.\n */\nexport interface VoiceConnectionConnectingState {\n\tadapter: DiscordGatewayAdapterImplementerMethods;\n\tnetworking: Networking;\n\tstatus: VoiceConnectionStatus.Connecting;\n\tsubscription?: PlayerSubscription | undefined;\n}\n\n/**\n * The state that a VoiceConnection will be in when it has an active connection to a Discord\n * voice server.\n */\nexport interface VoiceConnectionReadyState {\n\tadapter: DiscordGatewayAdapterImplementerMethods;\n\tnetworking: Networking;\n\tstatus: VoiceConnectionStatus.Ready;\n\tsubscription?: PlayerSubscription | undefined;\n}\n\n/**\n * The state that a VoiceConnection will be in when it has been permanently been destroyed by the\n * user and untracked by the library. It cannot be reconnected, instead, a new VoiceConnection\n * needs to be established.\n */\nexport interface VoiceConnectionDestroyedState {\n\tstatus: VoiceConnectionStatus.Destroyed;\n}\n\n/**\n * The various states that a voice connection can be in.\n */\nexport type VoiceConnectionState =\n\t| VoiceConnectionConnectingState\n\t| VoiceConnectionDestroyedState\n\t| VoiceConnectionDisconnectedState\n\t| VoiceConnectionReadyState\n\t| VoiceConnectionSignallingState;\n\nexport interface VoiceConnection extends EventEmitter {\n\t/**\n\t * Emitted when there is an error emitted from the voice connection\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'error', listener: (error: Error) => void): this;\n\t/**\n\t * Emitted debugging information about the voice connection\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'debug', listener: (message: string) => void): this;\n\t/**\n\t * Emitted when the state of the voice connection changes\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'stateChange', listener: (oldState: VoiceConnectionState, newState: VoiceConnectionState) => void): this;\n\t/**\n\t * Emitted when the state of the voice connection changes to a specific status\n\t *\n\t * @eventProperty\n\t */\n\ton(\n\t\tevent: Event,\n\t\tlistener: (oldState: VoiceConnectionState, newState: VoiceConnectionState & { status: Event }) => void,\n\t): this;\n}\n\n/**\n * A connection to the voice server of a Guild, can be used to play audio in voice channels.\n */\nexport class VoiceConnection extends EventEmitter {\n\t/**\n\t * The number of consecutive rejoin attempts. Initially 0, and increments for each rejoin.\n\t * When a connection is successfully established, it resets to 0.\n\t */\n\tpublic rejoinAttempts: number;\n\n\t/**\n\t * The state of the voice connection.\n\t */\n\tprivate _state: VoiceConnectionState;\n\n\t/**\n\t * A configuration storing all the data needed to reconnect to a Guild's voice server.\n\t *\n\t * @internal\n\t */\n\tpublic readonly joinConfig: JoinConfig;\n\n\t/**\n\t * The two packets needed to successfully establish a voice connection. They are received\n\t * from the main Discord gateway after signalling to change the voice state.\n\t */\n\tprivate readonly packets: {\n\t\tserver: GatewayVoiceServerUpdateDispatchData | undefined;\n\t\tstate: GatewayVoiceStateUpdateDispatchData | undefined;\n\t};\n\n\t/**\n\t * The receiver of this voice connection. You should join the voice channel with `selfDeaf` set\n\t * to false for this feature to work properly.\n\t */\n\tpublic readonly receiver: VoiceReceiver;\n\n\t/**\n\t * The debug logger function, if debugging is enabled.\n\t */\n\tprivate readonly debug: ((message: string) => void) | null;\n\n\t/**\n\t * Creates a new voice connection.\n\t *\n\t * @param joinConfig - The data required to establish the voice connection\n\t * @param options - The options used to create this voice connection\n\t */\n\tpublic constructor(joinConfig: JoinConfig, options: CreateVoiceConnectionOptions) {\n\t\tsuper();\n\n\t\tthis.debug = options.debug ? (message: string) => this.emit('debug', message) : null;\n\t\tthis.rejoinAttempts = 0;\n\n\t\tthis.receiver = new VoiceReceiver(this);\n\n\t\tthis.onNetworkingClose = this.onNetworkingClose.bind(this);\n\t\tthis.onNetworkingStateChange = this.onNetworkingStateChange.bind(this);\n\t\tthis.onNetworkingError = this.onNetworkingError.bind(this);\n\t\tthis.onNetworkingDebug = this.onNetworkingDebug.bind(this);\n\n\t\tconst adapter = options.adapterCreator({\n\t\t\tonVoiceServerUpdate: (data) => this.addServerPacket(data),\n\t\t\tonVoiceStateUpdate: (data) => this.addStatePacket(data),\n\t\t\tdestroy: () => this.destroy(false),\n\t\t});\n\n\t\tthis._state = { status: VoiceConnectionStatus.Signalling, adapter };\n\n\t\tthis.packets = {\n\t\t\tserver: undefined,\n\t\t\tstate: undefined,\n\t\t};\n\n\t\tthis.joinConfig = joinConfig;\n\t}\n\n\t/**\n\t * The current state of the voice connection.\n\t */\n\tpublic get state() {\n\t\treturn this._state;\n\t}\n\n\t/**\n\t * Updates the state of the voice connection, performing clean-up operations where necessary.\n\t */\n\tpublic set state(newState: VoiceConnectionState) {\n\t\tconst oldState = this._state;\n\t\tconst oldNetworking = Reflect.get(oldState, 'networking') as Networking | undefined;\n\t\tconst newNetworking = Reflect.get(newState, 'networking') as Networking | undefined;\n\n\t\tconst oldSubscription = Reflect.get(oldState, 'subscription') as PlayerSubscription | undefined;\n\t\tconst newSubscription = Reflect.get(newState, 'subscription') as PlayerSubscription | undefined;\n\n\t\tif (oldNetworking !== newNetworking) {\n\t\t\tif (oldNetworking) {\n\t\t\t\toldNetworking.on('error', noop);\n\t\t\t\toldNetworking.off('debug', this.onNetworkingDebug);\n\t\t\t\toldNetworking.off('error', this.onNetworkingError);\n\t\t\t\toldNetworking.off('close', this.onNetworkingClose);\n\t\t\t\toldNetworking.off('stateChange', this.onNetworkingStateChange);\n\t\t\t\toldNetworking.destroy();\n\t\t\t}\n\n\t\t\tif (newNetworking) this.updateReceiveBindings(newNetworking.state, oldNetworking?.state);\n\t\t}\n\n\t\tif (newState.status === VoiceConnectionStatus.Ready) {\n\t\t\tthis.rejoinAttempts = 0;\n\t\t} else if (newState.status === VoiceConnectionStatus.Destroyed) {\n\t\t\tfor (const stream of this.receiver.subscriptions.values()) {\n\t\t\t\tif (!stream.destroyed) stream.destroy();\n\t\t\t}\n\t\t}\n\n\t\t// If destroyed, the adapter can also be destroyed so it can be cleaned up by the user\n\t\tif (oldState.status !== VoiceConnectionStatus.Destroyed && newState.status === VoiceConnectionStatus.Destroyed) {\n\t\t\toldState.adapter.destroy();\n\t\t}\n\n\t\tthis._state = newState;\n\n\t\tif (oldSubscription && oldSubscription !== newSubscription) {\n\t\t\toldSubscription.unsubscribe();\n\t\t}\n\n\t\tthis.emit('stateChange', oldState, newState);\n\t\tif (oldState.status !== newState.status) {\n\t\t\tthis.emit(newState.status, oldState, newState as any);\n\t\t}\n\t}\n\n\t/**\n\t * Registers a `VOICE_SERVER_UPDATE` packet to the voice connection. This will cause it to reconnect using the\n\t * new data provided in the packet.\n\t *\n\t * @param packet - The received `VOICE_SERVER_UPDATE` packet\n\t */\n\tprivate addServerPacket(packet: GatewayVoiceServerUpdateDispatchData) {\n\t\tthis.packets.server = packet;\n\t\tif (packet.endpoint) {\n\t\t\tthis.configureNetworking();\n\t\t} else if (this.state.status !== VoiceConnectionStatus.Destroyed) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\treason: VoiceConnectionDisconnectReason.EndpointRemoved,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Registers a `VOICE_STATE_UPDATE` packet to the voice connection. Most importantly, it stores the id of the\n\t * channel that the client is connected to.\n\t *\n\t * @param packet - The received `VOICE_STATE_UPDATE` packet\n\t */\n\tprivate addStatePacket(packet: GatewayVoiceStateUpdateDispatchData) {\n\t\tthis.packets.state = packet;\n\n\t\tif (packet.self_deaf !== undefined) this.joinConfig.selfDeaf = packet.self_deaf;\n\t\tif (packet.self_mute !== undefined) this.joinConfig.selfMute = packet.self_mute;\n\t\tif (packet.channel_id) this.joinConfig.channelId = packet.channel_id;\n\t\t/*\n\t\t\tthe channel_id being null doesn't necessarily mean it was intended for the client to leave the voice channel\n\t\t\tas it may have disconnected due to network failure. This will be gracefully handled once the voice websocket\n\t\t\tdies, and then it is up to the user to decide how they wish to handle this.\n\t\t*/\n\t}\n\n\t/**\n\t * Called when the networking state changes, and the new ws/udp packet/message handlers need to be rebound\n\t * to the new instances.\n\t *\n\t * @param newState - The new networking state\n\t * @param oldState - The old networking state, if there is one\n\t */\n\tprivate updateReceiveBindings(newState: NetworkingState, oldState?: NetworkingState) {\n\t\tconst oldWs = Reflect.get(oldState ?? {}, 'ws') as VoiceWebSocket | undefined;\n\t\tconst newWs = Reflect.get(newState, 'ws') as VoiceWebSocket | undefined;\n\t\tconst oldUdp = Reflect.get(oldState ?? {}, 'udp') as VoiceUDPSocket | undefined;\n\t\tconst newUdp = Reflect.get(newState, 'udp') as VoiceUDPSocket | undefined;\n\n\t\tif (oldWs !== newWs) {\n\t\t\toldWs?.off('packet', this.receiver.onWsPacket);\n\t\t\tnewWs?.on('packet', this.receiver.onWsPacket);\n\t\t}\n\n\t\tif (oldUdp !== newUdp) {\n\t\t\toldUdp?.off('message', this.receiver.onUdpMessage);\n\t\t\tnewUdp?.on('message', this.receiver.onUdpMessage);\n\t\t}\n\n\t\tthis.receiver.connectionData = Reflect.get(newState, 'connectionData') ?? {};\n\t}\n\n\t/**\n\t * Attempts to configure a networking instance for this voice connection using the received packets.\n\t * Both packets are required, and any existing networking instance will be destroyed.\n\t *\n\t * @remarks\n\t * This is called when the voice server of the connection changes, e.g. if the bot is moved into a\n\t * different channel in the same guild but has a different voice server. In this instance, the connection\n\t * needs to be re-established to the new voice server.\n\t *\n\t * The connection will transition to the Connecting state when this is called.\n\t */\n\tpublic configureNetworking() {\n\t\tconst { server, state } = this.packets;\n\t\tif (!server || !state || this.state.status === VoiceConnectionStatus.Destroyed || !server.endpoint) return;\n\n\t\tconst networking = new Networking(\n\t\t\t{\n\t\t\t\tendpoint: server.endpoint,\n\t\t\t\tserverId: server.guild_id,\n\t\t\t\ttoken: server.token,\n\t\t\t\tsessionId: state.session_id,\n\t\t\t\tuserId: state.user_id,\n\t\t\t},\n\t\t\tBoolean(this.debug),\n\t\t);\n\n\t\tnetworking.once('close', this.onNetworkingClose);\n\t\tnetworking.on('stateChange', this.onNetworkingStateChange);\n\t\tnetworking.on('error', this.onNetworkingError);\n\t\tnetworking.on('debug', this.onNetworkingDebug);\n\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\tstatus: VoiceConnectionStatus.Connecting,\n\t\t\tnetworking,\n\t\t};\n\t}\n\n\t/**\n\t * Called when the networking instance for this connection closes. If the close code is 4014 (do not reconnect),\n\t * the voice connection will transition to the Disconnected state which will store the close code. You can\n\t * decide whether or not to reconnect when this occurs by listening for the state change and calling reconnect().\n\t *\n\t * @remarks\n\t * If the close code was anything other than 4014, it is likely that the closing was not intended, and so the\n\t * VoiceConnection will signal to Discord that it would like to rejoin the channel. This automatically attempts\n\t * to re-establish the connection. This would be seen as a transition from the Ready state to the Signalling state.\n\t * @param code - The close code\n\t */\n\tprivate onNetworkingClose(code: number) {\n\t\tif (this.state.status === VoiceConnectionStatus.Destroyed) return;\n\t\t// If networking closes, try to connect to the voice channel again.\n\t\tif (code === 4_014) {\n\t\t\t// Disconnected - networking is already destroyed here\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\treason: VoiceConnectionDisconnectReason.WebSocketClose,\n\t\t\t\tcloseCode: code,\n\t\t\t};\n\t\t} else {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Signalling,\n\t\t\t};\n\t\t\tthis.rejoinAttempts++;\n\t\t\tif (!this.state.adapter.sendPayload(createJoinVoiceChannelPayload(this.joinConfig))) {\n\t\t\t\tthis.state = {\n\t\t\t\t\t...this.state,\n\t\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Called when the state of the networking instance changes. This is used to derive the state of the voice connection.\n\t *\n\t * @param oldState - The previous state\n\t * @param newState - The new state\n\t */\n\tprivate onNetworkingStateChange(oldState: NetworkingState, newState: NetworkingState) {\n\t\tthis.updateReceiveBindings(newState, oldState);\n\t\tif (oldState.code === newState.code) return;\n\t\tif (this.state.status !== VoiceConnectionStatus.Connecting && this.state.status !== VoiceConnectionStatus.Ready)\n\t\t\treturn;\n\n\t\tif (newState.code === NetworkingStatusCode.Ready) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Ready,\n\t\t\t};\n\t\t} else if (newState.code !== NetworkingStatusCode.Closed) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Connecting,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Propagates errors from the underlying network instance.\n\t *\n\t * @param error - The error to propagate\n\t */\n\tprivate onNetworkingError(error: Error) {\n\t\tthis.emit('error', error);\n\t}\n\n\t/**\n\t * Propagates debug messages from the underlying network instance.\n\t *\n\t * @param message - The debug message to propagate\n\t */\n\tprivate onNetworkingDebug(message: string) {\n\t\tthis.debug?.(`[NW] ${message}`);\n\t}\n\n\t/**\n\t * Prepares an audio packet for dispatch.\n\t *\n\t * @param buffer - The Opus packet to prepare\n\t */\n\tpublic prepareAudioPacket(buffer: Buffer) {\n\t\tconst state = this.state;\n\t\tif (state.status !== VoiceConnectionStatus.Ready) return;\n\t\treturn state.networking.prepareAudioPacket(buffer);\n\t}\n\n\t/**\n\t * Dispatches the previously prepared audio packet (if any)\n\t */\n\tpublic dispatchAudio() {\n\t\tconst state = this.state;\n\t\tif (state.status !== VoiceConnectionStatus.Ready) return;\n\t\treturn state.networking.dispatchAudio();\n\t}\n\n\t/**\n\t * Prepares an audio packet and dispatches it immediately.\n\t *\n\t * @param buffer - The Opus packet to play\n\t */\n\tpublic playOpusPacket(buffer: Buffer) {\n\t\tconst state = this.state;\n\t\tif (state.status !== VoiceConnectionStatus.Ready) return;\n\t\tstate.networking.prepareAudioPacket(buffer);\n\t\treturn state.networking.dispatchAudio();\n\t}\n\n\t/**\n\t * Destroys the VoiceConnection, preventing it from connecting to voice again.\n\t * This method should be called when you no longer require the VoiceConnection to\n\t * prevent memory leaks.\n\t *\n\t * @param adapterAvailable - Whether the adapter can be used\n\t */\n\tpublic destroy(adapterAvailable = true) {\n\t\tif (this.state.status === VoiceConnectionStatus.Destroyed) {\n\t\t\tthrow new Error('Cannot destroy VoiceConnection - it has already been destroyed');\n\t\t}\n\n\t\tif (getVoiceConnection(this.joinConfig.guildId, this.joinConfig.group) === this) {\n\t\t\tuntrackVoiceConnection(this);\n\t\t}\n\n\t\tif (adapterAvailable) {\n\t\t\tthis.state.adapter.sendPayload(createJoinVoiceChannelPayload({ ...this.joinConfig, channelId: null }));\n\t\t}\n\n\t\tthis.state = {\n\t\t\tstatus: VoiceConnectionStatus.Destroyed,\n\t\t};\n\t}\n\n\t/**\n\t * Disconnects the VoiceConnection, allowing the possibility of rejoining later on.\n\t *\n\t * @returns `true` if the connection was successfully disconnected\n\t */\n\tpublic disconnect() {\n\t\tif (\n\t\t\tthis.state.status === VoiceConnectionStatus.Destroyed ||\n\t\t\tthis.state.status === VoiceConnectionStatus.Signalling\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.joinConfig.channelId = null;\n\t\tif (!this.state.adapter.sendPayload(createJoinVoiceChannelPayload(this.joinConfig))) {\n\t\t\tthis.state = {\n\t\t\t\tadapter: this.state.adapter,\n\t\t\t\tsubscription: this.state.subscription,\n\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t\t};\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.state = {\n\t\t\tadapter: this.state.adapter,\n\t\t\treason: VoiceConnectionDisconnectReason.Manual,\n\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t};\n\t\treturn true;\n\t}\n\n\t/**\n\t * Attempts to rejoin (better explanation soon:tm:)\n\t *\n\t * @remarks\n\t * Calling this method successfully will automatically increment the `rejoinAttempts` counter,\n\t * which you can use to inform whether or not you'd like to keep attempting to reconnect your\n\t * voice connection.\n\t *\n\t * A state transition from Disconnected to Signalling will be observed when this is called.\n\t */\n\tpublic rejoin(joinConfig?: Omit) {\n\t\tif (this.state.status === VoiceConnectionStatus.Destroyed) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst notReady = this.state.status !== VoiceConnectionStatus.Ready;\n\n\t\tif (notReady) this.rejoinAttempts++;\n\t\tObject.assign(this.joinConfig, joinConfig);\n\t\tif (this.state.adapter.sendPayload(createJoinVoiceChannelPayload(this.joinConfig))) {\n\t\t\tif (notReady) {\n\t\t\t\tthis.state = {\n\t\t\t\t\t...this.state,\n\t\t\t\t\tstatus: VoiceConnectionStatus.Signalling,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tthis.state = {\n\t\t\tadapter: this.state.adapter,\n\t\t\tsubscription: this.state.subscription,\n\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t};\n\t\treturn false;\n\t}\n\n\t/**\n\t * Updates the speaking status of the voice connection. This is used when audio players are done playing audio,\n\t * and need to signal that the connection is no longer playing audio.\n\t *\n\t * @param enabled - Whether or not to show as speaking\n\t */\n\tpublic setSpeaking(enabled: boolean) {\n\t\tif (this.state.status !== VoiceConnectionStatus.Ready) return false;\n\t\t// eslint-disable-next-line @typescript-eslint/no-confusing-void-expression\n\t\treturn this.state.networking.setSpeaking(enabled);\n\t}\n\n\t/**\n\t * Subscribes to an audio player, allowing the player to play audio on this voice connection.\n\t *\n\t * @param player - The audio player to subscribe to\n\t * @returns The created subscription\n\t */\n\tpublic subscribe(player: AudioPlayer) {\n\t\tif (this.state.status === VoiceConnectionStatus.Destroyed) return;\n\n\t\t// eslint-disable-next-line @typescript-eslint/dot-notation\n\t\tconst subscription = player['subscribe'](this);\n\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\tsubscription,\n\t\t};\n\n\t\treturn subscription;\n\t}\n\n\t/**\n\t * The latest ping (in milliseconds) for the WebSocket connection and audio playback for this voice\n\t * connection, if this data is available.\n\t *\n\t * @remarks\n\t * For this data to be available, the VoiceConnection must be in the Ready state, and its underlying\n\t * WebSocket connection and UDP socket must have had at least one ping-pong exchange.\n\t */\n\tpublic get ping() {\n\t\tif (\n\t\t\tthis.state.status === VoiceConnectionStatus.Ready &&\n\t\t\tthis.state.networking.state.code === NetworkingStatusCode.Ready\n\t\t) {\n\t\t\treturn {\n\t\t\t\tws: this.state.networking.state.ws.ping,\n\t\t\t\tudp: this.state.networking.state.udp.ping,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tws: undefined,\n\t\t\tudp: undefined,\n\t\t};\n\t}\n\n\t/**\n\t * Called when a subscription of this voice connection to an audio player is removed.\n\t *\n\t * @param subscription - The removed subscription\n\t */\n\tprotected onSubscriptionRemoved(subscription: PlayerSubscription) {\n\t\tif (this.state.status !== VoiceConnectionStatus.Destroyed && this.state.subscription === subscription) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tsubscription: undefined,\n\t\t\t};\n\t\t}\n\t}\n}\n\n/**\n * Creates a new voice connection.\n *\n * @param joinConfig - The data required to establish the voice connection\n * @param options - The options to use when joining the voice channel\n */\nexport function createVoiceConnection(joinConfig: JoinConfig, options: CreateVoiceConnectionOptions) {\n\tconst payload = createJoinVoiceChannelPayload(joinConfig);\n\tconst existing = getVoiceConnection(joinConfig.guildId, joinConfig.group);\n\tif (existing && existing.state.status !== VoiceConnectionStatus.Destroyed) {\n\t\tif (existing.state.status === VoiceConnectionStatus.Disconnected) {\n\t\t\texisting.rejoin({\n\t\t\t\tchannelId: joinConfig.channelId,\n\t\t\t\tselfDeaf: joinConfig.selfDeaf,\n\t\t\t\tselfMute: joinConfig.selfMute,\n\t\t\t});\n\t\t} else if (!existing.state.adapter.sendPayload(payload)) {\n\t\t\texisting.state = {\n\t\t\t\t...existing.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t\t};\n\t\t}\n\n\t\treturn existing;\n\t}\n\n\tconst voiceConnection = new VoiceConnection(joinConfig, options);\n\ttrackVoiceConnection(voiceConnection);\n\tif (\n\t\tvoiceConnection.state.status !== VoiceConnectionStatus.Destroyed &&\n\t\t!voiceConnection.state.adapter.sendPayload(payload)\n\t) {\n\t\tvoiceConnection.state = {\n\t\t\t...voiceConnection.state,\n\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t};\n\t}\n\n\treturn voiceConnection;\n}\n","import { GatewayOpcodes } from 'discord-api-types/v10';\nimport type { VoiceConnection } from './VoiceConnection';\nimport type { AudioPlayer } from './audio/index';\n\nexport interface JoinConfig {\n\tchannelId: string | null;\n\tgroup: string;\n\tguildId: string;\n\tselfDeaf: boolean;\n\tselfMute: boolean;\n}\n\n/**\n * Sends a voice state update to the main websocket shard of a guild, to indicate joining/leaving/moving across\n * voice channels.\n *\n * @param config - The configuration to use when joining the voice channel\n */\nexport function createJoinVoiceChannelPayload(config: JoinConfig) {\n\treturn {\n\t\top: GatewayOpcodes.VoiceStateUpdate,\n\t\t// eslint-disable-next-line id-length\n\t\td: {\n\t\t\tguild_id: config.guildId,\n\t\t\tchannel_id: config.channelId,\n\t\t\tself_deaf: config.selfDeaf,\n\t\t\tself_mute: config.selfMute,\n\t\t},\n\t};\n}\n\n// Voice Connections\nconst groups = new Map>();\ngroups.set('default', new Map());\n\nfunction getOrCreateGroup(group: string) {\n\tconst existing = groups.get(group);\n\tif (existing) return existing;\n\tconst map = new Map();\n\tgroups.set(group, map);\n\treturn map;\n}\n\n/**\n * Retrieves the map of group names to maps of voice connections. By default, all voice connections\n * are created under the 'default' group.\n *\n * @returns The group map\n */\nexport function getGroups() {\n\treturn groups;\n}\n\n/**\n * Retrieves all the voice connections under the 'default' group.\n *\n * @param group - The group to look up\n * @returns The map of voice connections\n */\nexport function getVoiceConnections(group?: 'default'): Map;\n\n/**\n * Retrieves all the voice connections under the given group name.\n *\n * @param group - The group to look up\n * @returns The map of voice connections\n */\nexport function getVoiceConnections(group: string): Map | undefined;\n\n/**\n * Retrieves all the voice connections under the given group name. Defaults to the 'default' group.\n *\n * @param group - The group to look up\n * @returns The map of voice connections\n */\nexport function getVoiceConnections(group = 'default') {\n\treturn groups.get(group);\n}\n\n/**\n * Finds a voice connection with the given guild id and group. Defaults to the 'default' group.\n *\n * @param guildId - The guild id of the voice connection\n * @param group - the group that the voice connection was registered with\n * @returns The voice connection, if it exists\n */\nexport function getVoiceConnection(guildId: string, group = 'default') {\n\treturn getVoiceConnections(group)?.get(guildId);\n}\n\nexport function untrackVoiceConnection(voiceConnection: VoiceConnection) {\n\treturn getVoiceConnections(voiceConnection.joinConfig.group)?.delete(voiceConnection.joinConfig.guildId);\n}\n\nexport function trackVoiceConnection(voiceConnection: VoiceConnection) {\n\treturn getOrCreateGroup(voiceConnection.joinConfig.group).set(voiceConnection.joinConfig.guildId, voiceConnection);\n}\n\n// Audio Players\n\n// Each audio packet is 20ms long\nconst FRAME_LENGTH = 20;\n\nlet audioCycleInterval: NodeJS.Timeout | undefined;\nlet nextTime = -1;\n\n/**\n * A list of created audio players that are still active and haven't been destroyed.\n */\nconst audioPlayers: AudioPlayer[] = [];\n\n/**\n * Called roughly every 20 milliseconds. Dispatches audio from all players, and then gets the players to prepare\n * the next audio frame.\n */\nfunction audioCycleStep() {\n\tif (nextTime === -1) return;\n\n\tnextTime += FRAME_LENGTH;\n\tconst available = audioPlayers.filter((player) => player.checkPlayable());\n\n\tfor (const player of available) {\n\t\t// eslint-disable-next-line @typescript-eslint/dot-notation\n\t\tplayer['_stepDispatch']();\n\t}\n\n\tprepareNextAudioFrame(available);\n}\n\n/**\n * Recursively gets the players that have been passed as parameters to prepare audio frames that can be played\n * at the start of the next cycle.\n */\nfunction prepareNextAudioFrame(players: AudioPlayer[]) {\n\tconst nextPlayer = players.shift();\n\n\tif (!nextPlayer) {\n\t\tif (nextTime !== -1) {\n\t\t\taudioCycleInterval = setTimeout(() => audioCycleStep(), nextTime - Date.now());\n\t\t}\n\n\t\treturn;\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/dot-notation\n\tnextPlayer['_stepPrepare']();\n\n\t// setImmediate to avoid long audio player chains blocking other scheduled tasks\n\tsetImmediate(() => prepareNextAudioFrame(players));\n}\n\n/**\n * Checks whether or not the given audio player is being driven by the data store clock.\n *\n * @param target - The target to test for\n * @returns `true` if it is being tracked, `false` otherwise\n */\nexport function hasAudioPlayer(target: AudioPlayer) {\n\treturn audioPlayers.includes(target);\n}\n\n/**\n * Adds an audio player to the data store tracking list, if it isn't already there.\n *\n * @param player - The player to track\n */\nexport function addAudioPlayer(player: AudioPlayer) {\n\tif (hasAudioPlayer(player)) return player;\n\taudioPlayers.push(player);\n\tif (audioPlayers.length === 1) {\n\t\tnextTime = Date.now();\n\t\tsetImmediate(() => audioCycleStep());\n\t}\n\n\treturn player;\n}\n\n/**\n * Removes an audio player from the data store tracking list, if it is present there.\n */\nexport function deleteAudioPlayer(player: AudioPlayer) {\n\tconst index = audioPlayers.indexOf(player);\n\tif (index === -1) return;\n\taudioPlayers.splice(index, 1);\n\tif (audioPlayers.length === 0) {\n\t\tnextTime = -1;\n\t\tif (audioCycleInterval !== undefined) clearTimeout(audioCycleInterval);\n\t}\n}\n","/* eslint-disable jsdoc/check-param-names */\n/* eslint-disable id-length */\n/* eslint-disable @typescript-eslint/unbound-method */\nimport { Buffer } from 'node:buffer';\nimport { EventEmitter } from 'node:events';\nimport { VoiceOpcodes } from 'discord-api-types/voice/v4';\nimport type { CloseEvent } from 'ws';\nimport * as secretbox from '../util/Secretbox';\nimport { noop } from '../util/util';\nimport { VoiceUDPSocket } from './VoiceUDPSocket';\nimport { VoiceWebSocket } from './VoiceWebSocket';\n\n// The number of audio channels required by Discord\nconst CHANNELS = 2;\nconst TIMESTAMP_INC = (48_000 / 100) * CHANNELS;\nconst MAX_NONCE_SIZE = 2 ** 32 - 1;\n\nexport const SUPPORTED_ENCRYPTION_MODES = ['xsalsa20_poly1305_lite', 'xsalsa20_poly1305_suffix', 'xsalsa20_poly1305'];\n\n/**\n * The different statuses that a networking instance can hold. The order\n * of the states between OpeningWs and Ready is chronological (first the\n * instance enters OpeningWs, then it enters Identifying etc.)\n */\nexport enum NetworkingStatusCode {\n\tOpeningWs,\n\tIdentifying,\n\tUdpHandshaking,\n\tSelectingProtocol,\n\tReady,\n\tResuming,\n\tClosed,\n}\n\n/**\n * The initial Networking state. Instances will be in this state when a WebSocket connection to a Discord\n * voice gateway is being opened.\n */\nexport interface NetworkingOpeningWsState {\n\tcode: NetworkingStatusCode.OpeningWs;\n\tconnectionOptions: ConnectionOptions;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when it is attempting to authorize itself.\n */\nexport interface NetworkingIdentifyingState {\n\tcode: NetworkingStatusCode.Identifying;\n\tconnectionOptions: ConnectionOptions;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when opening a UDP connection to the IP and port provided\n * by Discord, as well as performing IP discovery.\n */\nexport interface NetworkingUdpHandshakingState {\n\tcode: NetworkingStatusCode.UdpHandshaking;\n\tconnectionData: Pick;\n\tconnectionOptions: ConnectionOptions;\n\tudp: VoiceUDPSocket;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when selecting an encryption protocol for audio packets.\n */\nexport interface NetworkingSelectingProtocolState {\n\tcode: NetworkingStatusCode.SelectingProtocol;\n\tconnectionData: Pick;\n\tconnectionOptions: ConnectionOptions;\n\tudp: VoiceUDPSocket;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when it has a fully established connection to a Discord\n * voice server.\n */\nexport interface NetworkingReadyState {\n\tcode: NetworkingStatusCode.Ready;\n\tconnectionData: ConnectionData;\n\tconnectionOptions: ConnectionOptions;\n\tpreparedPacket?: Buffer | undefined;\n\tudp: VoiceUDPSocket;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when its connection has been dropped unexpectedly, and it\n * is attempting to resume an existing session.\n */\nexport interface NetworkingResumingState {\n\tcode: NetworkingStatusCode.Resuming;\n\tconnectionData: ConnectionData;\n\tconnectionOptions: ConnectionOptions;\n\tpreparedPacket?: Buffer | undefined;\n\tudp: VoiceUDPSocket;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when it has been destroyed. It cannot be recovered from this\n * state.\n */\nexport interface NetworkingClosedState {\n\tcode: NetworkingStatusCode.Closed;\n}\n\n/**\n * The various states that a networking instance can be in.\n */\nexport type NetworkingState =\n\t| NetworkingClosedState\n\t| NetworkingIdentifyingState\n\t| NetworkingOpeningWsState\n\t| NetworkingReadyState\n\t| NetworkingResumingState\n\t| NetworkingSelectingProtocolState\n\t| NetworkingUdpHandshakingState;\n\n/**\n * Details required to connect to the Discord voice gateway. These details\n * are first received on the main bot gateway, in the form of VOICE_SERVER_UPDATE\n * and VOICE_STATE_UPDATE packets.\n */\ninterface ConnectionOptions {\n\tendpoint: string;\n\tserverId: string;\n\tsessionId: string;\n\ttoken: string;\n\tuserId: string;\n}\n\n/**\n * Information about the current connection, e.g. which encryption mode is to be used on\n * the connection, timing information for playback of streams.\n */\nexport interface ConnectionData {\n\tencryptionMode: string;\n\tnonce: number;\n\tnonceBuffer: Buffer;\n\tpacketsPlayed: number;\n\tsecretKey: Uint8Array;\n\tsequence: number;\n\tspeaking: boolean;\n\tssrc: number;\n\ttimestamp: number;\n}\n\n/**\n * An empty buffer that is reused in packet encryption by many different networking instances.\n */\nconst nonce = Buffer.alloc(24);\n\nexport interface Networking extends EventEmitter {\n\t/**\n\t * Debug event for Networking.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'debug', listener: (message: string) => void): this;\n\ton(event: 'error', listener: (error: Error) => void): this;\n\ton(event: 'stateChange', listener: (oldState: NetworkingState, newState: NetworkingState) => void): this;\n\ton(event: 'close', listener: (code: number) => void): this;\n}\n\n/**\n * Stringifies a NetworkingState.\n *\n * @param state - The state to stringify\n */\nfunction stringifyState(state: NetworkingState) {\n\treturn JSON.stringify({\n\t\t...state,\n\t\tws: Reflect.has(state, 'ws'),\n\t\tudp: Reflect.has(state, 'udp'),\n\t});\n}\n\n/**\n * Chooses an encryption mode from a list of given options. Chooses the most preferred option.\n *\n * @param options - The available encryption options\n */\nfunction chooseEncryptionMode(options: string[]): string {\n\tconst option = options.find((option) => SUPPORTED_ENCRYPTION_MODES.includes(option));\n\tif (!option) {\n\t\tthrow new Error(`No compatible encryption modes. Available include: ${options.join(', ')}`);\n\t}\n\n\treturn option;\n}\n\n/**\n * Returns a random number that is in the range of n bits.\n *\n * @param numberOfBits - The number of bits\n */\nfunction randomNBit(numberOfBits: number) {\n\treturn Math.floor(Math.random() * 2 ** numberOfBits);\n}\n\n/**\n * Manages the networking required to maintain a voice connection and dispatch audio packets\n */\nexport class Networking extends EventEmitter {\n\tprivate _state: NetworkingState;\n\n\t/**\n\t * The debug logger function, if debugging is enabled.\n\t */\n\tprivate readonly debug: ((message: string) => void) | null;\n\n\t/**\n\t * Creates a new Networking instance.\n\t */\n\tpublic constructor(options: ConnectionOptions, debug: boolean) {\n\t\tsuper();\n\n\t\tthis.onWsOpen = this.onWsOpen.bind(this);\n\t\tthis.onChildError = this.onChildError.bind(this);\n\t\tthis.onWsPacket = this.onWsPacket.bind(this);\n\t\tthis.onWsClose = this.onWsClose.bind(this);\n\t\tthis.onWsDebug = this.onWsDebug.bind(this);\n\t\tthis.onUdpDebug = this.onUdpDebug.bind(this);\n\t\tthis.onUdpClose = this.onUdpClose.bind(this);\n\n\t\tthis.debug = debug ? (message: string) => this.emit('debug', message) : null;\n\n\t\tthis._state = {\n\t\t\tcode: NetworkingStatusCode.OpeningWs,\n\t\t\tws: this.createWebSocket(options.endpoint),\n\t\t\tconnectionOptions: options,\n\t\t};\n\t}\n\n\t/**\n\t * Destroys the Networking instance, transitioning it into the Closed state.\n\t */\n\tpublic destroy() {\n\t\tthis.state = {\n\t\t\tcode: NetworkingStatusCode.Closed,\n\t\t};\n\t}\n\n\t/**\n\t * The current state of the networking instance.\n\t */\n\tpublic get state(): NetworkingState {\n\t\treturn this._state;\n\t}\n\n\t/**\n\t * Sets a new state for the networking instance, performing clean-up operations where necessary.\n\t */\n\tpublic set state(newState: NetworkingState) {\n\t\tconst oldWs = Reflect.get(this._state, 'ws') as VoiceWebSocket | undefined;\n\t\tconst newWs = Reflect.get(newState, 'ws') as VoiceWebSocket | undefined;\n\t\tif (oldWs && oldWs !== newWs) {\n\t\t\t// The old WebSocket is being freed - remove all handlers from it\n\t\t\toldWs.off('debug', this.onWsDebug);\n\t\t\toldWs.on('error', noop);\n\t\t\toldWs.off('error', this.onChildError);\n\t\t\toldWs.off('open', this.onWsOpen);\n\t\t\toldWs.off('packet', this.onWsPacket);\n\t\t\toldWs.off('close', this.onWsClose);\n\t\t\toldWs.destroy();\n\t\t}\n\n\t\tconst oldUdp = Reflect.get(this._state, 'udp') as VoiceUDPSocket | undefined;\n\t\tconst newUdp = Reflect.get(newState, 'udp') as VoiceUDPSocket | undefined;\n\n\t\tif (oldUdp && oldUdp !== newUdp) {\n\t\t\toldUdp.on('error', noop);\n\t\t\toldUdp.off('error', this.onChildError);\n\t\t\toldUdp.off('close', this.onUdpClose);\n\t\t\toldUdp.off('debug', this.onUdpDebug);\n\t\t\toldUdp.destroy();\n\t\t}\n\n\t\tconst oldState = this._state;\n\t\tthis._state = newState;\n\t\tthis.emit('stateChange', oldState, newState);\n\n\t\tthis.debug?.(`state change:\\nfrom ${stringifyState(oldState)}\\nto ${stringifyState(newState)}`);\n\t}\n\n\t/**\n\t * Creates a new WebSocket to a Discord Voice gateway.\n\t *\n\t * @param endpoint - The endpoint to connect to\n\t */\n\tprivate createWebSocket(endpoint: string) {\n\t\tconst ws = new VoiceWebSocket(`wss://${endpoint}?v=4`, Boolean(this.debug));\n\n\t\tws.on('error', this.onChildError);\n\t\tws.once('open', this.onWsOpen);\n\t\tws.on('packet', this.onWsPacket);\n\t\tws.once('close', this.onWsClose);\n\t\tws.on('debug', this.onWsDebug);\n\n\t\treturn ws;\n\t}\n\n\t/**\n\t * Propagates errors from the children VoiceWebSocket and VoiceUDPSocket.\n\t *\n\t * @param error - The error that was emitted by a child\n\t */\n\tprivate onChildError(error: Error) {\n\t\tthis.emit('error', error);\n\t}\n\n\t/**\n\t * Called when the WebSocket opens. Depending on the state that the instance is in,\n\t * it will either identify with a new session, or it will attempt to resume an existing session.\n\t */\n\tprivate onWsOpen() {\n\t\tif (this.state.code === NetworkingStatusCode.OpeningWs) {\n\t\t\tconst packet = {\n\t\t\t\top: VoiceOpcodes.Identify,\n\t\t\t\td: {\n\t\t\t\t\tserver_id: this.state.connectionOptions.serverId,\n\t\t\t\t\tuser_id: this.state.connectionOptions.userId,\n\t\t\t\t\tsession_id: this.state.connectionOptions.sessionId,\n\t\t\t\t\ttoken: this.state.connectionOptions.token,\n\t\t\t\t},\n\t\t\t};\n\t\t\tthis.state.ws.sendPacket(packet);\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Identifying,\n\t\t\t};\n\t\t} else if (this.state.code === NetworkingStatusCode.Resuming) {\n\t\t\tconst packet = {\n\t\t\t\top: VoiceOpcodes.Resume,\n\t\t\t\td: {\n\t\t\t\t\tserver_id: this.state.connectionOptions.serverId,\n\t\t\t\t\tsession_id: this.state.connectionOptions.sessionId,\n\t\t\t\t\ttoken: this.state.connectionOptions.token,\n\t\t\t\t},\n\t\t\t};\n\t\t\tthis.state.ws.sendPacket(packet);\n\t\t}\n\t}\n\n\t/**\n\t * Called when the WebSocket closes. Based on the reason for closing (given by the code parameter),\n\t * the instance will either attempt to resume, or enter the closed state and emit a 'close' event\n\t * with the close code, allowing the user to decide whether or not they would like to reconnect.\n\t *\n\t * @param code - The close code\n\t */\n\tprivate onWsClose({ code }: CloseEvent) {\n\t\tconst canResume = code === 4_015 || code < 4_000;\n\t\tif (canResume && this.state.code === NetworkingStatusCode.Ready) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Resuming,\n\t\t\t\tws: this.createWebSocket(this.state.connectionOptions.endpoint),\n\t\t\t};\n\t\t} else if (this.state.code !== NetworkingStatusCode.Closed) {\n\t\t\tthis.destroy();\n\t\t\tthis.emit('close', code);\n\t\t}\n\t}\n\n\t/**\n\t * Called when the UDP socket has closed itself if it has stopped receiving replies from Discord.\n\t */\n\tprivate onUdpClose() {\n\t\tif (this.state.code === NetworkingStatusCode.Ready) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Resuming,\n\t\t\t\tws: this.createWebSocket(this.state.connectionOptions.endpoint),\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Called when a packet is received on the connection's WebSocket.\n\t *\n\t * @param packet - The received packet\n\t */\n\tprivate onWsPacket(packet: any) {\n\t\tif (packet.op === VoiceOpcodes.Hello && this.state.code !== NetworkingStatusCode.Closed) {\n\t\t\tthis.state.ws.setHeartbeatInterval(packet.d.heartbeat_interval);\n\t\t} else if (packet.op === VoiceOpcodes.Ready && this.state.code === NetworkingStatusCode.Identifying) {\n\t\t\tconst { ip, port, ssrc, modes } = packet.d;\n\n\t\t\tconst udp = new VoiceUDPSocket({ ip, port });\n\t\t\tudp.on('error', this.onChildError);\n\t\t\tudp.on('debug', this.onUdpDebug);\n\t\t\tudp.once('close', this.onUdpClose);\n\t\t\tudp\n\t\t\t\t.performIPDiscovery(ssrc)\n\t\t\t\t// eslint-disable-next-line promise/prefer-await-to-then\n\t\t\t\t.then((localConfig) => {\n\t\t\t\t\tif (this.state.code !== NetworkingStatusCode.UdpHandshaking) return;\n\t\t\t\t\tthis.state.ws.sendPacket({\n\t\t\t\t\t\top: VoiceOpcodes.SelectProtocol,\n\t\t\t\t\t\td: {\n\t\t\t\t\t\t\tprotocol: 'udp',\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\taddress: localConfig.ip,\n\t\t\t\t\t\t\t\tport: localConfig.port,\n\t\t\t\t\t\t\t\tmode: chooseEncryptionMode(modes),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\tthis.state = {\n\t\t\t\t\t\t...this.state,\n\t\t\t\t\t\tcode: NetworkingStatusCode.SelectingProtocol,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t// eslint-disable-next-line promise/prefer-await-to-then, promise/prefer-await-to-callbacks\n\t\t\t\t.catch((error: Error) => this.emit('error', error));\n\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.UdpHandshaking,\n\t\t\t\tudp,\n\t\t\t\tconnectionData: {\n\t\t\t\t\tssrc,\n\t\t\t\t},\n\t\t\t};\n\t\t} else if (\n\t\t\tpacket.op === VoiceOpcodes.SessionDescription &&\n\t\t\tthis.state.code === NetworkingStatusCode.SelectingProtocol\n\t\t) {\n\t\t\tconst { mode: encryptionMode, secret_key: secretKey } = packet.d;\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Ready,\n\t\t\t\tconnectionData: {\n\t\t\t\t\t...this.state.connectionData,\n\t\t\t\t\tencryptionMode,\n\t\t\t\t\tsecretKey: new Uint8Array(secretKey),\n\t\t\t\t\tsequence: randomNBit(16),\n\t\t\t\t\ttimestamp: randomNBit(32),\n\t\t\t\t\tnonce: 0,\n\t\t\t\t\tnonceBuffer: Buffer.alloc(24),\n\t\t\t\t\tspeaking: false,\n\t\t\t\t\tpacketsPlayed: 0,\n\t\t\t\t},\n\t\t\t};\n\t\t} else if (packet.op === VoiceOpcodes.Resumed && this.state.code === NetworkingStatusCode.Resuming) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Ready,\n\t\t\t};\n\t\t\tthis.state.connectionData.speaking = false;\n\t\t}\n\t}\n\n\t/**\n\t * Propagates debug messages from the child WebSocket.\n\t *\n\t * @param message - The emitted debug message\n\t */\n\tprivate onWsDebug(message: string) {\n\t\tthis.debug?.(`[WS] ${message}`);\n\t}\n\n\t/**\n\t * Propagates debug messages from the child UDPSocket.\n\t *\n\t * @param message - The emitted debug message\n\t */\n\tprivate onUdpDebug(message: string) {\n\t\tthis.debug?.(`[UDP] ${message}`);\n\t}\n\n\t/**\n\t * Prepares an Opus packet for playback. This includes attaching metadata to it and encrypting it.\n\t * It will be stored within the instance, and can be played by dispatchAudio()\n\t *\n\t * @remarks\n\t * Calling this method while there is already a prepared audio packet that has not yet been dispatched\n\t * will overwrite the existing audio packet. This should be avoided.\n\t * @param opusPacket - The Opus packet to encrypt\n\t * @returns The audio packet that was prepared\n\t */\n\tpublic prepareAudioPacket(opusPacket: Buffer) {\n\t\tconst state = this.state;\n\t\tif (state.code !== NetworkingStatusCode.Ready) return;\n\t\tstate.preparedPacket = this.createAudioPacket(opusPacket, state.connectionData);\n\t\treturn state.preparedPacket;\n\t}\n\n\t/**\n\t * Dispatches the audio packet previously prepared by prepareAudioPacket(opusPacket). The audio packet\n\t * is consumed and cannot be dispatched again.\n\t */\n\tpublic dispatchAudio() {\n\t\tconst state = this.state;\n\t\tif (state.code !== NetworkingStatusCode.Ready) return false;\n\t\tif (state.preparedPacket !== undefined) {\n\t\t\tthis.playAudioPacket(state.preparedPacket);\n\t\t\tstate.preparedPacket = undefined;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Plays an audio packet, updating timing metadata used for playback.\n\t *\n\t * @param audioPacket - The audio packet to play\n\t */\n\tprivate playAudioPacket(audioPacket: Buffer) {\n\t\tconst state = this.state;\n\t\tif (state.code !== NetworkingStatusCode.Ready) return;\n\t\tconst { connectionData } = state;\n\t\tconnectionData.packetsPlayed++;\n\t\tconnectionData.sequence++;\n\t\tconnectionData.timestamp += TIMESTAMP_INC;\n\t\tif (connectionData.sequence >= 2 ** 16) connectionData.sequence = 0;\n\t\tif (connectionData.timestamp >= 2 ** 32) connectionData.timestamp = 0;\n\t\tthis.setSpeaking(true);\n\t\tstate.udp.send(audioPacket);\n\t}\n\n\t/**\n\t * Sends a packet to the voice gateway indicating that the client has start/stopped sending\n\t * audio.\n\t *\n\t * @param speaking - Whether or not the client should be shown as speaking\n\t */\n\tpublic setSpeaking(speaking: boolean) {\n\t\tconst state = this.state;\n\t\tif (state.code !== NetworkingStatusCode.Ready) return;\n\t\tif (state.connectionData.speaking === speaking) return;\n\t\tstate.connectionData.speaking = speaking;\n\t\tstate.ws.sendPacket({\n\t\t\top: VoiceOpcodes.Speaking,\n\t\t\td: {\n\t\t\t\tspeaking: speaking ? 1 : 0,\n\t\t\t\tdelay: 0,\n\t\t\t\tssrc: state.connectionData.ssrc,\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Creates a new audio packet from an Opus packet. This involves encrypting the packet,\n\t * then prepending a header that includes metadata.\n\t *\n\t * @param opusPacket - The Opus packet to prepare\n\t * @param connectionData - The current connection data of the instance\n\t */\n\tprivate createAudioPacket(opusPacket: Buffer, connectionData: ConnectionData) {\n\t\tconst packetBuffer = Buffer.alloc(12);\n\t\tpacketBuffer[0] = 0x80;\n\t\tpacketBuffer[1] = 0x78;\n\n\t\tconst { sequence, timestamp, ssrc } = connectionData;\n\n\t\tpacketBuffer.writeUIntBE(sequence, 2, 2);\n\t\tpacketBuffer.writeUIntBE(timestamp, 4, 4);\n\t\tpacketBuffer.writeUIntBE(ssrc, 8, 4);\n\n\t\tpacketBuffer.copy(nonce, 0, 0, 12);\n\t\treturn Buffer.concat([packetBuffer, ...this.encryptOpusPacket(opusPacket, connectionData)]);\n\t}\n\n\t/**\n\t * Encrypts an Opus packet using the format agreed upon by the instance and Discord.\n\t *\n\t * @param opusPacket - The Opus packet to encrypt\n\t * @param connectionData - The current connection data of the instance\n\t */\n\tprivate encryptOpusPacket(opusPacket: Buffer, connectionData: ConnectionData) {\n\t\tconst { secretKey, encryptionMode } = connectionData;\n\n\t\tif (encryptionMode === 'xsalsa20_poly1305_lite') {\n\t\t\tconnectionData.nonce++;\n\t\t\tif (connectionData.nonce > MAX_NONCE_SIZE) connectionData.nonce = 0;\n\t\t\tconnectionData.nonceBuffer.writeUInt32BE(connectionData.nonce, 0);\n\t\t\treturn [\n\t\t\t\tsecretbox.methods.close(opusPacket, connectionData.nonceBuffer, secretKey),\n\t\t\t\tconnectionData.nonceBuffer.slice(0, 4),\n\t\t\t];\n\t\t} else if (encryptionMode === 'xsalsa20_poly1305_suffix') {\n\t\t\tconst random = secretbox.methods.random(24, connectionData.nonceBuffer);\n\t\t\treturn [secretbox.methods.close(opusPacket, random, secretKey), random];\n\t\t}\n\n\t\treturn [secretbox.methods.close(opusPacket, nonce, secretKey)];\n\t}\n}\n","import { Buffer } from 'node:buffer';\n\ninterface Methods {\n\tclose(opusPacket: Buffer, nonce: Buffer, secretKey: Uint8Array): Buffer;\n\topen(buffer: Buffer, nonce: Buffer, secretKey: Uint8Array): Buffer | null;\n\trandom(bytes: number, nonce: Buffer): Buffer;\n}\n\nconst libs = {\n\t'sodium-native': (sodium: any): Methods => ({\n\t\topen: (buffer: Buffer, nonce: Buffer, secretKey: Uint8Array) => {\n\t\t\tif (buffer) {\n\t\t\t\tconst output = Buffer.allocUnsafe(buffer.length - sodium.crypto_box_MACBYTES);\n\t\t\t\tif (sodium.crypto_secretbox_open_easy(output, buffer, nonce, secretKey)) return output;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t},\n\t\tclose: (opusPacket: Buffer, nonce: Buffer, secretKey: Uint8Array) => {\n\t\t\tconst output = Buffer.allocUnsafe(opusPacket.length + sodium.crypto_box_MACBYTES);\n\t\t\tsodium.crypto_secretbox_easy(output, opusPacket, nonce, secretKey);\n\t\t\treturn output;\n\t\t},\n\t\trandom: (num: number, buffer: Buffer = Buffer.allocUnsafe(num)) => {\n\t\t\tsodium.randombytes_buf(buffer);\n\t\t\treturn buffer;\n\t\t},\n\t}),\n\tsodium: (sodium: any): Methods => ({\n\t\topen: sodium.api.crypto_secretbox_open_easy,\n\t\tclose: sodium.api.crypto_secretbox_easy,\n\t\trandom: (num: number, buffer: Buffer = Buffer.allocUnsafe(num)) => {\n\t\t\tsodium.api.randombytes_buf(buffer);\n\t\t\treturn buffer;\n\t\t},\n\t}),\n\t'libsodium-wrappers': (sodium: any): Methods => ({\n\t\topen: sodium.crypto_secretbox_open_easy,\n\t\tclose: sodium.crypto_secretbox_easy,\n\t\trandom: sodium.randombytes_buf,\n\t}),\n\ttweetnacl: (tweetnacl: any): Methods => ({\n\t\topen: tweetnacl.secretbox.open,\n\t\tclose: tweetnacl.secretbox,\n\t\trandom: tweetnacl.randomBytes,\n\t}),\n} as const;\n\nconst fallbackError = () => {\n\tthrow new Error(\n\t\t`Cannot play audio as no valid encryption package is installed.\n- Install sodium, libsodium-wrappers, or tweetnacl.\n- Use the generateDependencyReport() function for more information.\\n`,\n\t);\n};\n\nconst methods: Methods = {\n\topen: fallbackError,\n\tclose: fallbackError,\n\trandom: fallbackError,\n};\n\nvoid (async () => {\n\tfor (const libName of Object.keys(libs) as (keyof typeof libs)[]) {\n\t\ttry {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n\t\t\tconst lib = require(libName);\n\t\t\tif (libName === 'libsodium-wrappers' && lib.ready) await lib.ready;\n\t\t\tObject.assign(methods, libs[libName](lib));\n\t\t\tbreak;\n\t\t} catch {}\n\t}\n})();\n\nexport { methods };\n","export const noop = () => {};\n","import { Buffer } from 'node:buffer';\nimport { createSocket, type Socket } from 'node:dgram';\nimport { EventEmitter } from 'node:events';\nimport { isIPv4 } from 'node:net';\n\n/**\n * Stores an IP address and port. Used to store socket details for the local client as well as\n * for Discord.\n */\nexport interface SocketConfig {\n\tip: string;\n\tport: number;\n}\n\n/**\n * Parses the response from Discord to aid with local IP discovery.\n *\n * @param message - The received message\n */\nexport function parseLocalPacket(message: Buffer): SocketConfig {\n\tconst packet = Buffer.from(message);\n\n\tconst ip = packet.slice(8, packet.indexOf(0, 8)).toString('utf8');\n\n\tif (!isIPv4(ip)) {\n\t\tthrow new Error('Malformed IP address');\n\t}\n\n\tconst port = packet.readUInt16BE(packet.length - 2);\n\n\treturn { ip, port };\n}\n\n/**\n * The interval in milliseconds at which keep alive datagrams are sent.\n */\nconst KEEP_ALIVE_INTERVAL = 5e3;\n\n/**\n * The maximum value of the keep alive counter.\n */\nconst MAX_COUNTER_VALUE = 2 ** 32 - 1;\n\nexport interface VoiceUDPSocket extends EventEmitter {\n\ton(event: 'error', listener: (error: Error) => void): this;\n\ton(event: 'close', listener: () => void): this;\n\ton(event: 'debug', listener: (message: string) => void): this;\n\ton(event: 'message', listener: (message: Buffer) => void): this;\n}\n\n/**\n * Manages the UDP networking for a voice connection.\n */\nexport class VoiceUDPSocket extends EventEmitter {\n\t/**\n\t * The underlying network Socket for the VoiceUDPSocket.\n\t */\n\tprivate readonly socket: Socket;\n\n\t/**\n\t * The socket details for Discord (remote)\n\t */\n\tprivate readonly remote: SocketConfig;\n\n\t/**\n\t * The counter used in the keep alive mechanism.\n\t */\n\tprivate keepAliveCounter = 0;\n\n\t/**\n\t * The buffer used to write the keep alive counter into.\n\t */\n\tprivate readonly keepAliveBuffer: Buffer;\n\n\t/**\n\t * The Node.js interval for the keep-alive mechanism.\n\t */\n\tprivate readonly keepAliveInterval: NodeJS.Timeout;\n\n\t/**\n\t * The time taken to receive a response to keep alive messages.\n\t *\n\t * @deprecated This field is no longer updated as keep alive messages are no longer tracked.\n\t */\n\tpublic ping?: number;\n\n\t/**\n\t * Creates a new VoiceUDPSocket.\n\t *\n\t * @param remote - Details of the remote socket\n\t */\n\tpublic constructor(remote: SocketConfig) {\n\t\tsuper();\n\t\tthis.socket = createSocket('udp4');\n\t\tthis.socket.on('error', (error: Error) => this.emit('error', error));\n\t\tthis.socket.on('message', (buffer: Buffer) => this.onMessage(buffer));\n\t\tthis.socket.on('close', () => this.emit('close'));\n\t\tthis.remote = remote;\n\t\tthis.keepAliveBuffer = Buffer.alloc(8);\n\t\tthis.keepAliveInterval = setInterval(() => this.keepAlive(), KEEP_ALIVE_INTERVAL);\n\t\tsetImmediate(() => this.keepAlive());\n\t}\n\n\t/**\n\t * Called when a message is received on the UDP socket.\n\t *\n\t * @param buffer - The received buffer\n\t */\n\tprivate onMessage(buffer: Buffer): void {\n\t\t// Propagate the message\n\t\tthis.emit('message', buffer);\n\t}\n\n\t/**\n\t * Called at a regular interval to check whether we are still able to send datagrams to Discord.\n\t */\n\tprivate keepAlive() {\n\t\tthis.keepAliveBuffer.writeUInt32LE(this.keepAliveCounter, 0);\n\t\tthis.send(this.keepAliveBuffer);\n\t\tthis.keepAliveCounter++;\n\t\tif (this.keepAliveCounter > MAX_COUNTER_VALUE) {\n\t\t\tthis.keepAliveCounter = 0;\n\t\t}\n\t}\n\n\t/**\n\t * Sends a buffer to Discord.\n\t *\n\t * @param buffer - The buffer to send\n\t */\n\tpublic send(buffer: Buffer) {\n\t\tthis.socket.send(buffer, this.remote.port, this.remote.ip);\n\t}\n\n\t/**\n\t * Closes the socket, the instance will not be able to be reused.\n\t */\n\tpublic destroy() {\n\t\ttry {\n\t\t\tthis.socket.close();\n\t\t} catch {}\n\n\t\tclearInterval(this.keepAliveInterval);\n\t}\n\n\t/**\n\t * Performs IP discovery to discover the local address and port to be used for the voice connection.\n\t *\n\t * @param ssrc - The SSRC received from Discord\n\t */\n\tpublic async performIPDiscovery(ssrc: number): Promise {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst listener = (message: Buffer) => {\n\t\t\t\ttry {\n\t\t\t\t\tif (message.readUInt16BE(0) !== 2) return;\n\t\t\t\t\tconst packet = parseLocalPacket(message);\n\t\t\t\t\tthis.socket.off('message', listener);\n\t\t\t\t\tresolve(packet);\n\t\t\t\t} catch {}\n\t\t\t};\n\n\t\t\tthis.socket.on('message', listener);\n\t\t\tthis.socket.once('close', () => reject(new Error('Cannot perform IP discovery - socket closed')));\n\n\t\t\tconst discoveryBuffer = Buffer.alloc(74);\n\n\t\t\tdiscoveryBuffer.writeUInt16BE(1, 0);\n\t\t\tdiscoveryBuffer.writeUInt16BE(70, 2);\n\t\t\tdiscoveryBuffer.writeUInt32BE(ssrc, 4);\n\t\t\tthis.send(discoveryBuffer);\n\t\t});\n\t}\n}\n","import { EventEmitter } from 'node:events';\nimport { VoiceOpcodes } from 'discord-api-types/voice/v4';\nimport WebSocket, { type MessageEvent } from 'ws';\n\nexport interface VoiceWebSocket extends EventEmitter {\n\ton(event: 'error', listener: (error: Error) => void): this;\n\ton(event: 'open', listener: (event: WebSocket.Event) => void): this;\n\ton(event: 'close', listener: (event: WebSocket.CloseEvent) => void): this;\n\t/**\n\t * Debug event for VoiceWebSocket.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'debug', listener: (message: string) => void): this;\n\t/**\n\t * Packet event.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'packet', listener: (packet: any) => void): this;\n}\n\n/**\n * An extension of the WebSocket class to provide helper functionality when interacting\n * with the Discord Voice gateway.\n */\nexport class VoiceWebSocket extends EventEmitter {\n\t/**\n\t * The current heartbeat interval, if any.\n\t */\n\tprivate heartbeatInterval?: NodeJS.Timeout;\n\n\t/**\n\t * The time (milliseconds since UNIX epoch) that the last heartbeat acknowledgement packet was received.\n\t * This is set to 0 if an acknowledgement packet hasn't been received yet.\n\t */\n\tprivate lastHeartbeatAck: number;\n\n\t/**\n\t * The time (milliseconds since UNIX epoch) that the last heartbeat was sent. This is set to 0 if a heartbeat\n\t * hasn't been sent yet.\n\t */\n\tprivate lastHeartbeatSend: number;\n\n\t/**\n\t * The number of consecutively missed heartbeats.\n\t */\n\tprivate missedHeartbeats = 0;\n\n\t/**\n\t * The last recorded ping.\n\t */\n\tpublic ping?: number;\n\n\t/**\n\t * The debug logger function, if debugging is enabled.\n\t */\n\tprivate readonly debug: ((message: string) => void) | null;\n\n\t/**\n\t * The underlying WebSocket of this wrapper.\n\t */\n\tprivate readonly ws: WebSocket;\n\n\t/**\n\t * Creates a new VoiceWebSocket.\n\t *\n\t * @param address - The address to connect to\n\t */\n\tpublic constructor(address: string, debug: boolean) {\n\t\tsuper();\n\t\tthis.ws = new WebSocket(address);\n\t\tthis.ws.onmessage = (err) => this.onMessage(err);\n\t\tthis.ws.onopen = (err) => this.emit('open', err);\n\t\tthis.ws.onerror = (err: Error | WebSocket.ErrorEvent) => this.emit('error', err instanceof Error ? err : err.error);\n\t\tthis.ws.onclose = (err) => this.emit('close', err);\n\n\t\tthis.lastHeartbeatAck = 0;\n\t\tthis.lastHeartbeatSend = 0;\n\n\t\tthis.debug = debug ? (message: string) => this.emit('debug', message) : null;\n\t}\n\n\t/**\n\t * Destroys the VoiceWebSocket. The heartbeat interval is cleared, and the connection is closed.\n\t */\n\tpublic destroy() {\n\t\ttry {\n\t\t\tthis.debug?.('destroyed');\n\t\t\tthis.setHeartbeatInterval(-1);\n\t\t\tthis.ws.close(1_000);\n\t\t} catch (error) {\n\t\t\tconst err = error as Error;\n\t\t\tthis.emit('error', err);\n\t\t}\n\t}\n\n\t/**\n\t * Handles message events on the WebSocket. Attempts to JSON parse the messages and emit them\n\t * as packets.\n\t *\n\t * @param event - The message event\n\t */\n\tpublic onMessage(event: MessageEvent) {\n\t\tif (typeof event.data !== 'string') return;\n\n\t\tthis.debug?.(`<< ${event.data}`);\n\n\t\tlet packet: any;\n\t\ttry {\n\t\t\tpacket = JSON.parse(event.data);\n\t\t} catch (error) {\n\t\t\tconst err = error as Error;\n\t\t\tthis.emit('error', err);\n\t\t\treturn;\n\t\t}\n\n\t\tif (packet.op === VoiceOpcodes.HeartbeatAck) {\n\t\t\tthis.lastHeartbeatAck = Date.now();\n\t\t\tthis.missedHeartbeats = 0;\n\t\t\tthis.ping = this.lastHeartbeatAck - this.lastHeartbeatSend;\n\t\t}\n\n\t\tthis.emit('packet', packet);\n\t}\n\n\t/**\n\t * Sends a JSON-stringifiable packet over the WebSocket.\n\t *\n\t * @param packet - The packet to send\n\t */\n\tpublic sendPacket(packet: any) {\n\t\ttry {\n\t\t\tconst stringified = JSON.stringify(packet);\n\t\t\tthis.debug?.(`>> ${stringified}`);\n\t\t\tthis.ws.send(stringified);\n\t\t} catch (error) {\n\t\t\tconst err = error as Error;\n\t\t\tthis.emit('error', err);\n\t\t}\n\t}\n\n\t/**\n\t * Sends a heartbeat over the WebSocket.\n\t */\n\tprivate sendHeartbeat() {\n\t\tthis.lastHeartbeatSend = Date.now();\n\t\tthis.missedHeartbeats++;\n\t\tconst nonce = this.lastHeartbeatSend;\n\t\tthis.sendPacket({\n\t\t\top: VoiceOpcodes.Heartbeat,\n\t\t\t// eslint-disable-next-line id-length\n\t\t\td: nonce,\n\t\t});\n\t}\n\n\t/**\n\t * Sets/clears an interval to send heartbeats over the WebSocket.\n\t *\n\t * @param ms - The interval in milliseconds. If negative, the interval will be unset\n\t */\n\tpublic setHeartbeatInterval(ms: number) {\n\t\tif (this.heartbeatInterval !== undefined) clearInterval(this.heartbeatInterval);\n\t\tif (ms > 0) {\n\t\t\tthis.heartbeatInterval = setInterval(() => {\n\t\t\t\tif (this.lastHeartbeatSend !== 0 && this.missedHeartbeats >= 3) {\n\t\t\t\t\t// Missed too many heartbeats - disconnect\n\t\t\t\t\tthis.ws.close();\n\t\t\t\t\tthis.setHeartbeatInterval(-1);\n\t\t\t\t}\n\n\t\t\t\tthis.sendHeartbeat();\n\t\t\t}, ms);\n\t\t}\n\t}\n}\n","/* eslint-disable jsdoc/check-param-names */\n\nimport { Buffer } from 'node:buffer';\nimport { VoiceOpcodes } from 'discord-api-types/voice/v4';\nimport type { VoiceConnection } from '../VoiceConnection';\nimport type { ConnectionData } from '../networking/Networking';\nimport { methods } from '../util/Secretbox';\nimport {\n\tAudioReceiveStream,\n\tcreateDefaultAudioReceiveStreamOptions,\n\ttype AudioReceiveStreamOptions,\n} from './AudioReceiveStream';\nimport { SSRCMap } from './SSRCMap';\nimport { SpeakingMap } from './SpeakingMap';\n\n/**\n * Attaches to a VoiceConnection, allowing you to receive audio packets from other\n * users that are speaking.\n *\n * @beta\n */\nexport class VoiceReceiver {\n\t/**\n\t * The attached connection of this receiver.\n\t */\n\tpublic readonly voiceConnection;\n\n\t/**\n\t * Maps SSRCs to Discord user ids.\n\t */\n\tpublic readonly ssrcMap: SSRCMap;\n\n\t/**\n\t * The current audio subscriptions of this receiver.\n\t */\n\tpublic readonly subscriptions: Map;\n\n\t/**\n\t * The connection data of the receiver.\n\t *\n\t * @internal\n\t */\n\tpublic connectionData: Partial;\n\n\t/**\n\t * The speaking map of the receiver.\n\t */\n\tpublic readonly speaking: SpeakingMap;\n\n\tpublic constructor(voiceConnection: VoiceConnection) {\n\t\tthis.voiceConnection = voiceConnection;\n\t\tthis.ssrcMap = new SSRCMap();\n\t\tthis.speaking = new SpeakingMap();\n\t\tthis.subscriptions = new Map();\n\t\tthis.connectionData = {};\n\n\t\tthis.onWsPacket = this.onWsPacket.bind(this);\n\t\tthis.onUdpMessage = this.onUdpMessage.bind(this);\n\t}\n\n\t/**\n\t * Called when a packet is received on the attached connection's WebSocket.\n\t *\n\t * @param packet - The received packet\n\t * @internal\n\t */\n\tpublic onWsPacket(packet: any) {\n\t\tif (packet.op === VoiceOpcodes.ClientDisconnect && typeof packet.d?.user_id === 'string') {\n\t\t\tthis.ssrcMap.delete(packet.d.user_id);\n\t\t} else if (\n\t\t\tpacket.op === VoiceOpcodes.Speaking &&\n\t\t\ttypeof packet.d?.user_id === 'string' &&\n\t\t\ttypeof packet.d?.ssrc === 'number'\n\t\t) {\n\t\t\tthis.ssrcMap.update({ userId: packet.d.user_id, audioSSRC: packet.d.ssrc });\n\t\t} else if (\n\t\t\tpacket.op === VoiceOpcodes.ClientConnect &&\n\t\t\ttypeof packet.d?.user_id === 'string' &&\n\t\t\ttypeof packet.d?.audio_ssrc === 'number'\n\t\t) {\n\t\t\tthis.ssrcMap.update({\n\t\t\t\tuserId: packet.d.user_id,\n\t\t\t\taudioSSRC: packet.d.audio_ssrc,\n\t\t\t\tvideoSSRC: packet.d.video_ssrc === 0 ? undefined : packet.d.video_ssrc,\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate decrypt(buffer: Buffer, mode: string, nonce: Buffer, secretKey: Uint8Array) {\n\t\t// Choose correct nonce depending on encryption\n\t\tlet end;\n\t\tif (mode === 'xsalsa20_poly1305_lite') {\n\t\t\tbuffer.copy(nonce, 0, buffer.length - 4);\n\t\t\tend = buffer.length - 4;\n\t\t} else if (mode === 'xsalsa20_poly1305_suffix') {\n\t\t\tbuffer.copy(nonce, 0, buffer.length - 24);\n\t\t\tend = buffer.length - 24;\n\t\t} else {\n\t\t\tbuffer.copy(nonce, 0, 0, 12);\n\t\t}\n\n\t\t// Open packet\n\t\tconst decrypted = methods.open(buffer.slice(12, end), nonce, secretKey);\n\t\tif (!decrypted) return;\n\t\treturn Buffer.from(decrypted);\n\t}\n\n\t/**\n\t * Parses an audio packet, decrypting it to yield an Opus packet.\n\t *\n\t * @param buffer - The buffer to parse\n\t * @param mode - The encryption mode\n\t * @param nonce - The nonce buffer used by the connection for encryption\n\t * @param secretKey - The secret key used by the connection for encryption\n\t * @returns The parsed Opus packet\n\t */\n\tprivate parsePacket(buffer: Buffer, mode: string, nonce: Buffer, secretKey: Uint8Array) {\n\t\tlet packet = this.decrypt(buffer, mode, nonce, secretKey);\n\t\tif (!packet) return;\n\n\t\t// Strip RTP Header Extensions (one-byte only)\n\t\tif (packet[0] === 0xbe && packet[1] === 0xde) {\n\t\t\tconst headerExtensionLength = packet.readUInt16BE(2);\n\t\t\tpacket = packet.subarray(4 + 4 * headerExtensionLength);\n\t\t}\n\n\t\treturn packet;\n\t}\n\n\t/**\n\t * Called when the UDP socket of the attached connection receives a message.\n\t *\n\t * @param msg - The received message\n\t * @internal\n\t */\n\tpublic onUdpMessage(msg: Buffer) {\n\t\tif (msg.length <= 8) return;\n\t\tconst ssrc = msg.readUInt32BE(8);\n\n\t\tconst userData = this.ssrcMap.get(ssrc);\n\t\tif (!userData) return;\n\n\t\tthis.speaking.onPacket(userData.userId);\n\n\t\tconst stream = this.subscriptions.get(userData.userId);\n\t\tif (!stream) return;\n\n\t\tif (this.connectionData.encryptionMode && this.connectionData.nonceBuffer && this.connectionData.secretKey) {\n\t\t\tconst packet = this.parsePacket(\n\t\t\t\tmsg,\n\t\t\t\tthis.connectionData.encryptionMode,\n\t\t\t\tthis.connectionData.nonceBuffer,\n\t\t\t\tthis.connectionData.secretKey,\n\t\t\t);\n\t\t\tif (packet) {\n\t\t\t\tstream.push(packet);\n\t\t\t} else {\n\t\t\t\tstream.destroy(new Error('Failed to parse packet'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Creates a subscription for the given user id.\n\t *\n\t * @param target - The id of the user to subscribe to\n\t * @returns A readable stream of Opus packets received from the target\n\t */\n\tpublic subscribe(userId: string, options?: Partial) {\n\t\tconst existing = this.subscriptions.get(userId);\n\t\tif (existing) return existing;\n\n\t\tconst stream = new AudioReceiveStream({\n\t\t\t...createDefaultAudioReceiveStreamOptions(),\n\t\t\t...options,\n\t\t});\n\n\t\tstream.once('close', () => this.subscriptions.delete(userId));\n\t\tthis.subscriptions.set(userId, stream);\n\t\treturn stream;\n\t}\n}\n","import type { Buffer } from 'node:buffer';\nimport { Readable, type ReadableOptions } from 'node:stream';\nimport { SILENCE_FRAME } from '../audio/AudioPlayer';\n\n/**\n * The different behaviors an audio receive stream can have for deciding when to end.\n */\nexport enum EndBehaviorType {\n\t/**\n\t * The stream will only end when manually destroyed.\n\t */\n\tManual,\n\n\t/**\n\t * The stream will end after a given time period of silence/no audio packets.\n\t */\n\tAfterSilence,\n\n\t/**\n\t * The stream will end after a given time period of no audio packets.\n\t */\n\tAfterInactivity,\n}\n\nexport type EndBehavior =\n\t| {\n\t\t\tbehavior: EndBehaviorType.AfterInactivity | EndBehaviorType.AfterSilence;\n\t\t\tduration: number;\n\t }\n\t| {\n\t\t\tbehavior: EndBehaviorType.Manual;\n\t };\n\nexport interface AudioReceiveStreamOptions extends ReadableOptions {\n\tend: EndBehavior;\n}\n\nexport function createDefaultAudioReceiveStreamOptions(): AudioReceiveStreamOptions {\n\treturn {\n\t\tend: {\n\t\t\tbehavior: EndBehaviorType.Manual,\n\t\t},\n\t};\n}\n\n/**\n * A readable stream of Opus packets received from a specific entity\n * in a Discord voice connection.\n */\nexport class AudioReceiveStream extends Readable {\n\t/**\n\t * The end behavior of the receive stream.\n\t */\n\tpublic readonly end: EndBehavior;\n\n\tprivate endTimeout?: NodeJS.Timeout;\n\n\tpublic constructor({ end, ...options }: AudioReceiveStreamOptions) {\n\t\tsuper({\n\t\t\t...options,\n\t\t\tobjectMode: true,\n\t\t});\n\n\t\tthis.end = end;\n\t}\n\n\tpublic override push(buffer: Buffer | null) {\n\t\tif (\n\t\t\tbuffer &&\n\t\t\t(this.end.behavior === EndBehaviorType.AfterInactivity ||\n\t\t\t\t(this.end.behavior === EndBehaviorType.AfterSilence &&\n\t\t\t\t\t(buffer.compare(SILENCE_FRAME) !== 0 || this.endTimeout === undefined)))\n\t\t) {\n\t\t\tthis.renewEndTimeout(this.end);\n\t\t}\n\n\t\treturn super.push(buffer);\n\t}\n\n\tprivate renewEndTimeout(end: EndBehavior & { duration: number }) {\n\t\tif (this.endTimeout) {\n\t\t\tclearTimeout(this.endTimeout);\n\t\t}\n\n\t\tthis.endTimeout = setTimeout(() => this.push(null), end.duration);\n\t}\n\n\tpublic override _read() {}\n}\n","/* eslint-disable @typescript-eslint/prefer-ts-expect-error, @typescript-eslint/method-signature-style */\nimport { Buffer } from 'node:buffer';\nimport { EventEmitter } from 'node:events';\nimport { addAudioPlayer, deleteAudioPlayer } from '../DataStore';\nimport { VoiceConnectionStatus, type VoiceConnection } from '../VoiceConnection';\nimport { noop } from '../util/util';\nimport { AudioPlayerError } from './AudioPlayerError';\nimport type { AudioResource } from './AudioResource';\nimport { PlayerSubscription } from './PlayerSubscription';\n\n// The Opus \"silent\" frame\nexport const SILENCE_FRAME = Buffer.from([0xf8, 0xff, 0xfe]);\n\n/**\n * Describes the behavior of the player when an audio packet is played but there are no available\n * voice connections to play to.\n */\nexport enum NoSubscriberBehavior {\n\t/**\n\t * Pauses playing the stream until a voice connection becomes available.\n\t */\n\tPause = 'pause',\n\n\t/**\n\t * Continues to play through the resource regardless.\n\t */\n\tPlay = 'play',\n\n\t/**\n\t * The player stops and enters the Idle state.\n\t */\n\tStop = 'stop',\n}\n\nexport enum AudioPlayerStatus {\n\t/**\n\t * When the player has paused itself. Only possible with the \"pause\" no subscriber behavior.\n\t */\n\tAutoPaused = 'autopaused',\n\n\t/**\n\t * When the player is waiting for an audio resource to become readable before transitioning to Playing.\n\t */\n\tBuffering = 'buffering',\n\n\t/**\n\t * When there is currently no resource for the player to be playing.\n\t */\n\tIdle = 'idle',\n\n\t/**\n\t * When the player has been manually paused.\n\t */\n\tPaused = 'paused',\n\n\t/**\n\t * When the player is actively playing an audio resource.\n\t */\n\tPlaying = 'playing',\n}\n\n/**\n * Options that can be passed when creating an audio player, used to specify its behavior.\n */\nexport interface CreateAudioPlayerOptions {\n\tbehaviors?: {\n\t\tmaxMissedFrames?: number;\n\t\tnoSubscriber?: NoSubscriberBehavior;\n\t};\n\tdebug?: boolean;\n}\n\n/**\n * The state that an AudioPlayer is in when it has no resource to play. This is the starting state.\n */\nexport interface AudioPlayerIdleState {\n\tstatus: AudioPlayerStatus.Idle;\n}\n\n/**\n * The state that an AudioPlayer is in when it is waiting for a resource to become readable. Once this\n * happens, the AudioPlayer will enter the Playing state. If the resource ends/errors before this, then\n * it will re-enter the Idle state.\n */\nexport interface AudioPlayerBufferingState {\n\tonFailureCallback: () => void;\n\tonReadableCallback: () => void;\n\tonStreamError: (error: Error) => void;\n\t/**\n\t * The resource that the AudioPlayer is waiting for\n\t */\n\tresource: AudioResource;\n\tstatus: AudioPlayerStatus.Buffering;\n}\n\n/**\n * The state that an AudioPlayer is in when it is actively playing an AudioResource. When playback ends,\n * it will enter the Idle state.\n */\nexport interface AudioPlayerPlayingState {\n\t/**\n\t * The number of consecutive times that the audio resource has been unable to provide an Opus frame.\n\t */\n\tmissedFrames: number;\n\tonStreamError: (error: Error) => void;\n\n\t/**\n\t * The playback duration in milliseconds of the current audio resource. This includes filler silence packets\n\t * that have been played when the resource was buffering.\n\t */\n\tplaybackDuration: number;\n\n\t/**\n\t * The resource that is being played.\n\t */\n\tresource: AudioResource;\n\n\tstatus: AudioPlayerStatus.Playing;\n}\n\n/**\n * The state that an AudioPlayer is in when it has either been explicitly paused by the user, or done\n * automatically by the AudioPlayer itself if there are no available subscribers.\n */\nexport interface AudioPlayerPausedState {\n\tonStreamError: (error: Error) => void;\n\t/**\n\t * The playback duration in milliseconds of the current audio resource. This includes filler silence packets\n\t * that have been played when the resource was buffering.\n\t */\n\tplaybackDuration: number;\n\n\t/**\n\t * The current resource of the audio player.\n\t */\n\tresource: AudioResource;\n\n\t/**\n\t * How many silence packets still need to be played to avoid audio interpolation due to the stream suddenly pausing.\n\t */\n\tsilencePacketsRemaining: number;\n\n\tstatus: AudioPlayerStatus.AutoPaused | AudioPlayerStatus.Paused;\n}\n\n/**\n * The various states that the player can be in.\n */\nexport type AudioPlayerState =\n\t| AudioPlayerBufferingState\n\t| AudioPlayerIdleState\n\t| AudioPlayerPausedState\n\t| AudioPlayerPlayingState;\n\nexport interface AudioPlayer extends EventEmitter {\n\t/**\n\t * Emitted when there is an error emitted from the audio resource played by the audio player\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'error', listener: (error: AudioPlayerError) => void): this;\n\t/**\n\t * Emitted debugging information about the audio player\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'debug', listener: (message: string) => void): this;\n\t/**\n\t * Emitted when the state of the audio player changes\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'stateChange', listener: (oldState: AudioPlayerState, newState: AudioPlayerState) => void): this;\n\t/**\n\t * Emitted when the audio player is subscribed to a voice connection\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'subscribe' | 'unsubscribe', listener: (subscription: PlayerSubscription) => void): this;\n\t/**\n\t * Emitted when the status of state changes to a specific status\n\t *\n\t * @eventProperty\n\t */\n\ton(\n\t\tevent: Event,\n\t\tlistener: (oldState: AudioPlayerState, newState: AudioPlayerState & { status: Event }) => void,\n\t): this;\n}\n\n/**\n * Stringifies an AudioPlayerState instance.\n *\n * @param state - The state to stringify\n */\nfunction stringifyState(state: AudioPlayerState) {\n\treturn JSON.stringify({\n\t\t...state,\n\t\tresource: Reflect.has(state, 'resource'),\n\t\tstepTimeout: Reflect.has(state, 'stepTimeout'),\n\t});\n}\n\n/**\n * Used to play audio resources (i.e. tracks, streams) to voice connections.\n *\n * @remarks\n * Audio players are designed to be re-used - even if a resource has finished playing, the player itself\n * can still be used.\n *\n * The AudioPlayer drives the timing of playback, and therefore is unaffected by voice connections\n * becoming unavailable. Its behavior in these scenarios can be configured.\n */\nexport class AudioPlayer extends EventEmitter {\n\t/**\n\t * The state that the AudioPlayer is in.\n\t */\n\tprivate _state: AudioPlayerState;\n\n\t/**\n\t * A list of VoiceConnections that are registered to this AudioPlayer. The player will attempt to play audio\n\t * to the streams in this list.\n\t */\n\tprivate readonly subscribers: PlayerSubscription[] = [];\n\n\t/**\n\t * The behavior that the player should follow when it enters certain situations.\n\t */\n\tprivate readonly behaviors: {\n\t\tmaxMissedFrames: number;\n\t\tnoSubscriber: NoSubscriberBehavior;\n\t};\n\n\t/**\n\t * The debug logger function, if debugging is enabled.\n\t */\n\tprivate readonly debug: ((message: string) => void) | null;\n\n\t/**\n\t * Creates a new AudioPlayer.\n\t */\n\tpublic constructor(options: CreateAudioPlayerOptions = {}) {\n\t\tsuper();\n\t\tthis._state = { status: AudioPlayerStatus.Idle };\n\t\tthis.behaviors = {\n\t\t\tnoSubscriber: NoSubscriberBehavior.Pause,\n\t\t\tmaxMissedFrames: 5,\n\t\t\t...options.behaviors,\n\t\t};\n\t\tthis.debug = options.debug === false ? null : (message: string) => this.emit('debug', message);\n\t}\n\n\t/**\n\t * A list of subscribed voice connections that can currently receive audio to play.\n\t */\n\tpublic get playable() {\n\t\treturn this.subscribers\n\t\t\t.filter(({ connection }) => connection.state.status === VoiceConnectionStatus.Ready)\n\t\t\t.map(({ connection }) => connection);\n\t}\n\n\t/**\n\t * Subscribes a VoiceConnection to the audio player's play list. If the VoiceConnection is already subscribed,\n\t * then the existing subscription is used.\n\t *\n\t * @remarks\n\t * This method should not be directly called. Instead, use VoiceConnection#subscribe.\n\t * @param connection - The connection to subscribe\n\t * @returns The new subscription if the voice connection is not yet subscribed, otherwise the existing subscription\n\t */\n\t// @ts-ignore\n\tprivate subscribe(connection: VoiceConnection) {\n\t\tconst existingSubscription = this.subscribers.find((subscription) => subscription.connection === connection);\n\t\tif (!existingSubscription) {\n\t\t\tconst subscription = new PlayerSubscription(connection, this);\n\t\t\tthis.subscribers.push(subscription);\n\t\t\tsetImmediate(() => this.emit('subscribe', subscription));\n\t\t\treturn subscription;\n\t\t}\n\n\t\treturn existingSubscription;\n\t}\n\n\t/**\n\t * Unsubscribes a subscription - i.e. removes a voice connection from the play list of the audio player.\n\t *\n\t * @remarks\n\t * This method should not be directly called. Instead, use PlayerSubscription#unsubscribe.\n\t * @param subscription - The subscription to remove\n\t * @returns Whether or not the subscription existed on the player and was removed\n\t */\n\t// @ts-ignore\n\tprivate unsubscribe(subscription: PlayerSubscription) {\n\t\tconst index = this.subscribers.indexOf(subscription);\n\t\tconst exists = index !== -1;\n\t\tif (exists) {\n\t\t\tthis.subscribers.splice(index, 1);\n\t\t\tsubscription.connection.setSpeaking(false);\n\t\t\tthis.emit('unsubscribe', subscription);\n\t\t}\n\n\t\treturn exists;\n\t}\n\n\t/**\n\t * The state that the player is in.\n\t */\n\tpublic get state() {\n\t\treturn this._state;\n\t}\n\n\t/**\n\t * Sets a new state for the player, performing clean-up operations where necessary.\n\t */\n\tpublic set state(newState: AudioPlayerState) {\n\t\tconst oldState = this._state;\n\t\tconst newResource = Reflect.get(newState, 'resource') as AudioResource | undefined;\n\n\t\tif (oldState.status !== AudioPlayerStatus.Idle && oldState.resource !== newResource) {\n\t\t\toldState.resource.playStream.on('error', noop);\n\t\t\toldState.resource.playStream.off('error', oldState.onStreamError);\n\t\t\toldState.resource.audioPlayer = undefined;\n\t\t\toldState.resource.playStream.destroy();\n\t\t\toldState.resource.playStream.read(); // required to ensure buffered data is drained, prevents memory leak\n\t\t}\n\n\t\t// When leaving the Buffering state (or buffering a new resource), then remove the event listeners from it\n\t\tif (\n\t\t\toldState.status === AudioPlayerStatus.Buffering &&\n\t\t\t(newState.status !== AudioPlayerStatus.Buffering || newState.resource !== oldState.resource)\n\t\t) {\n\t\t\toldState.resource.playStream.off('end', oldState.onFailureCallback);\n\t\t\toldState.resource.playStream.off('close', oldState.onFailureCallback);\n\t\t\toldState.resource.playStream.off('finish', oldState.onFailureCallback);\n\t\t\toldState.resource.playStream.off('readable', oldState.onReadableCallback);\n\t\t}\n\n\t\t// transitioning into an idle should ensure that connections stop speaking\n\t\tif (newState.status === AudioPlayerStatus.Idle) {\n\t\t\tthis._signalStopSpeaking();\n\t\t\tdeleteAudioPlayer(this);\n\t\t}\n\n\t\t// attach to the global audio player timer\n\t\tif (newResource) {\n\t\t\taddAudioPlayer(this);\n\t\t}\n\n\t\t// playing -> playing state changes should still transition if a resource changed (seems like it would be useful!)\n\t\tconst didChangeResources =\n\t\t\toldState.status !== AudioPlayerStatus.Idle &&\n\t\t\tnewState.status === AudioPlayerStatus.Playing &&\n\t\t\toldState.resource !== newState.resource;\n\n\t\tthis._state = newState;\n\n\t\tthis.emit('stateChange', oldState, this._state);\n\t\tif (oldState.status !== newState.status || didChangeResources) {\n\t\t\tthis.emit(newState.status, oldState, this._state as any);\n\t\t}\n\n\t\tthis.debug?.(`state change:\\nfrom ${stringifyState(oldState)}\\nto ${stringifyState(newState)}`);\n\t}\n\n\t/**\n\t * Plays a new resource on the player. If the player is already playing a resource, the existing resource is destroyed\n\t * (it cannot be reused, even in another player) and is replaced with the new resource.\n\t *\n\t * @remarks\n\t * The player will transition to the Playing state once playback begins, and will return to the Idle state once\n\t * playback is ended.\n\t *\n\t * If the player was previously playing a resource and this method is called, the player will not transition to the\n\t * Idle state during the swap over.\n\t * @param resource - The resource to play\n\t * @throws Will throw if attempting to play an audio resource that has already ended, or is being played by another player\n\t */\n\tpublic play(resource: AudioResource) {\n\t\tif (resource.ended) {\n\t\t\tthrow new Error('Cannot play a resource that has already ended.');\n\t\t}\n\n\t\tif (resource.audioPlayer) {\n\t\t\tif (resource.audioPlayer === this) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthrow new Error('Resource is already being played by another audio player.');\n\t\t}\n\n\t\tresource.audioPlayer = this;\n\n\t\t// Attach error listeners to the stream that will propagate the error and then return to the Idle\n\t\t// state if the resource is still being used.\n\t\tconst onStreamError = (error: Error) => {\n\t\t\tif (this.state.status !== AudioPlayerStatus.Idle) {\n\t\t\t\tthis.emit('error', new AudioPlayerError(error, this.state.resource));\n\t\t\t}\n\n\t\t\tif (this.state.status !== AudioPlayerStatus.Idle && this.state.resource === resource) {\n\t\t\t\tthis.state = {\n\t\t\t\t\tstatus: AudioPlayerStatus.Idle,\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\n\t\tresource.playStream.once('error', onStreamError);\n\n\t\tif (resource.started) {\n\t\t\tthis.state = {\n\t\t\t\tstatus: AudioPlayerStatus.Playing,\n\t\t\t\tmissedFrames: 0,\n\t\t\t\tplaybackDuration: 0,\n\t\t\t\tresource,\n\t\t\t\tonStreamError,\n\t\t\t};\n\t\t} else {\n\t\t\tconst onReadableCallback = () => {\n\t\t\t\tif (this.state.status === AudioPlayerStatus.Buffering && this.state.resource === resource) {\n\t\t\t\t\tthis.state = {\n\t\t\t\t\t\tstatus: AudioPlayerStatus.Playing,\n\t\t\t\t\t\tmissedFrames: 0,\n\t\t\t\t\t\tplaybackDuration: 0,\n\t\t\t\t\t\tresource,\n\t\t\t\t\t\tonStreamError,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst onFailureCallback = () => {\n\t\t\t\tif (this.state.status === AudioPlayerStatus.Buffering && this.state.resource === resource) {\n\t\t\t\t\tthis.state = {\n\t\t\t\t\t\tstatus: AudioPlayerStatus.Idle,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tresource.playStream.once('readable', onReadableCallback);\n\n\t\t\tresource.playStream.once('end', onFailureCallback);\n\t\t\tresource.playStream.once('close', onFailureCallback);\n\t\t\tresource.playStream.once('finish', onFailureCallback);\n\n\t\t\tthis.state = {\n\t\t\t\tstatus: AudioPlayerStatus.Buffering,\n\t\t\t\tresource,\n\t\t\t\tonReadableCallback,\n\t\t\t\tonFailureCallback,\n\t\t\t\tonStreamError,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Pauses playback of the current resource, if any.\n\t *\n\t * @param interpolateSilence - If true, the player will play 5 packets of silence after pausing to prevent audio glitches\n\t * @returns `true` if the player was successfully paused, otherwise `false`\n\t */\n\tpublic pause(interpolateSilence = true) {\n\t\tif (this.state.status !== AudioPlayerStatus.Playing) return false;\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\tstatus: AudioPlayerStatus.Paused,\n\t\t\tsilencePacketsRemaining: interpolateSilence ? 5 : 0,\n\t\t};\n\t\treturn true;\n\t}\n\n\t/**\n\t * Unpauses playback of the current resource, if any.\n\t *\n\t * @returns `true` if the player was successfully unpaused, otherwise `false`\n\t */\n\tpublic unpause() {\n\t\tif (this.state.status !== AudioPlayerStatus.Paused) return false;\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\tstatus: AudioPlayerStatus.Playing,\n\t\t\tmissedFrames: 0,\n\t\t};\n\t\treturn true;\n\t}\n\n\t/**\n\t * Stops playback of the current resource and destroys the resource. The player will either transition to the Idle state,\n\t * or remain in its current state until the silence padding frames of the resource have been played.\n\t *\n\t * @param force - If true, will force the player to enter the Idle state even if the resource has silence padding frames\n\t * @returns `true` if the player will come to a stop, otherwise `false`\n\t */\n\tpublic stop(force = false) {\n\t\tif (this.state.status === AudioPlayerStatus.Idle) return false;\n\t\tif (force || this.state.resource.silencePaddingFrames === 0) {\n\t\t\tthis.state = {\n\t\t\t\tstatus: AudioPlayerStatus.Idle,\n\t\t\t};\n\t\t} else if (this.state.resource.silenceRemaining === -1) {\n\t\t\tthis.state.resource.silenceRemaining = this.state.resource.silencePaddingFrames;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks whether the underlying resource (if any) is playable (readable)\n\t *\n\t * @returns `true` if the resource is playable, otherwise `false`\n\t */\n\tpublic checkPlayable() {\n\t\tconst state = this._state;\n\t\tif (state.status === AudioPlayerStatus.Idle || state.status === AudioPlayerStatus.Buffering) return false;\n\n\t\t// If the stream has been destroyed or is no longer readable, then transition to the Idle state.\n\t\tif (!state.resource.readable) {\n\t\t\tthis.state = {\n\t\t\t\tstatus: AudioPlayerStatus.Idle,\n\t\t\t};\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Called roughly every 20ms by the global audio player timer. Dispatches any audio packets that are buffered\n\t * by the active connections of this audio player.\n\t */\n\t// @ts-ignore\n\tprivate _stepDispatch() {\n\t\tconst state = this._state;\n\n\t\t// Guard against the Idle state\n\t\tif (state.status === AudioPlayerStatus.Idle || state.status === AudioPlayerStatus.Buffering) return;\n\n\t\t// Dispatch any audio packets that were prepared in the previous cycle\n\t\tfor (const connection of this.playable) {\n\t\t\tconnection.dispatchAudio();\n\t\t}\n\t}\n\n\t/**\n\t * Called roughly every 20ms by the global audio player timer. Attempts to read an audio packet from the\n\t * underlying resource of the stream, and then has all the active connections of the audio player prepare it\n\t * (encrypt it, append header data) so that it is ready to play at the start of the next cycle.\n\t */\n\t// @ts-ignore\n\tprivate _stepPrepare() {\n\t\tconst state = this._state;\n\n\t\t// Guard against the Idle state\n\t\tif (state.status === AudioPlayerStatus.Idle || state.status === AudioPlayerStatus.Buffering) return;\n\n\t\t// List of connections that can receive the packet\n\t\tconst playable = this.playable;\n\n\t\t/* If the player was previously in the AutoPaused state, check to see whether there are newly available\n\t\t connections, allowing us to transition out of the AutoPaused state back into the Playing state */\n\t\tif (state.status === AudioPlayerStatus.AutoPaused && playable.length > 0) {\n\t\t\tthis.state = {\n\t\t\t\t...state,\n\t\t\t\tstatus: AudioPlayerStatus.Playing,\n\t\t\t\tmissedFrames: 0,\n\t\t\t};\n\t\t}\n\n\t\t/* If the player is (auto)paused, check to see whether silence packets should be played and\n\t\t set a timeout to begin the next cycle, ending the current cycle here. */\n\t\tif (state.status === AudioPlayerStatus.Paused || state.status === AudioPlayerStatus.AutoPaused) {\n\t\t\tif (state.silencePacketsRemaining > 0) {\n\t\t\t\tstate.silencePacketsRemaining--;\n\t\t\t\tthis._preparePacket(SILENCE_FRAME, playable, state);\n\t\t\t\tif (state.silencePacketsRemaining === 0) {\n\t\t\t\t\tthis._signalStopSpeaking();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are no available connections in this cycle, observe the configured \"no subscriber\" behavior.\n\t\tif (playable.length === 0) {\n\t\t\tif (this.behaviors.noSubscriber === NoSubscriberBehavior.Pause) {\n\t\t\t\tthis.state = {\n\t\t\t\t\t...state,\n\t\t\t\t\tstatus: AudioPlayerStatus.AutoPaused,\n\t\t\t\t\tsilencePacketsRemaining: 5,\n\t\t\t\t};\n\t\t\t\treturn;\n\t\t\t} else if (this.behaviors.noSubscriber === NoSubscriberBehavior.Stop) {\n\t\t\t\tthis.stop(true);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Attempt to read an Opus packet from the resource. If there isn't an available packet,\n\t\t * play a silence packet. If there are 5 consecutive cycles with failed reads, then the\n\t\t * playback will end.\n\t\t */\n\t\tconst packet: Buffer | null = state.resource.read();\n\n\t\tif (state.status === AudioPlayerStatus.Playing) {\n\t\t\tif (packet) {\n\t\t\t\tthis._preparePacket(packet, playable, state);\n\t\t\t\tstate.missedFrames = 0;\n\t\t\t} else {\n\t\t\t\tthis._preparePacket(SILENCE_FRAME, playable, state);\n\t\t\t\tstate.missedFrames++;\n\t\t\t\tif (state.missedFrames >= this.behaviors.maxMissedFrames) {\n\t\t\t\t\tthis.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Signals to all the subscribed connections that they should send a packet to Discord indicating\n\t * they are no longer speaking. Called once playback of a resource ends.\n\t */\n\tprivate _signalStopSpeaking() {\n\t\tfor (const { connection } of this.subscribers) {\n\t\t\tconnection.setSpeaking(false);\n\t\t}\n\t}\n\n\t/**\n\t * Instructs the given connections to each prepare this packet to be played at the start of the\n\t * next cycle.\n\t *\n\t * @param packet - The Opus packet to be prepared by each receiver\n\t * @param receivers - The connections that should play this packet\n\t */\n\tprivate _preparePacket(\n\t\tpacket: Buffer,\n\t\treceivers: VoiceConnection[],\n\t\tstate: AudioPlayerPausedState | AudioPlayerPlayingState,\n\t) {\n\t\tstate.playbackDuration += 20;\n\t\tfor (const connection of receivers) {\n\t\t\tconnection.prepareAudioPacket(packet);\n\t\t}\n\t}\n}\n\n/**\n * Creates a new AudioPlayer to be used.\n */\nexport function createAudioPlayer(options?: CreateAudioPlayerOptions) {\n\treturn new AudioPlayer(options);\n}\n","import type { AudioResource } from './AudioResource';\n\n/**\n * An error emitted by an AudioPlayer. Contains an attached resource to aid with\n * debugging and identifying where the error came from.\n */\nexport class AudioPlayerError extends Error {\n\t/**\n\t * The resource associated with the audio player at the time the error was thrown.\n\t */\n\tpublic readonly resource: AudioResource;\n\n\tpublic constructor(error: Error, resource: AudioResource) {\n\t\tsuper(error.message);\n\t\tthis.resource = resource;\n\t\tthis.name = error.name;\n\t\tthis.stack = error.stack!;\n\t}\n}\n","/* eslint-disable @typescript-eslint/dot-notation */\nimport type { VoiceConnection } from '../VoiceConnection';\nimport type { AudioPlayer } from './AudioPlayer';\n\n/**\n * Represents a subscription of a voice connection to an audio player, allowing\n * the audio player to play audio on the voice connection.\n */\nexport class PlayerSubscription {\n\t/**\n\t * The voice connection of this subscription.\n\t */\n\tpublic readonly connection: VoiceConnection;\n\n\t/**\n\t * The audio player of this subscription.\n\t */\n\tpublic readonly player: AudioPlayer;\n\n\tpublic constructor(connection: VoiceConnection, player: AudioPlayer) {\n\t\tthis.connection = connection;\n\t\tthis.player = player;\n\t}\n\n\t/**\n\t * Unsubscribes the connection from the audio player, meaning that the\n\t * audio player cannot stream audio to it until a new subscription is made.\n\t */\n\tpublic unsubscribe() {\n\t\tthis.connection['onSubscriptionRemoved'](this);\n\t\tthis.player['unsubscribe'](this);\n\t}\n}\n","import { EventEmitter } from 'node:events';\n\n/**\n * The known data for a user in a Discord voice connection.\n */\nexport interface VoiceUserData {\n\t/**\n\t * The SSRC of the user's audio stream.\n\t */\n\taudioSSRC: number;\n\n\t/**\n\t * The Discord user id of the user.\n\t */\n\tuserId: string;\n\n\t/**\n\t * The SSRC of the user's video stream (if one exists)\n\t * Cannot be 0. If undefined, the user has no video stream.\n\t */\n\tvideoSSRC?: number;\n}\n\nexport interface SSRCMap extends EventEmitter {\n\ton(event: 'create', listener: (newData: VoiceUserData) => void): this;\n\ton(event: 'update', listener: (oldData: VoiceUserData | undefined, newData: VoiceUserData) => void): this;\n\ton(event: 'delete', listener: (deletedData: VoiceUserData) => void): this;\n}\n\n/**\n * Maps audio SSRCs to data of users in voice connections.\n */\nexport class SSRCMap extends EventEmitter {\n\t/**\n\t * The underlying map.\n\t */\n\tprivate readonly map: Map;\n\n\tpublic constructor() {\n\t\tsuper();\n\t\tthis.map = new Map();\n\t}\n\n\t/**\n\t * Updates the map with new user data\n\t *\n\t * @param data - The data to update with\n\t */\n\tpublic update(data: VoiceUserData) {\n\t\tconst existing = this.map.get(data.audioSSRC);\n\n\t\tconst newValue = {\n\t\t\t...this.map.get(data.audioSSRC),\n\t\t\t...data,\n\t\t};\n\n\t\tthis.map.set(data.audioSSRC, newValue);\n\t\tif (!existing) this.emit('create', newValue);\n\t\tthis.emit('update', existing, newValue);\n\t}\n\n\t/**\n\t * Gets the stored voice data of a user.\n\t *\n\t * @param target - The target, either their user id or audio SSRC\n\t */\n\tpublic get(target: number | string) {\n\t\tif (typeof target === 'number') {\n\t\t\treturn this.map.get(target);\n\t\t}\n\n\t\tfor (const data of this.map.values()) {\n\t\t\tif (data.userId === target) {\n\t\t\t\treturn data;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Deletes the stored voice data about a user.\n\t *\n\t * @param target - The target of the delete operation, either their audio SSRC or user id\n\t * @returns The data that was deleted, if any\n\t */\n\tpublic delete(target: number | string) {\n\t\tif (typeof target === 'number') {\n\t\t\tconst existing = this.map.get(target);\n\t\t\tif (existing) {\n\t\t\t\tthis.map.delete(target);\n\t\t\t\tthis.emit('delete', existing);\n\t\t\t}\n\n\t\t\treturn existing;\n\t\t}\n\n\t\tfor (const [audioSSRC, data] of this.map.entries()) {\n\t\t\tif (data.userId === target) {\n\t\t\t\tthis.map.delete(audioSSRC);\n\t\t\t\tthis.emit('delete', data);\n\t\t\t\treturn data;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n","/* eslint-disable @typescript-eslint/unified-signatures */\nimport { EventEmitter } from 'node:events';\n\nexport interface SpeakingMap extends EventEmitter {\n\t/**\n\t * Emitted when a user starts speaking.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'start', listener: (userId: string) => void): this;\n\n\t/**\n\t * Emitted when a user ends speaking.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'end', listener: (userId: string) => void): this;\n}\n\n/**\n * Tracks the speaking states of users in a voice channel.\n */\nexport class SpeakingMap extends EventEmitter {\n\t/**\n\t * The delay after a packet is received from a user until they're marked as not speaking anymore.\n\t */\n\tpublic static readonly DELAY = 100;\n\n\t/**\n\t * The currently speaking users, mapped to the milliseconds since UNIX epoch at which they started speaking.\n\t */\n\tpublic readonly users: Map;\n\n\tprivate readonly speakingTimeouts: Map;\n\n\tpublic constructor() {\n\t\tsuper();\n\t\tthis.users = new Map();\n\t\tthis.speakingTimeouts = new Map();\n\t}\n\n\tpublic onPacket(userId: string) {\n\t\tconst timeout = this.speakingTimeouts.get(userId);\n\t\tif (timeout) {\n\t\t\tclearTimeout(timeout);\n\t\t} else {\n\t\t\tthis.users.set(userId, Date.now());\n\t\t\tthis.emit('start', userId);\n\t\t}\n\n\t\tthis.startTimeout(userId);\n\t}\n\n\tprivate startTimeout(userId: string) {\n\t\tthis.speakingTimeouts.set(\n\t\t\tuserId,\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.emit('end', userId);\n\t\t\t\tthis.speakingTimeouts.delete(userId);\n\t\t\t\tthis.users.delete(userId);\n\t\t\t}, SpeakingMap.DELAY),\n\t\t);\n\t}\n}\n","import type { JoinConfig } from './DataStore';\nimport { createVoiceConnection } from './VoiceConnection';\nimport type { DiscordGatewayAdapterCreator } from './util/adapter';\n\n/**\n * The options that can be given when creating a voice connection.\n */\nexport interface CreateVoiceConnectionOptions {\n\tadapterCreator: DiscordGatewayAdapterCreator;\n\n\t/**\n\t * If true, debug messages will be enabled for the voice connection and its\n\t * related components. Defaults to false.\n\t */\n\tdebug?: boolean | undefined;\n}\n\n/**\n * The options that can be given when joining a voice channel.\n */\nexport interface JoinVoiceChannelOptions {\n\t/**\n\t * The id of the Discord voice channel to join.\n\t */\n\tchannelId: string;\n\n\t/**\n\t * An optional group identifier for the voice connection.\n\t */\n\tgroup?: string;\n\n\t/**\n\t * The id of the guild that the voice channel belongs to.\n\t */\n\tguildId: string;\n\n\t/**\n\t * Whether to join the channel deafened (defaults to true)\n\t */\n\tselfDeaf?: boolean;\n\n\t/**\n\t * Whether to join the channel muted (defaults to true)\n\t */\n\tselfMute?: boolean;\n}\n\n/**\n * Creates a VoiceConnection to a Discord voice channel.\n *\n * @param options - the options for joining the voice channel\n */\nexport function joinVoiceChannel(options: CreateVoiceConnectionOptions & JoinVoiceChannelOptions) {\n\tconst joinConfig: JoinConfig = {\n\t\tselfDeaf: true,\n\t\tselfMute: false,\n\t\tgroup: 'default',\n\t\t...options,\n\t};\n\n\treturn createVoiceConnection(joinConfig, {\n\t\tadapterCreator: options.adapterCreator,\n\t\tdebug: options.debug,\n\t});\n}\n","import type { Buffer } from 'node:buffer';\nimport { pipeline, type Readable } from 'node:stream';\nimport prism from 'prism-media';\nimport { noop } from '../util/util';\nimport { SILENCE_FRAME, type AudioPlayer } from './AudioPlayer';\nimport { findPipeline, StreamType, TransformerType, type Edge } from './TransformerGraph';\n\n/**\n * Options that are set when creating a new audio resource.\n *\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport interface CreateAudioResourceOptions {\n\t/**\n\t * Whether or not inline volume should be enabled. If enabled, you will be able to change the volume\n\t * of the stream on-the-fly. However, this also increases the performance cost of playback. Defaults to `false`.\n\t */\n\tinlineVolume?: boolean;\n\n\t/**\n\t * The type of the input stream. Defaults to `StreamType.Arbitrary`.\n\t */\n\tinputType?: StreamType;\n\n\t/**\n\t * Optional metadata that can be attached to the resource (e.g. track title, random id).\n\t * This is useful for identification purposes when the resource is passed around in events.\n\t * See {@link AudioResource.metadata}\n\t */\n\tmetadata?: Metadata;\n\n\t/**\n\t * The number of silence frames to append to the end of the resource's audio stream, to prevent interpolation glitches.\n\t * Defaults to 5.\n\t */\n\tsilencePaddingFrames?: number;\n}\n\n/**\n * Represents an audio resource that can be played by an audio player.\n *\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport class AudioResource {\n\t/**\n\t * An object-mode Readable stream that emits Opus packets. This is what is played by audio players.\n\t */\n\tpublic readonly playStream: Readable;\n\n\t/**\n\t * The pipeline used to convert the input stream into a playable format. For example, this may\n\t * contain an FFmpeg component for arbitrary inputs, and it may contain a VolumeTransformer component\n\t * for resources with inline volume transformation enabled.\n\t */\n\tpublic readonly edges: readonly Edge[];\n\n\t/**\n\t * Optional metadata that can be used to identify the resource.\n\t */\n\tpublic metadata: Metadata;\n\n\t/**\n\t * If the resource was created with inline volume transformation enabled, then this will be a\n\t * prism-media VolumeTransformer. You can use this to alter the volume of the stream.\n\t */\n\tpublic readonly volume?: prism.VolumeTransformer;\n\n\t/**\n\t * If using an Opus encoder to create this audio resource, then this will be a prism-media opus.Encoder.\n\t * You can use this to control settings such as bitrate, FEC, PLP.\n\t */\n\tpublic readonly encoder?: prism.opus.Encoder;\n\n\t/**\n\t * The audio player that the resource is subscribed to, if any.\n\t */\n\tpublic audioPlayer?: AudioPlayer | undefined;\n\n\t/**\n\t * The playback duration of this audio resource, given in milliseconds.\n\t */\n\tpublic playbackDuration = 0;\n\n\t/**\n\t * Whether or not the stream for this resource has started (data has become readable)\n\t */\n\tpublic started = false;\n\n\t/**\n\t * The number of silence frames to append to the end of the resource's audio stream, to prevent interpolation glitches.\n\t */\n\tpublic readonly silencePaddingFrames: number;\n\n\t/**\n\t * The number of remaining silence frames to play. If -1, the frames have not yet started playing.\n\t */\n\tpublic silenceRemaining = -1;\n\n\tpublic constructor(\n\t\tedges: readonly Edge[],\n\t\tstreams: readonly Readable[],\n\t\tmetadata: Metadata,\n\t\tsilencePaddingFrames: number,\n\t) {\n\t\tthis.edges = edges;\n\t\tthis.playStream = streams.length > 1 ? (pipeline(streams, noop) as any as Readable) : streams[0]!;\n\t\tthis.metadata = metadata;\n\t\tthis.silencePaddingFrames = silencePaddingFrames;\n\n\t\tfor (const stream of streams) {\n\t\t\tif (stream instanceof prism.VolumeTransformer) {\n\t\t\t\tthis.volume = stream;\n\t\t\t} else if (stream instanceof prism.opus.Encoder) {\n\t\t\t\tthis.encoder = stream;\n\t\t\t}\n\t\t}\n\n\t\tthis.playStream.once('readable', () => (this.started = true));\n\t}\n\n\t/**\n\t * Whether this resource is readable. If the underlying resource is no longer readable, this will still return true\n\t * while there are silence padding frames left to play.\n\t */\n\tpublic get readable() {\n\t\tif (this.silenceRemaining === 0) return false;\n\t\tconst real = this.playStream.readable;\n\t\tif (!real) {\n\t\t\tif (this.silenceRemaining === -1) this.silenceRemaining = this.silencePaddingFrames;\n\t\t\treturn this.silenceRemaining !== 0;\n\t\t}\n\n\t\treturn real;\n\t}\n\n\t/**\n\t * Whether this resource has ended or not.\n\t */\n\tpublic get ended() {\n\t\treturn this.playStream.readableEnded || this.playStream.destroyed || this.silenceRemaining === 0;\n\t}\n\n\t/**\n\t * Attempts to read an Opus packet from the audio resource. If a packet is available, the playbackDuration\n\t * is incremented.\n\t *\n\t * @remarks\n\t * It is advisable to check that the playStream is readable before calling this method. While no runtime\n\t * errors will be thrown, you should check that the resource is still available before attempting to\n\t * read from it.\n\t * @internal\n\t */\n\tpublic read(): Buffer | null {\n\t\tif (this.silenceRemaining === 0) {\n\t\t\treturn null;\n\t\t} else if (this.silenceRemaining > 0) {\n\t\t\tthis.silenceRemaining--;\n\t\t\treturn SILENCE_FRAME;\n\t\t}\n\n\t\tconst packet = this.playStream.read() as Buffer | null;\n\t\tif (packet) {\n\t\t\tthis.playbackDuration += 20;\n\t\t}\n\n\t\treturn packet;\n\t}\n}\n\n/**\n * Ensures that a path contains at least one volume transforming component.\n *\n * @param path - The path to validate constraints on\n */\nexport const VOLUME_CONSTRAINT = (path: Edge[]) => path.some((edge) => edge.type === TransformerType.InlineVolume);\n\nexport const NO_CONSTRAINT = () => true;\n\n/**\n * Tries to infer the type of a stream to aid with transcoder pipelining.\n *\n * @param stream - The stream to infer the type of\n */\nexport function inferStreamType(stream: Readable): {\n\thasVolume: boolean;\n\tstreamType: StreamType;\n} {\n\tif (stream instanceof prism.opus.Encoder) {\n\t\treturn { streamType: StreamType.Opus, hasVolume: false };\n\t} else if (stream instanceof prism.opus.Decoder) {\n\t\treturn { streamType: StreamType.Raw, hasVolume: false };\n\t} else if (stream instanceof prism.VolumeTransformer) {\n\t\treturn { streamType: StreamType.Raw, hasVolume: true };\n\t} else if (stream instanceof prism.opus.OggDemuxer) {\n\t\treturn { streamType: StreamType.Opus, hasVolume: false };\n\t} else if (stream instanceof prism.opus.WebmDemuxer) {\n\t\treturn { streamType: StreamType.Opus, hasVolume: false };\n\t}\n\n\treturn { streamType: StreamType.Arbitrary, hasVolume: false };\n}\n\n/**\n * Creates an audio resource that can be played by audio players.\n *\n * @remarks\n * If the input is given as a string, then the inputType option will be overridden and FFmpeg will be used.\n *\n * If the input is not in the correct format, then a pipeline of transcoders and transformers will be created\n * to ensure that the resultant stream is in the correct format for playback. This could involve using FFmpeg,\n * Opus transcoders, and Ogg/WebM demuxers.\n * @param input - The resource to play\n * @param options - Configurable options for creating the resource\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport function createAudioResource(\n\tinput: Readable | string,\n\toptions: CreateAudioResourceOptions &\n\t\tPick<\n\t\t\tMetadata extends null | undefined\n\t\t\t\t? CreateAudioResourceOptions\n\t\t\t\t: Required>,\n\t\t\t'metadata'\n\t\t>,\n): AudioResource;\n\n/**\n * Creates an audio resource that can be played by audio players.\n *\n * @remarks\n * If the input is given as a string, then the inputType option will be overridden and FFmpeg will be used.\n *\n * If the input is not in the correct format, then a pipeline of transcoders and transformers will be created\n * to ensure that the resultant stream is in the correct format for playback. This could involve using FFmpeg,\n * Opus transcoders, and Ogg/WebM demuxers.\n * @param input - The resource to play\n * @param options - Configurable options for creating the resource\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport function createAudioResource(\n\tinput: Readable | string,\n\toptions?: Omit, 'metadata'>,\n): AudioResource;\n\n/**\n * Creates an audio resource that can be played by audio players.\n *\n * @remarks\n * If the input is given as a string, then the inputType option will be overridden and FFmpeg will be used.\n *\n * If the input is not in the correct format, then a pipeline of transcoders and transformers will be created\n * to ensure that the resultant stream is in the correct format for playback. This could involve using FFmpeg,\n * Opus transcoders, and Ogg/WebM demuxers.\n * @param input - The resource to play\n * @param options - Configurable options for creating the resource\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport function createAudioResource(\n\tinput: Readable | string,\n\toptions: CreateAudioResourceOptions = {},\n): AudioResource {\n\tlet inputType = options.inputType;\n\tlet needsInlineVolume = Boolean(options.inlineVolume);\n\n\t// string inputs can only be used with FFmpeg\n\tif (typeof input === 'string') {\n\t\tinputType = StreamType.Arbitrary;\n\t} else if (inputType === undefined) {\n\t\tconst analysis = inferStreamType(input);\n\t\tinputType = analysis.streamType;\n\t\tneedsInlineVolume = needsInlineVolume && !analysis.hasVolume;\n\t}\n\n\tconst transformerPipeline = findPipeline(inputType, needsInlineVolume ? VOLUME_CONSTRAINT : NO_CONSTRAINT);\n\n\tif (transformerPipeline.length === 0) {\n\t\tif (typeof input === 'string') throw new Error(`Invalid pipeline constructed for string resource '${input}'`);\n\t\t// No adjustments required\n\t\treturn new AudioResource(\n\t\t\t[],\n\t\t\t[input],\n\t\t\t(options.metadata ?? null) as Metadata,\n\t\t\toptions.silencePaddingFrames ?? 5,\n\t\t);\n\t}\n\n\tconst streams = transformerPipeline.map((edge) => edge.transformer(input));\n\tif (typeof input !== 'string') streams.unshift(input);\n\n\treturn new AudioResource(\n\t\ttransformerPipeline,\n\t\tstreams,\n\t\t(options.metadata ?? null) as Metadata,\n\t\toptions.silencePaddingFrames ?? 5,\n\t);\n}\n","import type { Readable } from 'node:stream';\nimport prism from 'prism-media';\n\n/**\n * This module creates a Transformer Graph to figure out what the most efficient way\n * of transforming the input stream into something playable would be.\n */\n\nconst FFMPEG_PCM_ARGUMENTS = ['-analyzeduration', '0', '-loglevel', '0', '-f', 's16le', '-ar', '48000', '-ac', '2'];\nconst FFMPEG_OPUS_ARGUMENTS = [\n\t'-analyzeduration',\n\t'0',\n\t'-loglevel',\n\t'0',\n\t'-acodec',\n\t'libopus',\n\t'-f',\n\t'opus',\n\t'-ar',\n\t'48000',\n\t'-ac',\n\t'2',\n];\n\n/**\n * The different types of stream that can exist within the pipeline.\n */\nexport enum StreamType {\n\t/**\n\t * The type of the stream at this point is unknown.\n\t */\n\tArbitrary = 'arbitrary',\n\t/**\n\t * The stream at this point is Opus audio encoded in an Ogg wrapper.\n\t */\n\tOggOpus = 'ogg/opus',\n\t/**\n\t * The stream at this point is Opus audio, and the stream is in object-mode. This is ready to play.\n\t */\n\tOpus = 'opus',\n\t/**\n\t * The stream at this point is s16le PCM.\n\t */\n\tRaw = 'raw',\n\t/**\n\t * The stream at this point is Opus audio encoded in a WebM wrapper.\n\t */\n\tWebmOpus = 'webm/opus',\n}\n\n/**\n * The different types of transformers that can exist within the pipeline.\n */\nexport enum TransformerType {\n\tFFmpegOgg = 'ffmpeg ogg',\n\tFFmpegPCM = 'ffmpeg pcm',\n\tInlineVolume = 'volume transformer',\n\tOggOpusDemuxer = 'ogg/opus demuxer',\n\tOpusDecoder = 'opus decoder',\n\tOpusEncoder = 'opus encoder',\n\tWebmOpusDemuxer = 'webm/opus demuxer',\n}\n\n/**\n * Represents a pathway from one stream type to another using a transformer.\n */\nexport interface Edge {\n\tcost: number;\n\tfrom: Node;\n\tto: Node;\n\ttransformer(input: Readable | string): Readable;\n\ttype: TransformerType;\n}\n\n/**\n * Represents a type of stream within the graph, e.g. an Opus stream, or a stream of raw audio.\n */\nexport class Node {\n\t/**\n\t * The outbound edges from this node.\n\t */\n\tpublic readonly edges: Edge[] = [];\n\n\t/**\n\t * The type of stream for this node.\n\t */\n\tpublic readonly type: StreamType;\n\n\tpublic constructor(type: StreamType) {\n\t\tthis.type = type;\n\t}\n\n\t/**\n\t * Creates an outbound edge from this node.\n\t *\n\t * @param edge - The edge to create\n\t */\n\tpublic addEdge(edge: Omit) {\n\t\tthis.edges.push({ ...edge, from: this });\n\t}\n}\n\n// Create a node for each stream type\nlet NODES: Map | null = null;\n\n/**\n * Gets a node from its stream type.\n *\n * @param type - The stream type of the target node\n */\nexport function getNode(type: StreamType) {\n\tconst node = (NODES ??= initializeNodes()).get(type);\n\tif (!node) throw new Error(`Node type '${type}' does not exist!`);\n\treturn node;\n}\n\n// Try to enable FFmpeg Ogg optimizations\nfunction canEnableFFmpegOptimizations(): boolean {\n\ttry {\n\t\treturn prism.FFmpeg.getInfo().output.includes('--enable-libopus');\n\t} catch {}\n\n\treturn false;\n}\n\nfunction initializeNodes(): Map {\n\tconst nodes = new Map();\n\tfor (const streamType of Object.values(StreamType)) {\n\t\tnodes.set(streamType, new Node(streamType));\n\t}\n\n\tnodes.get(StreamType.Raw)!.addEdge({\n\t\ttype: TransformerType.OpusEncoder,\n\t\tto: nodes.get(StreamType.Opus)!,\n\t\tcost: 1.5,\n\t\ttransformer: () => new prism.opus.Encoder({ rate: 48_000, channels: 2, frameSize: 960 }),\n\t});\n\n\tnodes.get(StreamType.Opus)!.addEdge({\n\t\ttype: TransformerType.OpusDecoder,\n\t\tto: nodes.get(StreamType.Raw)!,\n\t\tcost: 1.5,\n\t\ttransformer: () => new prism.opus.Decoder({ rate: 48_000, channels: 2, frameSize: 960 }),\n\t});\n\n\tnodes.get(StreamType.OggOpus)!.addEdge({\n\t\ttype: TransformerType.OggOpusDemuxer,\n\t\tto: nodes.get(StreamType.Opus)!,\n\t\tcost: 1,\n\t\ttransformer: () => new prism.opus.OggDemuxer(),\n\t});\n\n\tnodes.get(StreamType.WebmOpus)!.addEdge({\n\t\ttype: TransformerType.WebmOpusDemuxer,\n\t\tto: nodes.get(StreamType.Opus)!,\n\t\tcost: 1,\n\t\ttransformer: () => new prism.opus.WebmDemuxer(),\n\t});\n\n\tconst FFMPEG_PCM_EDGE: Omit = {\n\t\ttype: TransformerType.FFmpegPCM,\n\t\tto: nodes.get(StreamType.Raw)!,\n\t\tcost: 2,\n\t\ttransformer: (input) =>\n\t\t\tnew prism.FFmpeg({\n\t\t\t\targs: ['-i', typeof input === 'string' ? input : '-', ...FFMPEG_PCM_ARGUMENTS],\n\t\t\t}),\n\t};\n\n\tnodes.get(StreamType.Arbitrary)!.addEdge(FFMPEG_PCM_EDGE);\n\tnodes.get(StreamType.OggOpus)!.addEdge(FFMPEG_PCM_EDGE);\n\tnodes.get(StreamType.WebmOpus)!.addEdge(FFMPEG_PCM_EDGE);\n\n\tnodes.get(StreamType.Raw)!.addEdge({\n\t\ttype: TransformerType.InlineVolume,\n\t\tto: nodes.get(StreamType.Raw)!,\n\t\tcost: 0.5,\n\t\ttransformer: () => new prism.VolumeTransformer({ type: 's16le' }),\n\t});\n\n\tif (canEnableFFmpegOptimizations()) {\n\t\tconst FFMPEG_OGG_EDGE: Omit = {\n\t\t\ttype: TransformerType.FFmpegOgg,\n\t\t\tto: nodes.get(StreamType.OggOpus)!,\n\t\t\tcost: 2,\n\t\t\ttransformer: (input) =>\n\t\t\t\tnew prism.FFmpeg({\n\t\t\t\t\targs: ['-i', typeof input === 'string' ? input : '-', ...FFMPEG_OPUS_ARGUMENTS],\n\t\t\t\t}),\n\t\t};\n\t\tnodes.get(StreamType.Arbitrary)!.addEdge(FFMPEG_OGG_EDGE);\n\t\t// Include Ogg and WebM as well in case they have different sampling rates or are mono instead of stereo\n\t\t// at the moment, this will not do anything. However, if/when detection for correct Opus headers is\n\t\t// implemented, this will help inform the voice engine that it is able to transcode the audio.\n\t\tnodes.get(StreamType.OggOpus)!.addEdge(FFMPEG_OGG_EDGE);\n\t\tnodes.get(StreamType.WebmOpus)!.addEdge(FFMPEG_OGG_EDGE);\n\t}\n\n\treturn nodes;\n}\n\n/**\n * Represents a step in the path from node A to node B.\n */\ninterface Step {\n\t/**\n\t * The cost of the steps after this step.\n\t */\n\tcost: number;\n\n\t/**\n\t * The edge associated with this step.\n\t */\n\tedge?: Edge;\n\n\t/**\n\t * The next step.\n\t */\n\tnext?: Step;\n}\n\n/**\n * Finds the shortest cost path from node A to node B.\n *\n * @param from - The start node\n * @param constraints - Extra validation for a potential solution. Takes a path, returns true if the path is valid\n * @param goal - The target node\n * @param path - The running path\n * @param depth - The number of remaining recursions\n */\nfunction findPath(\n\tfrom: Node,\n\tconstraints: (path: Edge[]) => boolean,\n\tgoal = getNode(StreamType.Opus),\n\tpath: Edge[] = [],\n\tdepth = 5,\n): Step {\n\tif (from === goal && constraints(path)) {\n\t\treturn { cost: 0 };\n\t} else if (depth === 0) {\n\t\treturn { cost: Number.POSITIVE_INFINITY };\n\t}\n\n\tlet currentBest: Step | undefined;\n\tfor (const edge of from.edges) {\n\t\tif (currentBest && edge.cost > currentBest.cost) continue;\n\t\tconst next = findPath(edge.to, constraints, goal, [...path, edge], depth - 1);\n\t\tconst cost = edge.cost + next.cost;\n\t\tif (!currentBest || cost < currentBest.cost) {\n\t\t\tcurrentBest = { cost, edge, next };\n\t\t}\n\t}\n\n\treturn currentBest ?? { cost: Number.POSITIVE_INFINITY };\n}\n\n/**\n * Takes the solution from findPath and assembles it into a list of edges.\n *\n * @param step - The first step of the path\n */\nfunction constructPipeline(step: Step) {\n\tconst edges = [];\n\tlet current: Step | undefined = step;\n\twhile (current?.edge) {\n\t\tedges.push(current.edge);\n\t\tcurrent = current.next;\n\t}\n\n\treturn edges;\n}\n\n/**\n * Finds the lowest-cost pipeline to convert the input stream type into an Opus stream.\n *\n * @param from - The stream type to start from\n * @param constraint - Extra constraints that may be imposed on potential solution\n */\nexport function findPipeline(from: StreamType, constraint: (path: Edge[]) => boolean) {\n\treturn constructPipeline(findPath(getNode(from), constraint));\n}\n","/* eslint-disable @typescript-eslint/no-var-requires */\n/* eslint-disable @typescript-eslint/no-require-imports */\nimport { resolve, dirname } from 'node:path';\nimport prism from 'prism-media';\n\n/**\n * Tries to find the package.json file for a given module.\n *\n * @param dir - The directory to look in\n * @param packageName - The name of the package to look for\n * @param depth - The maximum recursion depth\n */\nfunction findPackageJSON(\n\tdir: string,\n\tpackageName: string,\n\tdepth: number,\n): { name: string; version: string } | undefined {\n\tif (depth === 0) return undefined;\n\tconst attemptedPath = resolve(dir, './package.json');\n\ttry {\n\t\tconst pkg = require(attemptedPath);\n\t\tif (pkg.name !== packageName) throw new Error('package.json does not match');\n\t\treturn pkg;\n\t} catch {\n\t\treturn findPackageJSON(resolve(dir, '..'), packageName, depth - 1);\n\t}\n}\n\n/**\n * Tries to find the version of a dependency.\n *\n * @param name - The package to find the version of\n */\nfunction version(name: string): string {\n\ttry {\n\t\tif (name === '@discordjs/voice') {\n\t\t\treturn '0.17.0';\n\t\t}\n\n\t\tconst pkg = findPackageJSON(dirname(require.resolve(name)), name, 3);\n\t\treturn pkg?.version ?? 'not found';\n\t} catch {\n\t\treturn 'not found';\n\t}\n}\n\n/**\n * Generates a report of the dependencies used by the \\@discordjs/voice module.\n * Useful for debugging.\n */\nexport function generateDependencyReport() {\n\tconst report = [];\n\tconst addVersion = (name: string) => report.push(`- ${name}: ${version(name)}`);\n\t// general\n\treport.push('Core Dependencies');\n\taddVersion('@discordjs/voice');\n\taddVersion('prism-media');\n\treport.push('');\n\n\t// opus\n\treport.push('Opus Libraries');\n\taddVersion('@discordjs/opus');\n\taddVersion('opusscript');\n\treport.push('');\n\n\t// encryption\n\treport.push('Encryption Libraries');\n\taddVersion('sodium-native');\n\taddVersion('sodium');\n\taddVersion('libsodium-wrappers');\n\taddVersion('tweetnacl');\n\treport.push('');\n\n\t// ffmpeg\n\treport.push('FFmpeg');\n\ttry {\n\t\tconst info = prism.FFmpeg.getInfo();\n\t\treport.push(`- version: ${info.version}`);\n\t\treport.push(`- libopus: ${info.output.includes('--enable-libopus') ? 'yes' : 'no'}`);\n\t} catch {\n\t\treport.push('- not found');\n\t}\n\n\treturn ['-'.repeat(50), ...report, '-'.repeat(50)].join('\\n');\n}\n","import { type EventEmitter, once } from 'node:events';\nimport type { VoiceConnection, VoiceConnectionStatus } from '../VoiceConnection';\nimport type { AudioPlayer, AudioPlayerStatus } from '../audio/AudioPlayer';\nimport { abortAfter } from './abortAfter';\n\n/**\n * Allows a voice connection a specified amount of time to enter a given state, otherwise rejects with an error.\n *\n * @param target - The voice connection that we want to observe the state change for\n * @param status - The status that the voice connection should be in\n * @param timeoutOrSignal - The maximum time we are allowing for this to occur, or a signal that will abort the operation\n */\nexport function entersState(\n\ttarget: VoiceConnection,\n\tstatus: VoiceConnectionStatus,\n\ttimeoutOrSignal: AbortSignal | number,\n): Promise;\n\n/**\n * Allows an audio player a specified amount of time to enter a given state, otherwise rejects with an error.\n *\n * @param target - The audio player that we want to observe the state change for\n * @param status - The status that the audio player should be in\n * @param timeoutOrSignal - The maximum time we are allowing for this to occur, or a signal that will abort the operation\n */\nexport function entersState(\n\ttarget: AudioPlayer,\n\tstatus: AudioPlayerStatus,\n\ttimeoutOrSignal: AbortSignal | number,\n): Promise;\n\n/**\n * Allows a target a specified amount of time to enter a given state, otherwise rejects with an error.\n *\n * @param target - The object that we want to observe the state change for\n * @param status - The status that the target should be in\n * @param timeoutOrSignal - The maximum time we are allowing for this to occur, or a signal that will abort the operation\n */\nexport async function entersState(\n\ttarget: Target,\n\tstatus: AudioPlayerStatus | VoiceConnectionStatus,\n\ttimeoutOrSignal: AbortSignal | number,\n) {\n\tif (target.state.status !== status) {\n\t\tconst [ac, signal] =\n\t\t\ttypeof timeoutOrSignal === 'number' ? abortAfter(timeoutOrSignal) : [undefined, timeoutOrSignal];\n\t\ttry {\n\t\t\tawait once(target as EventEmitter, status, { signal });\n\t\t} finally {\n\t\t\tac?.abort();\n\t\t}\n\t}\n\n\treturn target;\n}\n","/**\n * Creates an abort controller that aborts after the given time.\n *\n * @param delay - The time in milliseconds to wait before aborting\n */\nexport function abortAfter(delay: number): [AbortController, AbortSignal] {\n\tconst ac = new AbortController();\n\tconst timeout = setTimeout(() => ac.abort(), delay);\n\t// @ts-expect-error: No type for timeout\n\tac.signal.addEventListener('abort', () => clearTimeout(timeout));\n\treturn [ac, ac.signal];\n}\n","import { Buffer } from 'node:buffer';\nimport process from 'node:process';\nimport { Readable } from 'node:stream';\nimport prism from 'prism-media';\nimport { StreamType } from '..';\nimport { noop } from './util';\n\n/**\n * Takes an Opus Head, and verifies whether the associated Opus audio is suitable to play in a Discord voice channel.\n *\n * @param opusHead - The Opus Head to validate\n * @returns `true` if suitable to play in a Discord voice channel, otherwise `false`\n */\nexport function validateDiscordOpusHead(opusHead: Buffer): boolean {\n\tconst channels = opusHead.readUInt8(9);\n\tconst sampleRate = opusHead.readUInt32LE(12);\n\treturn channels === 2 && sampleRate === 48_000;\n}\n\n/**\n * The resulting information after probing an audio stream\n */\nexport interface ProbeInfo {\n\t/**\n\t * The readable audio stream to use. You should use this rather than the input stream, as the probing\n\t * function can sometimes read the input stream to its end and cause the stream to close.\n\t */\n\tstream: Readable;\n\n\t/**\n\t * The recommended stream type for this audio stream.\n\t */\n\ttype: StreamType;\n}\n\n/**\n * Attempt to probe a readable stream to figure out whether it can be demuxed using an Ogg or WebM Opus demuxer.\n *\n * @param stream - The readable stream to probe\n * @param probeSize - The number of bytes to attempt to read before giving up on the probe\n * @param validator - The Opus Head validator function\n * @experimental\n */\nexport async function demuxProbe(\n\tstream: Readable,\n\tprobeSize = 1_024,\n\tvalidator = validateDiscordOpusHead,\n): Promise {\n\treturn new Promise((resolve, reject) => {\n\t\t// Preconditions\n\t\tif (stream.readableObjectMode) {\n\t\t\treject(new Error('Cannot probe a readable stream in object mode'));\n\t\t\treturn;\n\t\t}\n\n\t\tif (stream.readableEnded) {\n\t\t\treject(new Error('Cannot probe a stream that has ended'));\n\t\t\treturn;\n\t\t}\n\n\t\tlet readBuffer = Buffer.alloc(0);\n\n\t\tlet resolved: StreamType | undefined;\n\n\t\tconst finish = (type: StreamType) => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\t\tstream.off('data', onData);\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\t\tstream.off('close', onClose);\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\t\tstream.off('end', onClose);\n\t\t\tstream.pause();\n\t\t\tresolved = type;\n\t\t\tif (stream.readableEnded) {\n\t\t\t\tresolve({\n\t\t\t\t\tstream: Readable.from(readBuffer),\n\t\t\t\t\ttype,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (readBuffer.length > 0) {\n\t\t\t\t\tstream.push(readBuffer);\n\t\t\t\t}\n\n\t\t\t\tresolve({\n\t\t\t\t\tstream,\n\t\t\t\t\ttype,\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tconst foundHead = (type: StreamType) => (head: Buffer) => {\n\t\t\tif (validator(head)) {\n\t\t\t\tfinish(type);\n\t\t\t}\n\t\t};\n\n\t\tconst webm = new prism.opus.WebmDemuxer();\n\t\twebm.once('error', noop);\n\t\twebm.on('head', foundHead(StreamType.WebmOpus));\n\n\t\tconst ogg = new prism.opus.OggDemuxer();\n\t\togg.once('error', noop);\n\t\togg.on('head', foundHead(StreamType.OggOpus));\n\n\t\tconst onClose = () => {\n\t\t\tif (!resolved) {\n\t\t\t\tfinish(StreamType.Arbitrary);\n\t\t\t}\n\t\t};\n\n\t\tconst onData = (buffer: Buffer) => {\n\t\t\treadBuffer = Buffer.concat([readBuffer, buffer]);\n\n\t\t\twebm.write(buffer);\n\t\t\togg.write(buffer);\n\n\t\t\tif (readBuffer.length >= probeSize) {\n\t\t\t\tstream.off('data', onData);\n\t\t\t\tstream.pause();\n\t\t\t\tprocess.nextTick(onClose);\n\t\t\t}\n\t\t};\n\n\t\tstream.once('error', reject);\n\t\tstream.on('data', onData);\n\t\tstream.once('close', onClose);\n\t\tstream.once('end', onClose);\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAAA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AAC;AAAA,MACF;AAAA,IACD,GAxBe;AA0Bf,UAAM,YAAY,wBAAC,SAAqB,CAAC,SAAiB;AACzD,UAAI,UAAU,IAAI,GAAG;AACpB,eAAO,IAAI;AAAA,MACZ;AAAA,IACD,GAJkB;AAMlB,UAAM,OAAO,IAAI,oBAAAC,QAAM,KAAK,YAAY;AACxC,SAAK,KAAK,SAAS,IAAI;AACvB,SAAK,GAAG,QAAQ,oCAA6B,CAAC;AAE9C,UAAM,MAAM,IAAI,oBAAAA,QAAM,KAAK,WAAW;AACtC,QAAI,KAAK,SAAS,IAAI;AACtB,QAAI,GAAG,QAAQ,kCAA4B,CAAC;AAE5C,UAAM,UAAU,6BAAM;AACrB,UAAI,CAAC,UAAU;AACd,0CAA2B;AAAA,MAC5B;AAAA,IACD,GAJgB;AAMhB,UAAM,SAAS,wBAAC,WAAmB;AAClC,mBAAa,2BAAO,OAAO,CAAC,YAAY,MAAM,CAAC;AAE/C,WAAK,MAAM,MAAM;AACjB,UAAI,MAAM,MAAM;AAEhB,UAAI,WAAW,UAAU,WAAW;AACnC,eAAO,IAAI,QAAQ,MAAM;AACzB,eAAO,MAAM;AACb,4BAAAC,QAAQ,SAAS,OAAO;AAAA,MACzB;AAAA,IACD,GAXe;AAaf,WAAO,KAAK,SAAS,MAAM;AAC3B,WAAO,GAAG,QAAQ,MAAM;AACxB,WAAO,KAAK,SAAS,OAAO;AAC5B,WAAO,KAAK,OAAO,OAAO;AAAA,EAC3B,CAAC;AACF;AArFsB;;;ArBhBf,IAAMC,WAAU;","names":["version","import_node_events","import_node_buffer","import_node_events","import_v4","nonce","import_node_buffer","resolve","import_node_events","WebSocket","nonce","option","import_node_buffer","import_v4","import_node_buffer","import_node_events","NoSubscriberBehavior","AudioPlayerStatus","stringifyState","EndBehaviorType","import_node_events","import_node_events","nonce","VoiceConnectionStatus","VoiceConnectionDisconnectReason","import_node_stream","import_prism_media","StreamType","prism","prism","import_prism_media","prism","import_node_events","import_node_buffer","import_node_stream","import_prism_media","resolve","prism","process","version"]} \ No newline at end of file +{"version":3,"sources":["../src/index.ts","../src/VoiceConnection.ts","../src/DataStore.ts","../src/networking/Networking.ts","../src/util/Secretbox.ts","../src/util/util.ts","../src/networking/DAVESession.ts","../src/audio/AudioPlayer.ts","../src/audio/AudioPlayerError.ts","../src/audio/PlayerSubscription.ts","../src/networking/VoiceUDPSocket.ts","../src/networking/VoiceWebSocket.ts","../src/receive/VoiceReceiver.ts","../src/receive/AudioReceiveStream.ts","../src/receive/SSRCMap.ts","../src/receive/SpeakingMap.ts","../src/joinVoiceChannel.ts","../src/audio/AudioResource.ts","../src/audio/TransformerGraph.ts","../src/util/generateDependencyReport.ts","../src/util/entersState.ts","../src/util/abortAfter.ts","../src/util/demuxProbe.ts"],"sourcesContent":["export * from './joinVoiceChannel';\nexport * from './audio/index';\nexport * from './util/index';\nexport * from './receive/index';\n\nexport {\n\tNetworking,\n\ttype ConnectionData,\n\ttype ConnectionOptions,\n\ttype NetworkingState,\n\ttype NetworkingResumingState,\n\ttype NetworkingSelectingProtocolState,\n\ttype NetworkingUdpHandshakingState,\n\ttype NetworkingClosedState,\n\ttype NetworkingIdentifyingState,\n\ttype NetworkingOpeningWsState,\n\ttype NetworkingReadyState,\n\tNetworkingStatusCode,\n\tVoiceUDPSocket,\n\tVoiceWebSocket,\n\ttype SocketConfig,\n\tDAVESession,\n} from './networking/index.js';\n\nexport {\n\tVoiceConnection,\n\ttype VoiceConnectionState,\n\tVoiceConnectionStatus,\n\ttype VoiceConnectionConnectingState,\n\ttype VoiceConnectionDestroyedState,\n\ttype VoiceConnectionDisconnectedState,\n\ttype VoiceConnectionDisconnectedBaseState,\n\ttype VoiceConnectionDisconnectedOtherState,\n\ttype VoiceConnectionDisconnectedWebSocketState,\n\tVoiceConnectionDisconnectReason,\n\ttype VoiceConnectionReadyState,\n\ttype VoiceConnectionSignallingState,\n} from './VoiceConnection';\n\nexport { type JoinConfig, getVoiceConnection, getVoiceConnections, getGroups } from './DataStore';\n\n/**\n * The {@link https://github.com/discordjs/discord.js/blob/main/packages/voice#readme | @discordjs/voice} version\n * that you are currently using.\n */\n// This needs to explicitly be `string` so it is not typed as a \"const string\" that gets injected by esbuild\nexport const version = '0.19.0' as string;\n","/* eslint-disable @typescript-eslint/unbound-method */\nimport type { Buffer } from 'node:buffer';\nimport { EventEmitter } from 'node:events';\nimport type { GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData } from 'discord-api-types/v10';\nimport type { JoinConfig } from './DataStore';\nimport {\n\tgetVoiceConnection,\n\tcreateJoinVoiceChannelPayload,\n\ttrackVoiceConnection,\n\tuntrackVoiceConnection,\n} from './DataStore';\nimport type { AudioPlayer } from './audio/AudioPlayer';\nimport type { PlayerSubscription } from './audio/PlayerSubscription';\nimport type { VoiceWebSocket, VoiceUDPSocket } from './networking';\nimport { Networking, NetworkingStatusCode, type NetworkingState } from './networking/Networking';\nimport { VoiceReceiver } from './receive/index';\nimport type { DiscordGatewayAdapterImplementerMethods } from './util/adapter';\nimport { noop } from './util/util';\nimport type { CreateVoiceConnectionOptions } from './index';\n\n/**\n * The various status codes a voice connection can hold at any one time.\n */\nexport enum VoiceConnectionStatus {\n\t/**\n\t * The `VOICE_SERVER_UPDATE` and `VOICE_STATE_UPDATE` packets have been received, now attempting to establish a voice connection.\n\t */\n\tConnecting = 'connecting',\n\n\t/**\n\t * The voice connection has been destroyed and untracked, it cannot be reused.\n\t */\n\tDestroyed = 'destroyed',\n\n\t/**\n\t * The voice connection has either been severed or not established.\n\t */\n\tDisconnected = 'disconnected',\n\n\t/**\n\t * A voice connection has been established, and is ready to be used.\n\t */\n\tReady = 'ready',\n\n\t/**\n\t * Sending a packet to the main Discord gateway to indicate we want to change our voice state.\n\t */\n\tSignalling = 'signalling',\n}\n\n/**\n * The state that a VoiceConnection will be in when it is waiting to receive a VOICE_SERVER_UPDATE and\n * VOICE_STATE_UPDATE packet from Discord, provided by the adapter.\n */\nexport interface VoiceConnectionSignallingState {\n\tadapter: DiscordGatewayAdapterImplementerMethods;\n\tstatus: VoiceConnectionStatus.Signalling;\n\tsubscription?: PlayerSubscription | undefined;\n}\n\n/**\n * The reasons a voice connection can be in the disconnected state.\n */\nexport enum VoiceConnectionDisconnectReason {\n\t/**\n\t * When the WebSocket connection has been closed.\n\t */\n\tWebSocketClose,\n\n\t/**\n\t * When the adapter was unable to send a message requested by the VoiceConnection.\n\t */\n\tAdapterUnavailable,\n\n\t/**\n\t * When a VOICE_SERVER_UPDATE packet is received with a null endpoint, causing the connection to be severed.\n\t */\n\tEndpointRemoved,\n\n\t/**\n\t * When a manual disconnect was requested.\n\t */\n\tManual,\n}\n\n/**\n * The state that a VoiceConnection will be in when it is not connected to a Discord voice server nor is\n * it attempting to connect. You can manually attempt to reconnect using VoiceConnection#reconnect.\n */\nexport interface VoiceConnectionDisconnectedBaseState {\n\tadapter: DiscordGatewayAdapterImplementerMethods;\n\tstatus: VoiceConnectionStatus.Disconnected;\n\tsubscription?: PlayerSubscription | undefined;\n}\n\n/**\n * The state that a VoiceConnection will be in when it is not connected to a Discord voice server nor is\n * it attempting to connect. You can manually attempt to reconnect using VoiceConnection#reconnect.\n */\nexport interface VoiceConnectionDisconnectedOtherState extends VoiceConnectionDisconnectedBaseState {\n\treason: Exclude;\n}\n\n/**\n * The state that a VoiceConnection will be in when its WebSocket connection was closed.\n * You can manually attempt to reconnect using VoiceConnection#reconnect.\n */\nexport interface VoiceConnectionDisconnectedWebSocketState extends VoiceConnectionDisconnectedBaseState {\n\t/**\n\t * The close code of the WebSocket connection to the Discord voice server.\n\t */\n\tcloseCode: number;\n\n\treason: VoiceConnectionDisconnectReason.WebSocketClose;\n}\n\n/**\n * The states that a VoiceConnection can be in when it is not connected to a Discord voice server nor is\n * it attempting to connect. You can manually attempt to connect using VoiceConnection#reconnect.\n */\nexport type VoiceConnectionDisconnectedState =\n\t| VoiceConnectionDisconnectedOtherState\n\t| VoiceConnectionDisconnectedWebSocketState;\n\n/**\n * The state that a VoiceConnection will be in when it is establishing a connection to a Discord\n * voice server.\n */\nexport interface VoiceConnectionConnectingState {\n\tadapter: DiscordGatewayAdapterImplementerMethods;\n\tnetworking: Networking;\n\tstatus: VoiceConnectionStatus.Connecting;\n\tsubscription?: PlayerSubscription | undefined;\n}\n\n/**\n * The state that a VoiceConnection will be in when it has an active connection to a Discord\n * voice server.\n */\nexport interface VoiceConnectionReadyState {\n\tadapter: DiscordGatewayAdapterImplementerMethods;\n\tnetworking: Networking;\n\tstatus: VoiceConnectionStatus.Ready;\n\tsubscription?: PlayerSubscription | undefined;\n}\n\n/**\n * The state that a VoiceConnection will be in when it has been permanently been destroyed by the\n * user and untracked by the library. It cannot be reconnected, instead, a new VoiceConnection\n * needs to be established.\n */\nexport interface VoiceConnectionDestroyedState {\n\tstatus: VoiceConnectionStatus.Destroyed;\n}\n\n/**\n * The various states that a voice connection can be in.\n */\nexport type VoiceConnectionState =\n\t| VoiceConnectionConnectingState\n\t| VoiceConnectionDestroyedState\n\t| VoiceConnectionDisconnectedState\n\t| VoiceConnectionReadyState\n\t| VoiceConnectionSignallingState;\n\nexport interface VoiceConnection extends EventEmitter {\n\t/**\n\t * Emitted when there is an error emitted from the voice connection\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'error', listener: (error: Error) => void): this;\n\t/**\n\t * Emitted debugging information about the voice connection\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'debug', listener: (message: string) => void): this;\n\t/**\n\t * Emitted when the state of the voice connection changes\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'stateChange', listener: (oldState: VoiceConnectionState, newState: VoiceConnectionState) => void): this;\n\t/**\n\t * Emitted when the end-to-end encrypted session has transitioned\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'transitioned', listener: (transitionId: number) => void): this;\n\t/**\n\t * Emitted when the state of the voice connection changes to a specific status\n\t *\n\t * @eventProperty\n\t */\n\ton(\n\t\tevent: Event,\n\t\tlistener: (oldState: VoiceConnectionState, newState: VoiceConnectionState & { status: Event }) => void,\n\t): this;\n}\n\n/**\n * A connection to the voice server of a Guild, can be used to play audio in voice channels.\n */\nexport class VoiceConnection extends EventEmitter {\n\t/**\n\t * The number of consecutive rejoin attempts. Initially 0, and increments for each rejoin.\n\t * When a connection is successfully established, it resets to 0.\n\t */\n\tpublic rejoinAttempts: number;\n\n\t/**\n\t * The state of the voice connection.\n\t */\n\tprivate _state: VoiceConnectionState;\n\n\t/**\n\t * A configuration storing all the data needed to reconnect to a Guild's voice server.\n\t *\n\t * @internal\n\t */\n\tpublic readonly joinConfig: JoinConfig;\n\n\t/**\n\t * The two packets needed to successfully establish a voice connection. They are received\n\t * from the main Discord gateway after signalling to change the voice state.\n\t */\n\tprivate readonly packets: {\n\t\tserver: GatewayVoiceServerUpdateDispatchData | undefined;\n\t\tstate: GatewayVoiceStateUpdateDispatchData | undefined;\n\t};\n\n\t/**\n\t * The receiver of this voice connection. You should join the voice channel with `selfDeaf` set\n\t * to false for this feature to work properly.\n\t */\n\tpublic readonly receiver: VoiceReceiver;\n\n\t/**\n\t * The debug logger function, if debugging is enabled.\n\t */\n\tprivate readonly debug: ((message: string) => void) | null;\n\n\t/**\n\t * The options used to create this voice connection.\n\t */\n\tprivate readonly options: CreateVoiceConnectionOptions;\n\n\t/**\n\t * Creates a new voice connection.\n\t *\n\t * @param joinConfig - The data required to establish the voice connection\n\t * @param options - The options used to create this voice connection\n\t */\n\tpublic constructor(joinConfig: JoinConfig, options: CreateVoiceConnectionOptions) {\n\t\tsuper();\n\n\t\tthis.debug = options.debug ? (message: string) => this.emit('debug', message) : null;\n\t\tthis.rejoinAttempts = 0;\n\n\t\tthis.receiver = new VoiceReceiver(this);\n\n\t\tthis.onNetworkingClose = this.onNetworkingClose.bind(this);\n\t\tthis.onNetworkingStateChange = this.onNetworkingStateChange.bind(this);\n\t\tthis.onNetworkingError = this.onNetworkingError.bind(this);\n\t\tthis.onNetworkingDebug = this.onNetworkingDebug.bind(this);\n\t\tthis.onNetworkingTransitioned = this.onNetworkingTransitioned.bind(this);\n\n\t\tconst adapter = options.adapterCreator({\n\t\t\tonVoiceServerUpdate: (data) => this.addServerPacket(data),\n\t\t\tonVoiceStateUpdate: (data) => this.addStatePacket(data),\n\t\t\tdestroy: () => this.destroy(false),\n\t\t});\n\n\t\tthis._state = { status: VoiceConnectionStatus.Signalling, adapter };\n\n\t\tthis.packets = {\n\t\t\tserver: undefined,\n\t\t\tstate: undefined,\n\t\t};\n\n\t\tthis.joinConfig = joinConfig;\n\t\tthis.options = options;\n\t}\n\n\t/**\n\t * The current state of the voice connection.\n\t *\n\t * @remarks\n\t * The setter will perform clean-up operations where necessary.\n\t */\n\tpublic get state() {\n\t\treturn this._state;\n\t}\n\n\tpublic set state(newState: VoiceConnectionState) {\n\t\tconst oldState = this._state;\n\t\tconst oldNetworking = Reflect.get(oldState, 'networking') as Networking | undefined;\n\t\tconst newNetworking = Reflect.get(newState, 'networking') as Networking | undefined;\n\n\t\tconst oldSubscription = Reflect.get(oldState, 'subscription') as PlayerSubscription | undefined;\n\t\tconst newSubscription = Reflect.get(newState, 'subscription') as PlayerSubscription | undefined;\n\n\t\tif (oldNetworking !== newNetworking) {\n\t\t\tif (oldNetworking) {\n\t\t\t\toldNetworking.on('error', noop);\n\t\t\t\toldNetworking.off('debug', this.onNetworkingDebug);\n\t\t\t\toldNetworking.off('error', this.onNetworkingError);\n\t\t\t\toldNetworking.off('close', this.onNetworkingClose);\n\t\t\t\toldNetworking.off('stateChange', this.onNetworkingStateChange);\n\t\t\t\toldNetworking.off('transitioned', this.onNetworkingTransitioned);\n\t\t\t\toldNetworking.destroy();\n\t\t\t}\n\n\t\t\tif (newNetworking) this.updateReceiveBindings(newNetworking.state, oldNetworking?.state);\n\t\t}\n\n\t\tif (newState.status === VoiceConnectionStatus.Ready) {\n\t\t\tthis.rejoinAttempts = 0;\n\t\t} else if (newState.status === VoiceConnectionStatus.Destroyed) {\n\t\t\tfor (const stream of this.receiver.subscriptions.values()) {\n\t\t\t\tif (!stream.destroyed) stream.destroy();\n\t\t\t}\n\t\t}\n\n\t\t// If destroyed, the adapter can also be destroyed so it can be cleaned up by the user\n\t\tif (oldState.status !== VoiceConnectionStatus.Destroyed && newState.status === VoiceConnectionStatus.Destroyed) {\n\t\t\toldState.adapter.destroy();\n\t\t}\n\n\t\tthis._state = newState;\n\n\t\tif (oldSubscription && oldSubscription !== newSubscription) {\n\t\t\toldSubscription.unsubscribe();\n\t\t}\n\n\t\tthis.emit('stateChange', oldState, newState);\n\t\tif (oldState.status !== newState.status) {\n\t\t\tthis.emit(newState.status, oldState, newState as any);\n\t\t}\n\t}\n\n\t/**\n\t * Registers a `VOICE_SERVER_UPDATE` packet to the voice connection. This will cause it to reconnect using the\n\t * new data provided in the packet.\n\t *\n\t * @param packet - The received `VOICE_SERVER_UPDATE` packet\n\t */\n\tprivate addServerPacket(packet: GatewayVoiceServerUpdateDispatchData) {\n\t\tthis.packets.server = packet;\n\t\tif (packet.endpoint) {\n\t\t\tthis.configureNetworking();\n\t\t} else if (this.state.status !== VoiceConnectionStatus.Destroyed) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\treason: VoiceConnectionDisconnectReason.EndpointRemoved,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Registers a `VOICE_STATE_UPDATE` packet to the voice connection. Most importantly, it stores the id of the\n\t * channel that the client is connected to.\n\t *\n\t * @param packet - The received `VOICE_STATE_UPDATE` packet\n\t */\n\tprivate addStatePacket(packet: GatewayVoiceStateUpdateDispatchData) {\n\t\tthis.packets.state = packet;\n\n\t\tif (packet.self_deaf !== undefined) this.joinConfig.selfDeaf = packet.self_deaf;\n\t\tif (packet.self_mute !== undefined) this.joinConfig.selfMute = packet.self_mute;\n\t\tif (packet.channel_id) this.joinConfig.channelId = packet.channel_id;\n\t\t/*\n\t\t\tthe channel_id being null doesn't necessarily mean it was intended for the client to leave the voice channel\n\t\t\tas it may have disconnected due to network failure. This will be gracefully handled once the voice websocket\n\t\t\tdies, and then it is up to the user to decide how they wish to handle this.\n\t\t*/\n\t}\n\n\t/**\n\t * Called when the networking state changes, and the new ws/udp packet/message handlers need to be rebound\n\t * to the new instances.\n\t *\n\t * @param newState - The new networking state\n\t * @param oldState - The old networking state, if there is one\n\t */\n\tprivate updateReceiveBindings(newState: NetworkingState, oldState?: NetworkingState) {\n\t\tconst oldWs = Reflect.get(oldState ?? {}, 'ws') as VoiceWebSocket | undefined;\n\t\tconst newWs = Reflect.get(newState, 'ws') as VoiceWebSocket | undefined;\n\t\tconst oldUdp = Reflect.get(oldState ?? {}, 'udp') as VoiceUDPSocket | undefined;\n\t\tconst newUdp = Reflect.get(newState, 'udp') as VoiceUDPSocket | undefined;\n\n\t\tif (oldWs !== newWs) {\n\t\t\toldWs?.off('packet', this.receiver.onWsPacket);\n\t\t\tnewWs?.on('packet', this.receiver.onWsPacket);\n\t\t}\n\n\t\tif (oldUdp !== newUdp) {\n\t\t\toldUdp?.off('message', this.receiver.onUdpMessage);\n\t\t\tnewUdp?.on('message', this.receiver.onUdpMessage);\n\t\t}\n\n\t\tthis.receiver.connectionData = Reflect.get(newState, 'connectionData') ?? {};\n\t}\n\n\t/**\n\t * Attempts to configure a networking instance for this voice connection using the received packets.\n\t * Both packets are required, and any existing networking instance will be destroyed.\n\t *\n\t * @remarks\n\t * This is called when the voice server of the connection changes, e.g. if the bot is moved into a\n\t * different channel in the same guild but has a different voice server. In this instance, the connection\n\t * needs to be re-established to the new voice server.\n\t *\n\t * The connection will transition to the Connecting state when this is called.\n\t */\n\tpublic configureNetworking() {\n\t\tconst { server, state } = this.packets;\n\t\tif (!server || !state || this.state.status === VoiceConnectionStatus.Destroyed || !server.endpoint) return;\n\n\t\tconst networking = new Networking(\n\t\t\t{\n\t\t\t\tendpoint: server.endpoint,\n\t\t\t\tserverId: server.guild_id,\n\t\t\t\ttoken: server.token,\n\t\t\t\tsessionId: state.session_id,\n\t\t\t\tuserId: state.user_id,\n\t\t\t\tchannelId: state.channel_id!,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdebug: Boolean(this.debug),\n\t\t\t\tdaveEncryption: this.options.daveEncryption ?? true,\n\t\t\t\tdecryptionFailureTolerance: this.options.decryptionFailureTolerance,\n\t\t\t},\n\t\t);\n\n\t\tnetworking.once('close', this.onNetworkingClose);\n\t\tnetworking.on('stateChange', this.onNetworkingStateChange);\n\t\tnetworking.on('error', this.onNetworkingError);\n\t\tnetworking.on('debug', this.onNetworkingDebug);\n\t\tnetworking.on('transitioned', this.onNetworkingTransitioned);\n\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\tstatus: VoiceConnectionStatus.Connecting,\n\t\t\tnetworking,\n\t\t};\n\t}\n\n\t/**\n\t * Called when the networking instance for this connection closes. If the close code is 4014 (do not reconnect),\n\t * the voice connection will transition to the Disconnected state which will store the close code. You can\n\t * decide whether or not to reconnect when this occurs by listening for the state change and calling reconnect().\n\t *\n\t * @remarks\n\t * If the close code was anything other than 4014, it is likely that the closing was not intended, and so the\n\t * VoiceConnection will signal to Discord that it would like to rejoin the channel. This automatically attempts\n\t * to re-establish the connection. This would be seen as a transition from the Ready state to the Signalling state.\n\t * @param code - The close code\n\t */\n\tprivate onNetworkingClose(code: number) {\n\t\tif (this.state.status === VoiceConnectionStatus.Destroyed) return;\n\t\t// If networking closes, try to connect to the voice channel again.\n\t\tif (code === 4_014) {\n\t\t\t// Disconnected - networking is already destroyed here\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\treason: VoiceConnectionDisconnectReason.WebSocketClose,\n\t\t\t\tcloseCode: code,\n\t\t\t};\n\t\t} else {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Signalling,\n\t\t\t};\n\t\t\tthis.rejoinAttempts++;\n\t\t\tif (!this.state.adapter.sendPayload(createJoinVoiceChannelPayload(this.joinConfig))) {\n\t\t\t\tthis.state = {\n\t\t\t\t\t...this.state,\n\t\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Called when the state of the networking instance changes. This is used to derive the state of the voice connection.\n\t *\n\t * @param oldState - The previous state\n\t * @param newState - The new state\n\t */\n\tprivate onNetworkingStateChange(oldState: NetworkingState, newState: NetworkingState) {\n\t\tthis.updateReceiveBindings(newState, oldState);\n\t\tif (oldState.code === newState.code) return;\n\t\tif (this.state.status !== VoiceConnectionStatus.Connecting && this.state.status !== VoiceConnectionStatus.Ready)\n\t\t\treturn;\n\n\t\tif (newState.code === NetworkingStatusCode.Ready) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Ready,\n\t\t\t};\n\t\t} else if (newState.code !== NetworkingStatusCode.Closed) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Connecting,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Propagates errors from the underlying network instance.\n\t *\n\t * @param error - The error to propagate\n\t */\n\tprivate onNetworkingError(error: Error) {\n\t\tthis.emit('error', error);\n\t}\n\n\t/**\n\t * Propagates debug messages from the underlying network instance.\n\t *\n\t * @param message - The debug message to propagate\n\t */\n\tprivate onNetworkingDebug(message: string) {\n\t\tthis.debug?.(`[NW] ${message}`);\n\t}\n\n\t/**\n\t * Propagates transitions from the underlying network instance.\n\t *\n\t * @param transitionId - The transition id\n\t */\n\tprivate onNetworkingTransitioned(transitionId: number) {\n\t\tthis.emit('transitioned', transitionId);\n\t}\n\n\t/**\n\t * Prepares an audio packet for dispatch.\n\t *\n\t * @param buffer - The Opus packet to prepare\n\t */\n\tpublic prepareAudioPacket(buffer: Buffer) {\n\t\tconst state = this.state;\n\t\tif (state.status !== VoiceConnectionStatus.Ready) return;\n\t\treturn state.networking.prepareAudioPacket(buffer);\n\t}\n\n\t/**\n\t * Dispatches the previously prepared audio packet (if any)\n\t */\n\tpublic dispatchAudio() {\n\t\tconst state = this.state;\n\t\tif (state.status !== VoiceConnectionStatus.Ready) return;\n\t\treturn state.networking.dispatchAudio();\n\t}\n\n\t/**\n\t * Prepares an audio packet and dispatches it immediately.\n\t *\n\t * @param buffer - The Opus packet to play\n\t */\n\tpublic playOpusPacket(buffer: Buffer) {\n\t\tconst state = this.state;\n\t\tif (state.status !== VoiceConnectionStatus.Ready) return;\n\t\tstate.networking.prepareAudioPacket(buffer);\n\t\treturn state.networking.dispatchAudio();\n\t}\n\n\t/**\n\t * Destroys the VoiceConnection, preventing it from connecting to voice again.\n\t * This method should be called when you no longer require the VoiceConnection to\n\t * prevent memory leaks.\n\t *\n\t * @param adapterAvailable - Whether the adapter can be used\n\t */\n\tpublic destroy(adapterAvailable = true) {\n\t\tif (this.state.status === VoiceConnectionStatus.Destroyed) {\n\t\t\tthrow new Error('Cannot destroy VoiceConnection - it has already been destroyed');\n\t\t}\n\n\t\tif (getVoiceConnection(this.joinConfig.guildId, this.joinConfig.group) === this) {\n\t\t\tuntrackVoiceConnection(this);\n\t\t}\n\n\t\tif (adapterAvailable) {\n\t\t\tthis.state.adapter.sendPayload(createJoinVoiceChannelPayload({ ...this.joinConfig, channelId: null }));\n\t\t}\n\n\t\tthis.state = {\n\t\t\tstatus: VoiceConnectionStatus.Destroyed,\n\t\t};\n\t}\n\n\t/**\n\t * Disconnects the VoiceConnection, allowing the possibility of rejoining later on.\n\t *\n\t * @returns `true` if the connection was successfully disconnected\n\t */\n\tpublic disconnect() {\n\t\tif (\n\t\t\tthis.state.status === VoiceConnectionStatus.Destroyed ||\n\t\t\tthis.state.status === VoiceConnectionStatus.Signalling\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.joinConfig.channelId = null;\n\t\tif (!this.state.adapter.sendPayload(createJoinVoiceChannelPayload(this.joinConfig))) {\n\t\t\tthis.state = {\n\t\t\t\tadapter: this.state.adapter,\n\t\t\t\tsubscription: this.state.subscription,\n\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t\t};\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.state = {\n\t\t\tadapter: this.state.adapter,\n\t\t\treason: VoiceConnectionDisconnectReason.Manual,\n\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t};\n\t\treturn true;\n\t}\n\n\t/**\n\t * Attempts to rejoin (better explanation soon:tm:)\n\t *\n\t * @remarks\n\t * Calling this method successfully will automatically increment the `rejoinAttempts` counter,\n\t * which you can use to inform whether or not you'd like to keep attempting to reconnect your\n\t * voice connection.\n\t *\n\t * A state transition from Disconnected to Signalling will be observed when this is called.\n\t */\n\tpublic rejoin(joinConfig?: Omit) {\n\t\tif (this.state.status === VoiceConnectionStatus.Destroyed) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst notReady = this.state.status !== VoiceConnectionStatus.Ready;\n\n\t\tif (notReady) this.rejoinAttempts++;\n\t\tObject.assign(this.joinConfig, joinConfig);\n\t\tif (this.state.adapter.sendPayload(createJoinVoiceChannelPayload(this.joinConfig))) {\n\t\t\tif (notReady) {\n\t\t\t\tthis.state = {\n\t\t\t\t\t...this.state,\n\t\t\t\t\tstatus: VoiceConnectionStatus.Signalling,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tthis.state = {\n\t\t\tadapter: this.state.adapter,\n\t\t\tsubscription: this.state.subscription,\n\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t};\n\t\treturn false;\n\t}\n\n\t/**\n\t * Updates the speaking status of the voice connection. This is used when audio players are done playing audio,\n\t * and need to signal that the connection is no longer playing audio.\n\t *\n\t * @param enabled - Whether or not to show as speaking\n\t */\n\tpublic setSpeaking(enabled: boolean) {\n\t\tif (this.state.status !== VoiceConnectionStatus.Ready) return false;\n\t\t// eslint-disable-next-line @typescript-eslint/no-confusing-void-expression\n\t\treturn this.state.networking.setSpeaking(enabled);\n\t}\n\n\t/**\n\t * Subscribes to an audio player, allowing the player to play audio on this voice connection.\n\t *\n\t * @param player - The audio player to subscribe to\n\t * @returns The created subscription\n\t */\n\tpublic subscribe(player: AudioPlayer) {\n\t\tif (this.state.status === VoiceConnectionStatus.Destroyed) return;\n\n\t\t// eslint-disable-next-line @typescript-eslint/dot-notation\n\t\tconst subscription = player['subscribe'](this);\n\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\tsubscription,\n\t\t};\n\n\t\treturn subscription;\n\t}\n\n\t/**\n\t * The latest ping (in milliseconds) for the WebSocket connection and audio playback for this voice\n\t * connection, if this data is available.\n\t *\n\t * @remarks\n\t * For this data to be available, the VoiceConnection must be in the Ready state, and its underlying\n\t * WebSocket connection and UDP socket must have had at least one ping-pong exchange.\n\t */\n\tpublic get ping() {\n\t\tif (\n\t\t\tthis.state.status === VoiceConnectionStatus.Ready &&\n\t\t\tthis.state.networking.state.code === NetworkingStatusCode.Ready\n\t\t) {\n\t\t\treturn {\n\t\t\t\tws: this.state.networking.state.ws.ping,\n\t\t\t\tudp: this.state.networking.state.udp.ping,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tws: undefined,\n\t\t\tudp: undefined,\n\t\t};\n\t}\n\n\t/**\n\t * The current voice privacy code of the encrypted session.\n\t *\n\t * @remarks\n\t * For this data to be available, the VoiceConnection must be in the Ready state,\n\t * and the connection would have to be end-to-end encrypted.\n\t */\n\tpublic get voicePrivacyCode() {\n\t\tif (\n\t\t\tthis.state.status === VoiceConnectionStatus.Ready &&\n\t\t\tthis.state.networking.state.code === NetworkingStatusCode.Ready\n\t\t) {\n\t\t\treturn this.state.networking.state.dave?.voicePrivacyCode ?? undefined;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Gets the verification code for a user in the session.\n\t *\n\t * @throws Will throw if end-to-end encryption is not on or if the user id provided is not in the session.\n\t */\n\tpublic async getVerificationCode(userId: string): Promise {\n\t\tif (\n\t\t\tthis.state.status === VoiceConnectionStatus.Ready &&\n\t\t\tthis.state.networking.state.code === NetworkingStatusCode.Ready &&\n\t\t\tthis.state.networking.state.dave\n\t\t) {\n\t\t\treturn this.state.networking.state.dave.getVerificationCode(userId);\n\t\t}\n\n\t\tthrow new Error('Session not available');\n\t}\n\n\t/**\n\t * Called when a subscription of this voice connection to an audio player is removed.\n\t *\n\t * @param subscription - The removed subscription\n\t */\n\tprotected onSubscriptionRemoved(subscription: PlayerSubscription) {\n\t\tif (this.state.status !== VoiceConnectionStatus.Destroyed && this.state.subscription === subscription) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tsubscription: undefined,\n\t\t\t};\n\t\t}\n\t}\n}\n\n/**\n * Creates a new voice connection.\n *\n * @param joinConfig - The data required to establish the voice connection\n * @param options - The options to use when joining the voice channel\n */\nexport function createVoiceConnection(joinConfig: JoinConfig, options: CreateVoiceConnectionOptions) {\n\tconst payload = createJoinVoiceChannelPayload(joinConfig);\n\tconst existing = getVoiceConnection(joinConfig.guildId, joinConfig.group);\n\tif (existing && existing.state.status !== VoiceConnectionStatus.Destroyed) {\n\t\tif (existing.state.status === VoiceConnectionStatus.Disconnected) {\n\t\t\texisting.rejoin({\n\t\t\t\tchannelId: joinConfig.channelId,\n\t\t\t\tselfDeaf: joinConfig.selfDeaf,\n\t\t\t\tselfMute: joinConfig.selfMute,\n\t\t\t});\n\t\t} else if (!existing.state.adapter.sendPayload(payload)) {\n\t\t\texisting.state = {\n\t\t\t\t...existing.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t\t};\n\t\t}\n\n\t\treturn existing;\n\t}\n\n\tconst voiceConnection = new VoiceConnection(joinConfig, options);\n\ttrackVoiceConnection(voiceConnection);\n\tif (\n\t\tvoiceConnection.state.status !== VoiceConnectionStatus.Destroyed &&\n\t\t!voiceConnection.state.adapter.sendPayload(payload)\n\t) {\n\t\tvoiceConnection.state = {\n\t\t\t...voiceConnection.state,\n\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t};\n\t}\n\n\treturn voiceConnection;\n}\n","import { GatewayOpcodes } from 'discord-api-types/v10';\nimport type { VoiceConnection } from './VoiceConnection';\nimport type { AudioPlayer } from './audio/index';\n\nexport interface JoinConfig {\n\tchannelId: string | null;\n\tgroup: string;\n\tguildId: string;\n\tselfDeaf: boolean;\n\tselfMute: boolean;\n}\n\n/**\n * Sends a voice state update to the main websocket shard of a guild, to indicate joining/leaving/moving across\n * voice channels.\n *\n * @param config - The configuration to use when joining the voice channel\n */\nexport function createJoinVoiceChannelPayload(config: JoinConfig) {\n\treturn {\n\t\top: GatewayOpcodes.VoiceStateUpdate,\n\t\t// eslint-disable-next-line id-length\n\t\td: {\n\t\t\tguild_id: config.guildId,\n\t\t\tchannel_id: config.channelId,\n\t\t\tself_deaf: config.selfDeaf,\n\t\t\tself_mute: config.selfMute,\n\t\t},\n\t};\n}\n\n// Voice Connections\nconst groups = new Map>();\ngroups.set('default', new Map());\n\nfunction getOrCreateGroup(group: string) {\n\tconst existing = groups.get(group);\n\tif (existing) return existing;\n\tconst map = new Map();\n\tgroups.set(group, map);\n\treturn map;\n}\n\n/**\n * Retrieves the map of group names to maps of voice connections. By default, all voice connections\n * are created under the 'default' group.\n *\n * @returns The group map\n */\nexport function getGroups() {\n\treturn groups;\n}\n\n/**\n * Retrieves all the voice connections under the 'default' group.\n *\n * @param group - The group to look up\n * @returns The map of voice connections\n */\nexport function getVoiceConnections(group?: 'default'): Map;\n\n/**\n * Retrieves all the voice connections under the given group name.\n *\n * @param group - The group to look up\n * @returns The map of voice connections\n */\nexport function getVoiceConnections(group: string): Map | undefined;\n\n/**\n * Retrieves all the voice connections under the given group name. Defaults to the 'default' group.\n *\n * @param group - The group to look up\n * @returns The map of voice connections\n */\nexport function getVoiceConnections(group = 'default') {\n\treturn groups.get(group);\n}\n\n/**\n * Finds a voice connection with the given guild id and group. Defaults to the 'default' group.\n *\n * @param guildId - The guild id of the voice connection\n * @param group - the group that the voice connection was registered with\n * @returns The voice connection, if it exists\n */\nexport function getVoiceConnection(guildId: string, group = 'default') {\n\treturn getVoiceConnections(group)?.get(guildId);\n}\n\nexport function untrackVoiceConnection(voiceConnection: VoiceConnection) {\n\treturn getVoiceConnections(voiceConnection.joinConfig.group)?.delete(voiceConnection.joinConfig.guildId);\n}\n\nexport function trackVoiceConnection(voiceConnection: VoiceConnection) {\n\treturn getOrCreateGroup(voiceConnection.joinConfig.group).set(voiceConnection.joinConfig.guildId, voiceConnection);\n}\n\n// Audio Players\n\n// Each audio packet is 20ms long\nconst FRAME_LENGTH = 20;\n\nlet audioCycleInterval: NodeJS.Timeout | undefined;\nlet nextTime = -1;\n\n/**\n * A list of created audio players that are still active and haven't been destroyed.\n */\nconst audioPlayers: AudioPlayer[] = [];\n\n/**\n * Called roughly every 20 milliseconds. Dispatches audio from all players, and then gets the players to prepare\n * the next audio frame.\n */\nfunction audioCycleStep() {\n\tif (nextTime === -1) return;\n\n\tnextTime += FRAME_LENGTH;\n\tconst available = audioPlayers.filter((player) => player.checkPlayable());\n\n\tfor (const player of available) {\n\t\t// eslint-disable-next-line @typescript-eslint/dot-notation\n\t\tplayer['_stepDispatch']();\n\t}\n\n\tprepareNextAudioFrame(available);\n}\n\n/**\n * Recursively gets the players that have been passed as parameters to prepare audio frames that can be played\n * at the start of the next cycle.\n */\nfunction prepareNextAudioFrame(players: AudioPlayer[]) {\n\tconst nextPlayer = players.shift();\n\n\tif (!nextPlayer) {\n\t\tif (nextTime !== -1) {\n\t\t\taudioCycleInterval = setTimeout(() => audioCycleStep(), nextTime - Date.now());\n\t\t}\n\n\t\treturn;\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/dot-notation\n\tnextPlayer['_stepPrepare']();\n\n\t// setImmediate to avoid long audio player chains blocking other scheduled tasks\n\tsetImmediate(() => prepareNextAudioFrame(players));\n}\n\n/**\n * Checks whether or not the given audio player is being driven by the data store clock.\n *\n * @param target - The target to test for\n * @returns `true` if it is being tracked, `false` otherwise\n */\nexport function hasAudioPlayer(target: AudioPlayer) {\n\treturn audioPlayers.includes(target);\n}\n\n/**\n * Adds an audio player to the data store tracking list, if it isn't already there.\n *\n * @param player - The player to track\n */\nexport function addAudioPlayer(player: AudioPlayer) {\n\tif (hasAudioPlayer(player)) return player;\n\taudioPlayers.push(player);\n\tif (audioPlayers.length === 1) {\n\t\tnextTime = Date.now();\n\t\tsetImmediate(() => audioCycleStep());\n\t}\n\n\treturn player;\n}\n\n/**\n * Removes an audio player from the data store tracking list, if it is present there.\n */\nexport function deleteAudioPlayer(player: AudioPlayer) {\n\tconst index = audioPlayers.indexOf(player);\n\tif (index === -1) return;\n\taudioPlayers.splice(index, 1);\n\tif (audioPlayers.length === 0) {\n\t\tnextTime = -1;\n\t\tif (audioCycleInterval !== undefined) clearTimeout(audioCycleInterval);\n\t}\n}\n","/* eslint-disable jsdoc/check-param-names */\n/* eslint-disable id-length */\n/* eslint-disable @typescript-eslint/unbound-method */\nimport { Buffer } from 'node:buffer';\nimport crypto from 'node:crypto';\nimport { EventEmitter } from 'node:events';\nimport type { VoiceReceivePayload, VoiceSpeakingFlags } from 'discord-api-types/voice/v8';\nimport { VoiceEncryptionMode, VoiceOpcodes } from 'discord-api-types/voice/v8';\nimport type { CloseEvent } from 'ws';\nimport * as secretbox from '../util/Secretbox';\nimport { noop } from '../util/util';\nimport { DAVESession, getMaxProtocolVersion } from './DAVESession';\nimport { VoiceUDPSocket } from './VoiceUDPSocket';\nimport type { BinaryWebSocketMessage } from './VoiceWebSocket';\nimport { VoiceWebSocket } from './VoiceWebSocket';\n\n// The number of audio channels required by Discord\nconst CHANNELS = 2;\nconst TIMESTAMP_INC = (48_000 / 100) * CHANNELS;\nconst MAX_NONCE_SIZE = 2 ** 32 - 1;\n\nexport const SUPPORTED_ENCRYPTION_MODES: VoiceEncryptionMode[] = [VoiceEncryptionMode.AeadXChaCha20Poly1305RtpSize];\n\n// Just in case there's some system that doesn't come with aes-256-gcm, conditionally add it as supported\nif (crypto.getCiphers().includes('aes-256-gcm')) {\n\tSUPPORTED_ENCRYPTION_MODES.unshift(VoiceEncryptionMode.AeadAes256GcmRtpSize);\n}\n\n/**\n * The different statuses that a networking instance can hold. The order\n * of the states between OpeningWs and Ready is chronological (first the\n * instance enters OpeningWs, then it enters Identifying etc.)\n */\nexport enum NetworkingStatusCode {\n\tOpeningWs,\n\tIdentifying,\n\tUdpHandshaking,\n\tSelectingProtocol,\n\tReady,\n\tResuming,\n\tClosed,\n}\n\n/**\n * The initial Networking state. Instances will be in this state when a WebSocket connection to a Discord\n * voice gateway is being opened.\n */\nexport interface NetworkingOpeningWsState {\n\tcode: NetworkingStatusCode.OpeningWs;\n\tconnectionOptions: ConnectionOptions;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when it is attempting to authorize itself.\n */\nexport interface NetworkingIdentifyingState {\n\tcode: NetworkingStatusCode.Identifying;\n\tconnectionOptions: ConnectionOptions;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when opening a UDP connection to the IP and port provided\n * by Discord, as well as performing IP discovery.\n */\nexport interface NetworkingUdpHandshakingState {\n\tcode: NetworkingStatusCode.UdpHandshaking;\n\tconnectionData: Pick;\n\tconnectionOptions: ConnectionOptions;\n\tudp: VoiceUDPSocket;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when selecting an encryption protocol for audio packets.\n */\nexport interface NetworkingSelectingProtocolState {\n\tcode: NetworkingStatusCode.SelectingProtocol;\n\tconnectionData: Pick;\n\tconnectionOptions: ConnectionOptions;\n\tudp: VoiceUDPSocket;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when it has a fully established connection to a Discord\n * voice server.\n */\nexport interface NetworkingReadyState {\n\tcode: NetworkingStatusCode.Ready;\n\tconnectionData: ConnectionData;\n\tconnectionOptions: ConnectionOptions;\n\tdave?: DAVESession | undefined;\n\tpreparedPacket?: Buffer | undefined;\n\tudp: VoiceUDPSocket;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when its connection has been dropped unexpectedly, and it\n * is attempting to resume an existing session.\n */\nexport interface NetworkingResumingState {\n\tcode: NetworkingStatusCode.Resuming;\n\tconnectionData: ConnectionData;\n\tconnectionOptions: ConnectionOptions;\n\tdave?: DAVESession | undefined;\n\tpreparedPacket?: Buffer | undefined;\n\tudp: VoiceUDPSocket;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when it has been destroyed. It cannot be recovered from this\n * state.\n */\nexport interface NetworkingClosedState {\n\tcode: NetworkingStatusCode.Closed;\n}\n\n/**\n * The various states that a networking instance can be in.\n */\nexport type NetworkingState =\n\t| NetworkingClosedState\n\t| NetworkingIdentifyingState\n\t| NetworkingOpeningWsState\n\t| NetworkingReadyState\n\t| NetworkingResumingState\n\t| NetworkingSelectingProtocolState\n\t| NetworkingUdpHandshakingState;\n\n/**\n * Details required to connect to the Discord voice gateway. These details\n * are first received on the main bot gateway, in the form of VOICE_SERVER_UPDATE\n * and VOICE_STATE_UPDATE packets.\n */\nexport interface ConnectionOptions {\n\tchannelId: string;\n\tendpoint: string;\n\tserverId: string;\n\tsessionId: string;\n\ttoken: string;\n\tuserId: string;\n}\n\n/**\n * Information about the current connection, e.g. which encryption mode is to be used on\n * the connection, timing information for playback of streams.\n */\nexport interface ConnectionData {\n\tconnectedClients: Set;\n\tencryptionMode: string;\n\tnonce: number;\n\tnonceBuffer: Buffer;\n\tpacketsPlayed: number;\n\tsecretKey: Uint8Array;\n\tsequence: number;\n\tspeaking: boolean;\n\tssrc: number;\n\ttimestamp: number;\n}\n\n/**\n * Options for networking that dictate behavior.\n */\nexport interface NetworkingOptions {\n\tdaveEncryption?: boolean | undefined;\n\tdebug?: boolean | undefined;\n\tdecryptionFailureTolerance?: number | undefined;\n}\n\n/**\n * An empty buffer that is reused in packet encryption by many different networking instances.\n */\nconst nonce = Buffer.alloc(24);\n\nexport interface Networking extends EventEmitter {\n\t/**\n\t * Debug event for Networking.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'debug', listener: (message: string) => void): this;\n\ton(event: 'error', listener: (error: Error) => void): this;\n\ton(event: 'stateChange', listener: (oldState: NetworkingState, newState: NetworkingState) => void): this;\n\ton(event: 'close', listener: (code: number) => void): this;\n\ton(event: 'transitioned', listener: (transitionId: number) => void): this;\n}\n\n/**\n * Stringifies a NetworkingState.\n *\n * @param state - The state to stringify\n */\nfunction stringifyState(state: NetworkingState) {\n\treturn JSON.stringify({\n\t\t...state,\n\t\tws: Reflect.has(state, 'ws'),\n\t\tudp: Reflect.has(state, 'udp'),\n\t});\n}\n\n/**\n * Chooses an encryption mode from a list of given options. Chooses the most preferred option.\n *\n * @param options - The available encryption options\n */\nfunction chooseEncryptionMode(options: VoiceEncryptionMode[]): VoiceEncryptionMode {\n\tconst option = options.find((option) => SUPPORTED_ENCRYPTION_MODES.includes(option));\n\tif (!option) {\n\t\t// This should only ever happen if the gateway does not give us any encryption modes we support.\n\t\tthrow new Error(`No compatible encryption modes. Available include: ${options.join(', ')}`);\n\t}\n\n\treturn option;\n}\n\n/**\n * Returns a random number that is in the range of n bits.\n *\n * @param numberOfBits - The number of bits\n */\nfunction randomNBit(numberOfBits: number) {\n\treturn Math.floor(Math.random() * 2 ** numberOfBits);\n}\n\n/**\n * Manages the networking required to maintain a voice connection and dispatch audio packets\n */\nexport class Networking extends EventEmitter {\n\tprivate _state: NetworkingState;\n\n\t/**\n\t * The debug logger function, if debugging is enabled.\n\t */\n\tprivate readonly debug: ((message: string) => void) | null;\n\n\t/**\n\t * The options used to create this Networking instance.\n\t */\n\tprivate readonly options: NetworkingOptions;\n\n\t/**\n\t * Creates a new Networking instance.\n\t */\n\tpublic constructor(connectionOptions: ConnectionOptions, options: NetworkingOptions) {\n\t\tsuper();\n\n\t\tthis.onWsOpen = this.onWsOpen.bind(this);\n\t\tthis.onChildError = this.onChildError.bind(this);\n\t\tthis.onWsPacket = this.onWsPacket.bind(this);\n\t\tthis.onWsBinary = this.onWsBinary.bind(this);\n\t\tthis.onWsClose = this.onWsClose.bind(this);\n\t\tthis.onWsDebug = this.onWsDebug.bind(this);\n\t\tthis.onUdpDebug = this.onUdpDebug.bind(this);\n\t\tthis.onUdpClose = this.onUdpClose.bind(this);\n\t\tthis.onDaveDebug = this.onDaveDebug.bind(this);\n\t\tthis.onDaveKeyPackage = this.onDaveKeyPackage.bind(this);\n\t\tthis.onDaveInvalidateTransition = this.onDaveInvalidateTransition.bind(this);\n\n\t\tthis.debug = options?.debug ? (message: string) => this.emit('debug', message) : null;\n\n\t\tthis._state = {\n\t\t\tcode: NetworkingStatusCode.OpeningWs,\n\t\t\tws: this.createWebSocket(connectionOptions.endpoint),\n\t\t\tconnectionOptions,\n\t\t};\n\t\tthis.options = options;\n\t}\n\n\t/**\n\t * Destroys the Networking instance, transitioning it into the Closed state.\n\t */\n\tpublic destroy() {\n\t\tthis.state = {\n\t\t\tcode: NetworkingStatusCode.Closed,\n\t\t};\n\t}\n\n\t/**\n\t * The current state of the networking instance.\n\t *\n\t * @remarks\n\t * The setter will perform clean-up operations where necessary.\n\t */\n\tpublic get state(): NetworkingState {\n\t\treturn this._state;\n\t}\n\n\tpublic set state(newState: NetworkingState) {\n\t\tconst oldWs = Reflect.get(this._state, 'ws') as VoiceWebSocket | undefined;\n\t\tconst newWs = Reflect.get(newState, 'ws') as VoiceWebSocket | undefined;\n\t\tif (oldWs && oldWs !== newWs) {\n\t\t\t// The old WebSocket is being freed - remove all handlers from it\n\t\t\toldWs.off('debug', this.onWsDebug);\n\t\t\toldWs.on('error', noop);\n\t\t\toldWs.off('error', this.onChildError);\n\t\t\toldWs.off('open', this.onWsOpen);\n\t\t\toldWs.off('packet', this.onWsPacket);\n\t\t\toldWs.off('binary', this.onWsBinary);\n\t\t\toldWs.off('close', this.onWsClose);\n\t\t\toldWs.destroy();\n\t\t}\n\n\t\tconst oldUdp = Reflect.get(this._state, 'udp') as VoiceUDPSocket | undefined;\n\t\tconst newUdp = Reflect.get(newState, 'udp') as VoiceUDPSocket | undefined;\n\n\t\tif (oldUdp && oldUdp !== newUdp) {\n\t\t\toldUdp.on('error', noop);\n\t\t\toldUdp.off('error', this.onChildError);\n\t\t\toldUdp.off('close', this.onUdpClose);\n\t\t\toldUdp.off('debug', this.onUdpDebug);\n\t\t\toldUdp.destroy();\n\t\t}\n\n\t\tconst oldDave = Reflect.get(this._state, 'dave') as DAVESession | undefined;\n\t\tconst newDave = Reflect.get(newState, 'dave') as DAVESession | undefined;\n\n\t\tif (oldDave && oldDave !== newDave) {\n\t\t\toldDave.off('error', this.onChildError);\n\t\t\toldDave.off('debug', this.onDaveDebug);\n\t\t\toldDave.off('keyPackage', this.onDaveKeyPackage);\n\t\t\toldDave.off('invalidateTransition', this.onDaveInvalidateTransition);\n\t\t\toldDave.destroy();\n\t\t}\n\n\t\tconst oldState = this._state;\n\t\tthis._state = newState;\n\t\tthis.emit('stateChange', oldState, newState);\n\n\t\tthis.debug?.(`state change:\\nfrom ${stringifyState(oldState)}\\nto ${stringifyState(newState)}`);\n\t}\n\n\t/**\n\t * Creates a new WebSocket to a Discord Voice gateway.\n\t *\n\t * @param endpoint - The endpoint to connect to\n\t * @param lastSequence - The last sequence to set for this WebSocket\n\t */\n\tprivate createWebSocket(endpoint: string, lastSequence?: number) {\n\t\tconst ws = new VoiceWebSocket(`wss://${endpoint}?v=8`, Boolean(this.debug));\n\n\t\tif (lastSequence !== undefined) {\n\t\t\tws.sequence = lastSequence;\n\t\t}\n\n\t\tws.on('error', this.onChildError);\n\t\tws.once('open', this.onWsOpen);\n\t\tws.on('packet', this.onWsPacket);\n\t\tws.on('binary', this.onWsBinary);\n\t\tws.once('close', this.onWsClose);\n\t\tws.on('debug', this.onWsDebug);\n\n\t\treturn ws;\n\t}\n\n\t/**\n\t * Creates a new DAVE session for this voice connection if we can create one.\n\t *\n\t * @param protocolVersion - The protocol version to use\n\t */\n\tprivate createDaveSession(protocolVersion: number) {\n\t\tif (\n\t\t\tgetMaxProtocolVersion() === null ||\n\t\t\tthis.options.daveEncryption === false ||\n\t\t\t(this.state.code !== NetworkingStatusCode.SelectingProtocol &&\n\t\t\t\tthis.state.code !== NetworkingStatusCode.Ready &&\n\t\t\t\tthis.state.code !== NetworkingStatusCode.Resuming)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst session = new DAVESession(\n\t\t\tprotocolVersion,\n\t\t\tthis.state.connectionOptions.userId,\n\t\t\tthis.state.connectionOptions.channelId,\n\t\t\t{\n\t\t\t\tdecryptionFailureTolerance: this.options.decryptionFailureTolerance,\n\t\t\t},\n\t\t);\n\n\t\tsession.on('error', this.onChildError);\n\t\tsession.on('debug', this.onDaveDebug);\n\t\tsession.on('keyPackage', this.onDaveKeyPackage);\n\t\tsession.on('invalidateTransition', this.onDaveInvalidateTransition);\n\t\tsession.reinit();\n\n\t\treturn session;\n\t}\n\n\t/**\n\t * Propagates errors from the children VoiceWebSocket, VoiceUDPSocket and DAVESession.\n\t *\n\t * @param error - The error that was emitted by a child\n\t */\n\tprivate onChildError(error: Error) {\n\t\tthis.emit('error', error);\n\t}\n\n\t/**\n\t * Called when the WebSocket opens. Depending on the state that the instance is in,\n\t * it will either identify with a new session, or it will attempt to resume an existing session.\n\t */\n\tprivate onWsOpen() {\n\t\tif (this.state.code === NetworkingStatusCode.OpeningWs) {\n\t\t\tthis.state.ws.sendPacket({\n\t\t\t\top: VoiceOpcodes.Identify,\n\t\t\t\td: {\n\t\t\t\t\tserver_id: this.state.connectionOptions.serverId,\n\t\t\t\t\tuser_id: this.state.connectionOptions.userId,\n\t\t\t\t\tsession_id: this.state.connectionOptions.sessionId,\n\t\t\t\t\ttoken: this.state.connectionOptions.token,\n\t\t\t\t\tmax_dave_protocol_version: this.options.daveEncryption === false ? 0 : (getMaxProtocolVersion() ?? 0),\n\t\t\t\t},\n\t\t\t});\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Identifying,\n\t\t\t};\n\t\t} else if (this.state.code === NetworkingStatusCode.Resuming) {\n\t\t\tthis.state.ws.sendPacket({\n\t\t\t\top: VoiceOpcodes.Resume,\n\t\t\t\td: {\n\t\t\t\t\tserver_id: this.state.connectionOptions.serverId,\n\t\t\t\t\tsession_id: this.state.connectionOptions.sessionId,\n\t\t\t\t\ttoken: this.state.connectionOptions.token,\n\t\t\t\t\tseq_ack: this.state.ws.sequence,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Called when the WebSocket closes. Based on the reason for closing (given by the code parameter),\n\t * the instance will either attempt to resume, or enter the closed state and emit a 'close' event\n\t * with the close code, allowing the user to decide whether or not they would like to reconnect.\n\t *\n\t * @param code - The close code\n\t */\n\tprivate onWsClose({ code }: CloseEvent) {\n\t\tconst canResume = code === 4_015 || code < 4_000;\n\t\tif (canResume && this.state.code === NetworkingStatusCode.Ready) {\n\t\t\tconst lastSequence = this.state.ws.sequence;\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Resuming,\n\t\t\t\tws: this.createWebSocket(this.state.connectionOptions.endpoint, lastSequence),\n\t\t\t};\n\t\t} else if (this.state.code !== NetworkingStatusCode.Closed) {\n\t\t\tthis.destroy();\n\t\t\tthis.emit('close', code);\n\t\t}\n\t}\n\n\t/**\n\t * Called when the UDP socket has closed itself if it has stopped receiving replies from Discord.\n\t */\n\tprivate onUdpClose() {\n\t\tif (this.state.code === NetworkingStatusCode.Ready) {\n\t\t\tconst lastSequence = this.state.ws.sequence;\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Resuming,\n\t\t\t\tws: this.createWebSocket(this.state.connectionOptions.endpoint, lastSequence),\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Called when a packet is received on the connection's WebSocket.\n\t *\n\t * @param packet - The received packet\n\t */\n\tprivate onWsPacket(packet: VoiceReceivePayload) {\n\t\tif (packet.op === VoiceOpcodes.Hello && this.state.code !== NetworkingStatusCode.Closed) {\n\t\t\tthis.state.ws.setHeartbeatInterval(packet.d.heartbeat_interval);\n\t\t} else if (packet.op === VoiceOpcodes.Ready && this.state.code === NetworkingStatusCode.Identifying) {\n\t\t\tconst { ip, port, ssrc, modes } = packet.d;\n\n\t\t\tconst udp = new VoiceUDPSocket({ ip, port });\n\t\t\tudp.on('error', this.onChildError);\n\t\t\tudp.on('debug', this.onUdpDebug);\n\t\t\tudp.once('close', this.onUdpClose);\n\t\t\tudp\n\t\t\t\t.performIPDiscovery(ssrc)\n\t\t\t\t// eslint-disable-next-line promise/prefer-await-to-then\n\t\t\t\t.then((localConfig) => {\n\t\t\t\t\tif (this.state.code !== NetworkingStatusCode.UdpHandshaking) return;\n\t\t\t\t\tthis.state.ws.sendPacket({\n\t\t\t\t\t\top: VoiceOpcodes.SelectProtocol,\n\t\t\t\t\t\td: {\n\t\t\t\t\t\t\tprotocol: 'udp',\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\taddress: localConfig.ip,\n\t\t\t\t\t\t\t\tport: localConfig.port,\n\t\t\t\t\t\t\t\tmode: chooseEncryptionMode(modes),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\tthis.state = {\n\t\t\t\t\t\t...this.state,\n\t\t\t\t\t\tcode: NetworkingStatusCode.SelectingProtocol,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t// eslint-disable-next-line promise/prefer-await-to-then, promise/prefer-await-to-callbacks\n\t\t\t\t.catch((error: Error) => this.emit('error', error));\n\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.UdpHandshaking,\n\t\t\t\tudp,\n\t\t\t\tconnectionData: {\n\t\t\t\t\tssrc,\n\t\t\t\t\tconnectedClients: new Set(),\n\t\t\t\t},\n\t\t\t};\n\t\t} else if (\n\t\t\tpacket.op === VoiceOpcodes.SessionDescription &&\n\t\t\tthis.state.code === NetworkingStatusCode.SelectingProtocol\n\t\t) {\n\t\t\tconst { mode: encryptionMode, secret_key: secretKey, dave_protocol_version: daveProtocolVersion } = packet.d;\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Ready,\n\t\t\t\tdave: this.createDaveSession(daveProtocolVersion),\n\t\t\t\tconnectionData: {\n\t\t\t\t\t...this.state.connectionData,\n\t\t\t\t\tencryptionMode,\n\t\t\t\t\tsecretKey: new Uint8Array(secretKey),\n\t\t\t\t\tsequence: randomNBit(16),\n\t\t\t\t\ttimestamp: randomNBit(32),\n\t\t\t\t\tnonce: 0,\n\t\t\t\t\tnonceBuffer: encryptionMode === 'aead_aes256_gcm_rtpsize' ? Buffer.alloc(12) : Buffer.alloc(24),\n\t\t\t\t\tspeaking: false,\n\t\t\t\t\tpacketsPlayed: 0,\n\t\t\t\t},\n\t\t\t};\n\t\t} else if (packet.op === VoiceOpcodes.Resumed && this.state.code === NetworkingStatusCode.Resuming) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Ready,\n\t\t\t};\n\t\t\tthis.state.connectionData.speaking = false;\n\t\t} else if (\n\t\t\t(packet.op === VoiceOpcodes.ClientsConnect || packet.op === VoiceOpcodes.ClientDisconnect) &&\n\t\t\t(this.state.code === NetworkingStatusCode.Ready ||\n\t\t\t\tthis.state.code === NetworkingStatusCode.UdpHandshaking ||\n\t\t\t\tthis.state.code === NetworkingStatusCode.SelectingProtocol ||\n\t\t\t\tthis.state.code === NetworkingStatusCode.Resuming)\n\t\t) {\n\t\t\tconst { connectionData } = this.state;\n\t\t\tif (packet.op === VoiceOpcodes.ClientsConnect)\n\t\t\t\tfor (const id of packet.d.user_ids) connectionData.connectedClients.add(id);\n\t\t\telse {\n\t\t\t\tconnectionData.connectedClients.delete(packet.d.user_id);\n\t\t\t}\n\t\t} else if (\n\t\t\t(this.state.code === NetworkingStatusCode.Ready || this.state.code === NetworkingStatusCode.Resuming) &&\n\t\t\tthis.state.dave\n\t\t) {\n\t\t\tif (packet.op === VoiceOpcodes.DavePrepareTransition) {\n\t\t\t\tconst sendReady = this.state.dave.prepareTransition(packet.d);\n\t\t\t\tif (sendReady)\n\t\t\t\t\tthis.state.ws.sendPacket({\n\t\t\t\t\t\top: VoiceOpcodes.DaveTransitionReady,\n\t\t\t\t\t\td: { transition_id: packet.d.transition_id },\n\t\t\t\t\t});\n\t\t\t\tif (packet.d.transition_id === 0) {\n\t\t\t\t\tthis.emit('transitioned', 0);\n\t\t\t\t}\n\t\t\t} else if (packet.op === VoiceOpcodes.DaveExecuteTransition) {\n\t\t\t\tconst transitioned = this.state.dave.executeTransition(packet.d.transition_id);\n\t\t\t\tif (transitioned) this.emit('transitioned', packet.d.transition_id);\n\t\t\t} else if (packet.op === VoiceOpcodes.DavePrepareEpoch) this.state.dave.prepareEpoch(packet.d);\n\t\t}\n\t}\n\n\t/**\n\t * Called when a binary message is received on the connection's WebSocket.\n\t *\n\t * @param message - The received message\n\t */\n\tprivate onWsBinary(message: BinaryWebSocketMessage) {\n\t\tif (this.state.code === NetworkingStatusCode.Ready && this.state.dave) {\n\t\t\tif (message.op === VoiceOpcodes.DaveMlsExternalSender) {\n\t\t\t\tthis.state.dave.setExternalSender(message.payload);\n\t\t\t} else if (message.op === VoiceOpcodes.DaveMlsProposals) {\n\t\t\t\tconst payload = this.state.dave.processProposals(message.payload, this.state.connectionData.connectedClients);\n\t\t\t\tif (payload) this.state.ws.sendBinaryMessage(VoiceOpcodes.DaveMlsCommitWelcome, payload);\n\t\t\t} else if (message.op === VoiceOpcodes.DaveMlsAnnounceCommitTransition) {\n\t\t\t\tconst { transitionId, success } = this.state.dave.processCommit(message.payload);\n\t\t\t\tif (success) {\n\t\t\t\t\tif (transitionId === 0) this.emit('transitioned', transitionId);\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.state.ws.sendPacket({\n\t\t\t\t\t\t\top: VoiceOpcodes.DaveTransitionReady,\n\t\t\t\t\t\t\td: { transition_id: transitionId },\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else if (message.op === VoiceOpcodes.DaveMlsWelcome) {\n\t\t\t\tconst { transitionId, success } = this.state.dave.processWelcome(message.payload);\n\t\t\t\tif (success) {\n\t\t\t\t\tif (transitionId === 0) this.emit('transitioned', transitionId);\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.state.ws.sendPacket({\n\t\t\t\t\t\t\top: VoiceOpcodes.DaveTransitionReady,\n\t\t\t\t\t\t\td: { transition_id: transitionId },\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Called when a new key package is ready to be sent to the voice server.\n\t *\n\t * @param keyPackage - The new key package\n\t */\n\tprivate onDaveKeyPackage(keyPackage: Buffer) {\n\t\tif (this.state.code === NetworkingStatusCode.SelectingProtocol || this.state.code === NetworkingStatusCode.Ready)\n\t\t\tthis.state.ws.sendBinaryMessage(VoiceOpcodes.DaveMlsKeyPackage, keyPackage);\n\t}\n\n\t/**\n\t * Called when the DAVE session wants to invalidate their transition and re-initialize.\n\t *\n\t * @param transitionId - The transition to invalidate\n\t */\n\tprivate onDaveInvalidateTransition(transitionId: number) {\n\t\tif (this.state.code === NetworkingStatusCode.SelectingProtocol || this.state.code === NetworkingStatusCode.Ready)\n\t\t\tthis.state.ws.sendPacket({\n\t\t\t\top: VoiceOpcodes.DaveMlsInvalidCommitWelcome,\n\t\t\t\td: { transition_id: transitionId },\n\t\t\t});\n\t}\n\n\t/**\n\t * Propagates debug messages from the child WebSocket.\n\t *\n\t * @param message - The emitted debug message\n\t */\n\tprivate onWsDebug(message: string) {\n\t\tthis.debug?.(`[WS] ${message}`);\n\t}\n\n\t/**\n\t * Propagates debug messages from the child UDPSocket.\n\t *\n\t * @param message - The emitted debug message\n\t */\n\tprivate onUdpDebug(message: string) {\n\t\tthis.debug?.(`[UDP] ${message}`);\n\t}\n\n\t/**\n\t * Propagates debug messages from the child DAVESession.\n\t *\n\t * @param message - The emitted debug message\n\t */\n\tprivate onDaveDebug(message: string) {\n\t\tthis.debug?.(`[DAVE] ${message}`);\n\t}\n\n\t/**\n\t * Prepares an Opus packet for playback. This includes attaching metadata to it and encrypting it.\n\t * It will be stored within the instance, and can be played by dispatchAudio()\n\t *\n\t * @remarks\n\t * Calling this method while there is already a prepared audio packet that has not yet been dispatched\n\t * will overwrite the existing audio packet. This should be avoided.\n\t * @param opusPacket - The Opus packet to encrypt\n\t * @returns The audio packet that was prepared\n\t */\n\tpublic prepareAudioPacket(opusPacket: Buffer) {\n\t\tconst state = this.state;\n\t\tif (state.code !== NetworkingStatusCode.Ready) return;\n\t\tstate.preparedPacket = this.createAudioPacket(opusPacket, state.connectionData, state.dave);\n\t\treturn state.preparedPacket;\n\t}\n\n\t/**\n\t * Dispatches the audio packet previously prepared by prepareAudioPacket(opusPacket). The audio packet\n\t * is consumed and cannot be dispatched again.\n\t */\n\tpublic dispatchAudio() {\n\t\tconst state = this.state;\n\t\tif (state.code !== NetworkingStatusCode.Ready) return false;\n\t\tif (state.preparedPacket !== undefined) {\n\t\t\tthis.playAudioPacket(state.preparedPacket);\n\t\t\tstate.preparedPacket = undefined;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Plays an audio packet, updating timing metadata used for playback.\n\t *\n\t * @param audioPacket - The audio packet to play\n\t */\n\tprivate playAudioPacket(audioPacket: Buffer) {\n\t\tconst state = this.state;\n\t\tif (state.code !== NetworkingStatusCode.Ready) return;\n\t\tconst { connectionData } = state;\n\t\tconnectionData.packetsPlayed++;\n\t\tconnectionData.sequence++;\n\t\tconnectionData.timestamp += TIMESTAMP_INC;\n\t\tif (connectionData.sequence >= 2 ** 16) connectionData.sequence = 0;\n\t\tif (connectionData.timestamp >= 2 ** 32) connectionData.timestamp = 0;\n\t\tthis.setSpeaking(true);\n\t\tstate.udp.send(audioPacket);\n\t}\n\n\t/**\n\t * Sends a packet to the voice gateway indicating that the client has start/stopped sending\n\t * audio.\n\t *\n\t * @param speaking - Whether or not the client should be shown as speaking\n\t */\n\tpublic setSpeaking(speaking: boolean) {\n\t\tconst state = this.state;\n\t\tif (state.code !== NetworkingStatusCode.Ready) return;\n\t\tif (state.connectionData.speaking === speaking) return;\n\t\tstate.connectionData.speaking = speaking;\n\t\tstate.ws.sendPacket({\n\t\t\top: VoiceOpcodes.Speaking,\n\t\t\td: {\n\t\t\t\tspeaking: (speaking ? 1 : 0) as VoiceSpeakingFlags,\n\t\t\t\tdelay: 0,\n\t\t\t\tssrc: state.connectionData.ssrc,\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Creates a new audio packet from an Opus packet. This involves encrypting the packet,\n\t * then prepending a header that includes metadata.\n\t *\n\t * @param opusPacket - The Opus packet to prepare\n\t * @param connectionData - The current connection data of the instance\n\t * @param daveSession - The DAVE session to use for encryption\n\t */\n\tprivate createAudioPacket(opusPacket: Buffer, connectionData: ConnectionData, daveSession?: DAVESession) {\n\t\tconst rtpHeader = Buffer.alloc(12);\n\t\trtpHeader[0] = 0x80;\n\t\trtpHeader[1] = 0x78;\n\n\t\tconst { sequence, timestamp, ssrc } = connectionData;\n\n\t\trtpHeader.writeUIntBE(sequence, 2, 2);\n\t\trtpHeader.writeUIntBE(timestamp, 4, 4);\n\t\trtpHeader.writeUIntBE(ssrc, 8, 4);\n\n\t\trtpHeader.copy(nonce, 0, 0, 12);\n\t\treturn Buffer.concat([rtpHeader, ...this.encryptOpusPacket(opusPacket, connectionData, rtpHeader, daveSession)]);\n\t}\n\n\t/**\n\t * Encrypts an Opus packet using the format agreed upon by the instance and Discord.\n\t *\n\t * @param opusPacket - The Opus packet to encrypt\n\t * @param connectionData - The current connection data of the instance\n\t * @param daveSession - The DAVE session to use for encryption\n\t */\n\tprivate encryptOpusPacket(\n\t\topusPacket: Buffer,\n\t\tconnectionData: ConnectionData,\n\t\tadditionalData: Buffer,\n\t\tdaveSession?: DAVESession,\n\t) {\n\t\tconst { secretKey, encryptionMode } = connectionData;\n\n\t\tconst packet = daveSession?.encrypt(opusPacket) ?? opusPacket;\n\n\t\t// Both supported encryption methods want the nonce to be an incremental integer\n\t\tconnectionData.nonce++;\n\t\tif (connectionData.nonce > MAX_NONCE_SIZE) connectionData.nonce = 0;\n\t\tconnectionData.nonceBuffer.writeUInt32BE(connectionData.nonce, 0);\n\n\t\t// 4 extra bytes of padding on the end of the encrypted packet\n\t\tconst noncePadding = connectionData.nonceBuffer.subarray(0, 4);\n\n\t\tlet encrypted;\n\t\tswitch (encryptionMode) {\n\t\t\tcase 'aead_aes256_gcm_rtpsize': {\n\t\t\t\tconst cipher = crypto.createCipheriv('aes-256-gcm', secretKey, connectionData.nonceBuffer);\n\t\t\t\tcipher.setAAD(additionalData);\n\n\t\t\t\tencrypted = Buffer.concat([cipher.update(packet), cipher.final(), cipher.getAuthTag()]);\n\n\t\t\t\treturn [encrypted, noncePadding];\n\t\t\t}\n\n\t\t\tcase 'aead_xchacha20_poly1305_rtpsize': {\n\t\t\t\tencrypted = secretbox.methods.crypto_aead_xchacha20poly1305_ietf_encrypt(\n\t\t\t\t\tpacket,\n\t\t\t\t\tadditionalData,\n\t\t\t\t\tconnectionData.nonceBuffer,\n\t\t\t\t\tsecretKey,\n\t\t\t\t);\n\n\t\t\t\treturn [encrypted, noncePadding];\n\t\t\t}\n\n\t\t\tdefault: {\n\t\t\t\t// This should never happen. Our encryption mode is chosen from a list given to us by the gateway and checked with the ones we support.\n\t\t\t\tthrow new RangeError(`Unsupported encryption method: ${encryptionMode}`);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Buffer } from 'node:buffer';\n\ninterface Methods {\n\tcrypto_aead_xchacha20poly1305_ietf_decrypt(\n\t\tcipherText: Buffer,\n\t\tadditionalData: Buffer,\n\t\tnonce: Buffer,\n\t\tkey: ArrayBufferLike,\n\t): Buffer;\n\tcrypto_aead_xchacha20poly1305_ietf_encrypt(\n\t\tplaintext: Buffer,\n\t\tadditionalData: Buffer,\n\t\tnonce: Buffer,\n\t\tkey: ArrayBufferLike,\n\t): Buffer;\n}\n\nconst libs = {\n\t'sodium-native': (sodium: any): Methods => ({\n\t\tcrypto_aead_xchacha20poly1305_ietf_decrypt: (\n\t\t\tcipherText: Buffer,\n\t\t\tadditionalData: Buffer,\n\t\t\tnonce: Buffer,\n\t\t\tkey: ArrayBufferLike,\n\t\t) => {\n\t\t\tconst message = Buffer.alloc(cipherText.length - sodium.crypto_aead_xchacha20poly1305_ietf_ABYTES);\n\t\t\tsodium.crypto_aead_xchacha20poly1305_ietf_decrypt(message, null, cipherText, additionalData, nonce, key);\n\t\t\treturn message;\n\t\t},\n\t\tcrypto_aead_xchacha20poly1305_ietf_encrypt: (\n\t\t\tplaintext: Buffer,\n\t\t\tadditionalData: Buffer,\n\t\t\tnonce: Buffer,\n\t\t\tkey: ArrayBufferLike,\n\t\t) => {\n\t\t\tconst cipherText = Buffer.alloc(plaintext.length + sodium.crypto_aead_xchacha20poly1305_ietf_ABYTES);\n\t\t\tsodium.crypto_aead_xchacha20poly1305_ietf_encrypt(cipherText, plaintext, additionalData, null, nonce, key);\n\t\t\treturn cipherText;\n\t\t},\n\t}),\n\tsodium: (sodium: any): Methods => ({\n\t\tcrypto_aead_xchacha20poly1305_ietf_decrypt: (\n\t\t\tcipherText: Buffer,\n\t\t\tadditionalData: Buffer,\n\t\t\tnonce: Buffer,\n\t\t\tkey: ArrayBufferLike,\n\t\t) => sodium.api.crypto_aead_xchacha20poly1305_ietf_decrypt(cipherText, additionalData, null, nonce, key),\n\t\tcrypto_aead_xchacha20poly1305_ietf_encrypt: (\n\t\t\tplaintext: Buffer,\n\t\t\tadditionalData: Buffer,\n\t\t\tnonce: Buffer,\n\t\t\tkey: ArrayBufferLike,\n\t\t) => sodium.api.crypto_aead_xchacha20poly1305_ietf_encrypt(plaintext, additionalData, null, nonce, key),\n\t}),\n\t'libsodium-wrappers': (sodium: any): Methods => ({\n\t\tcrypto_aead_xchacha20poly1305_ietf_decrypt: (\n\t\t\tcipherText: Buffer,\n\t\t\tadditionalData: Buffer,\n\t\t\tnonce: Buffer,\n\t\t\tkey: ArrayBufferLike,\n\t\t) => sodium.crypto_aead_xchacha20poly1305_ietf_decrypt(null, cipherText, additionalData, nonce, key),\n\t\tcrypto_aead_xchacha20poly1305_ietf_encrypt: (\n\t\t\tplaintext: Buffer,\n\t\t\tadditionalData: Buffer,\n\t\t\tnonce: Buffer,\n\t\t\tkey: ArrayBufferLike,\n\t\t) => sodium.crypto_aead_xchacha20poly1305_ietf_encrypt(plaintext, additionalData, null, nonce, key),\n\t}),\n\t'@stablelib/xchacha20poly1305': (stablelib: any): Methods => ({\n\t\tcrypto_aead_xchacha20poly1305_ietf_decrypt(plaintext, additionalData, nonce, key) {\n\t\t\tconst crypto = new stablelib.XChaCha20Poly1305(key);\n\t\t\treturn crypto.open(nonce, plaintext, additionalData);\n\t\t},\n\t\tcrypto_aead_xchacha20poly1305_ietf_encrypt(cipherText, additionalData, nonce, key) {\n\t\t\tconst crypto = new stablelib.XChaCha20Poly1305(key);\n\t\t\treturn crypto.seal(nonce, cipherText, additionalData);\n\t\t},\n\t}),\n\t'@noble/ciphers/chacha': (noble: any): Methods => ({\n\t\tcrypto_aead_xchacha20poly1305_ietf_decrypt(cipherText, additionalData, nonce, key) {\n\t\t\tconst chacha = noble.xchacha20poly1305(key, nonce, additionalData);\n\t\t\treturn chacha.decrypt(cipherText);\n\t\t},\n\t\tcrypto_aead_xchacha20poly1305_ietf_encrypt(plaintext, additionalData, nonce, key) {\n\t\t\tconst chacha = noble.xchacha20poly1305(key, nonce, additionalData);\n\t\t\treturn chacha.encrypt(plaintext);\n\t\t},\n\t}),\n} as const;\n\nconst fallbackError = () => {\n\tthrow new Error(\n\t\t`Cannot play audio as no valid encryption package is installed.\n- Install one of:\n - sodium\n - libsodium-wrappers\n - @stablelib/xchacha20poly1305\n - @noble/ciphers.\n- Use the generateDependencyReport() function for more information.\\n`,\n\t);\n};\n\nconst methods: Methods = {\n\tcrypto_aead_xchacha20poly1305_ietf_encrypt: fallbackError,\n\tcrypto_aead_xchacha20poly1305_ietf_decrypt: fallbackError,\n};\n\n// eslint-disable-next-line no-async-promise-executor\nexport const secretboxLoadPromise = new Promise(async (resolve) => {\n\tfor (const libName of Object.keys(libs) as (keyof typeof libs)[]) {\n\t\ttry {\n\t\t\tconst lib = await import(libName);\n\n\t\t\tif (libName === 'libsodium-wrappers' && lib.ready) {\n\t\t\t\tawait lib.ready;\n\t\t\t}\n\n\t\t\tObject.assign(methods, libs[libName](lib));\n\n\t\t\tbreak;\n\t\t} catch {}\n\t}\n\n\tresolve();\n});\n\nexport { methods };\n","export const noop = () => {};\n","import { Buffer } from 'node:buffer';\nimport { EventEmitter } from 'node:events';\nimport type { VoiceDavePrepareEpochData, VoiceDavePrepareTransitionData } from 'discord-api-types/voice/v8';\nimport { SILENCE_FRAME } from '../audio/AudioPlayer';\n\ninterface SessionMethods {\n\tcanPassthrough(userId: string): boolean;\n\tdecrypt(userId: string, mediaType: 0 | 1, packet: Buffer): Buffer;\n\tencryptOpus(packet: Buffer): Buffer;\n\tgetSerializedKeyPackage(): Buffer;\n\tgetVerificationCode(userId: string): Promise;\n\tprocessCommit(commit: Buffer): void;\n\tprocessProposals(optype: 0 | 1, proposals: Buffer, recognizedUserIds?: string[]): ProposalsResult;\n\tprocessWelcome(welcome: Buffer): void;\n\tready: boolean;\n\treinit(protocolVersion: number, userId: string, channelId: string): void;\n\treset(): void;\n\tsetExternalSender(externalSender: Buffer): void;\n\tsetPassthroughMode(passthrough: boolean, expiry: number): void;\n\tvoicePrivacyCode: string;\n}\n\ninterface ProposalsResult {\n\tcommit?: Buffer;\n\twelcome?: Buffer;\n}\n\nlet Davey: any = null;\n\n/**\n * The amount of seconds that a previous transition should be valid for.\n */\nconst TRANSITION_EXPIRY = 10;\n\n/**\n * The arbitrary amount of seconds to allow passthrough for mid-downgrade.\n * Generally, transitions last about 3 seconds maximum, but this should cover for when connections are delayed.\n */\nconst TRANSITION_EXPIRY_PENDING_DOWNGRADE = 24;\n\n/**\n * The amount of packets to allow decryption failure for until we deem the transition bad and re-initialize.\n * Usually 4 packets on a good connection may slip past when entering a new session.\n * After re-initializing, 5-24 packets may fail to decrypt after.\n */\nexport const DEFAULT_DECRYPTION_FAILURE_TOLERANCE = 36;\n\n// eslint-disable-next-line no-async-promise-executor\nexport const daveLoadPromise = new Promise(async (resolve) => {\n\ttry {\n\t\tconst lib = await import('@snazzah/davey');\n\t\tDavey = lib;\n\t} catch {}\n\n\tresolve();\n});\n\ninterface TransitionResult {\n\tsuccess: boolean;\n\ttransitionId: number;\n}\n/**\n * Options that dictate the session behavior.\n */\nexport interface DAVESessionOptions {\n\tdecryptionFailureTolerance?: number | undefined;\n}\n\n/**\n * The maximum DAVE protocol version supported.\n */\nexport function getMaxProtocolVersion(): number | null {\n\treturn Davey?.DAVE_PROTOCOL_VERSION;\n}\n\nexport interface DAVESession extends EventEmitter {\n\ton(event: 'error', listener: (error: Error) => void): this;\n\ton(event: 'debug', listener: (message: string) => void): this;\n\ton(event: 'keyPackage', listener: (message: Buffer) => void): this;\n\ton(event: 'invalidateTransition', listener: (transitionId: number) => void): this;\n}\n\n/**\n * Manages the DAVE protocol group session.\n */\nexport class DAVESession extends EventEmitter {\n\t/**\n\t * The channel id represented by this session.\n\t */\n\tpublic channelId: string;\n\n\t/**\n\t * The user id represented by this session.\n\t */\n\tpublic userId: string;\n\n\t/**\n\t * The protocol version being used.\n\t */\n\tpublic protocolVersion: number;\n\n\t/**\n\t * The last transition id executed.\n\t */\n\tpublic lastTransitionId?: number | undefined;\n\n\t/**\n\t * The pending transition.\n\t */\n\tprivate pendingTransition?: VoiceDavePrepareTransitionData | undefined;\n\n\t/**\n\t * Whether this session was downgraded previously.\n\t */\n\tprivate downgraded = false;\n\n\t/**\n\t * The amount of consecutive failures encountered when decrypting.\n\t */\n\tprivate consecutiveFailures = 0;\n\n\t/**\n\t * The amount of consecutive failures needed to attempt to recover.\n\t */\n\tprivate readonly failureTolerance: number;\n\n\t/**\n\t * Whether this session is currently re-initializing due to an invalid transition.\n\t */\n\tpublic reinitializing = false;\n\n\t/**\n\t * The underlying DAVE Session of this wrapper.\n\t */\n\tpublic session: SessionMethods | undefined;\n\n\tpublic constructor(protocolVersion: number, userId: string, channelId: string, options: DAVESessionOptions) {\n\t\tif (Davey === null)\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot utilize the DAVE protocol as the @snazzah/davey package has not been installed.\n- Use the generateDependencyReport() function for more information.\\n`,\n\t\t\t);\n\n\t\tsuper();\n\n\t\tthis.protocolVersion = protocolVersion;\n\t\tthis.userId = userId;\n\t\tthis.channelId = channelId;\n\t\tthis.failureTolerance = options.decryptionFailureTolerance ?? DEFAULT_DECRYPTION_FAILURE_TOLERANCE;\n\t}\n\n\t/**\n\t * The current voice privacy code of the session. Will be `null` if there is no session.\n\t */\n\tpublic get voicePrivacyCode(): string | null {\n\t\tif (this.protocolVersion === 0 || !this.session?.voicePrivacyCode) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.session.voicePrivacyCode;\n\t}\n\n\t/**\n\t * Gets the verification code for a user in the session.\n\t *\n\t * @throws Will throw if there is not an active session or the user id provided is invalid or not in the session.\n\t */\n\tpublic async getVerificationCode(userId: string): Promise {\n\t\tif (!this.session) throw new Error('Session not available');\n\t\treturn this.session.getVerificationCode(userId);\n\t}\n\n\t/**\n\t * Re-initializes (or initializes) the underlying session.\n\t */\n\tpublic reinit() {\n\t\tif (this.protocolVersion > 0) {\n\t\t\tif (this.session) {\n\t\t\t\tthis.session.reinit(this.protocolVersion, this.userId, this.channelId);\n\t\t\t\tthis.emit('debug', `Session reinitialized for protocol version ${this.protocolVersion}`);\n\t\t\t} else {\n\t\t\t\tthis.session = new Davey.DAVESession(this.protocolVersion, this.userId, this.channelId);\n\t\t\t\tthis.emit('debug', `Session initialized for protocol version ${this.protocolVersion}`);\n\t\t\t}\n\n\t\t\tthis.emit('keyPackage', this.session!.getSerializedKeyPackage());\n\t\t} else if (this.session) {\n\t\t\tthis.session.reset();\n\t\t\tthis.session.setPassthroughMode(true, TRANSITION_EXPIRY);\n\t\t\tthis.emit('debug', 'Session reset');\n\t\t}\n\t}\n\n\t/**\n\t * Set the external sender for this session.\n\t *\n\t * @param externalSender - The external sender\n\t */\n\tpublic setExternalSender(externalSender: Buffer) {\n\t\tif (!this.session) throw new Error('No session available');\n\t\tthis.session.setExternalSender(externalSender);\n\t\tthis.emit('debug', 'Set MLS external sender');\n\t}\n\n\t/**\n\t * Prepare for a transition.\n\t *\n\t * @param data - The transition data\n\t * @returns Whether we should signal to the voice server that we are ready\n\t */\n\tpublic prepareTransition(data: VoiceDavePrepareTransitionData) {\n\t\tthis.emit('debug', `Preparing for transition (${data.transition_id}, v${data.protocol_version})`);\n\t\tthis.pendingTransition = data;\n\n\t\t// When the included transition id is 0, the transition is for (re)initialization and it can be executed immediately.\n\t\tif (data.transition_id === 0) {\n\t\t\tthis.executeTransition(data.transition_id);\n\t\t} else {\n\t\t\tif (data.protocol_version === 0) this.session?.setPassthroughMode(true, TRANSITION_EXPIRY_PENDING_DOWNGRADE);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Execute a transition.\n\t *\n\t * @param transitionId - The transition id to execute on\n\t */\n\tpublic executeTransition(transitionId: number) {\n\t\tthis.emit('debug', `Executing transition (${transitionId})`);\n\t\tif (!this.pendingTransition) {\n\t\t\tthis.emit('debug', `Received execute transition, but we don't have a pending transition for ${transitionId}`);\n\t\t\treturn;\n\t\t}\n\n\t\tlet transitioned = false;\n\t\tif (transitionId === this.pendingTransition.transition_id) {\n\t\t\tconst oldVersion = this.protocolVersion;\n\t\t\tthis.protocolVersion = this.pendingTransition.protocol_version;\n\n\t\t\t// Handle upgrades & defer downgrades\n\t\t\tif (oldVersion !== this.protocolVersion && this.protocolVersion === 0) {\n\t\t\t\tthis.downgraded = true;\n\t\t\t\tthis.emit('debug', 'Session downgraded');\n\t\t\t} else if (transitionId > 0 && this.downgraded) {\n\t\t\t\tthis.downgraded = false;\n\t\t\t\tthis.session?.setPassthroughMode(true, TRANSITION_EXPIRY);\n\t\t\t\tthis.emit('debug', 'Session upgraded');\n\t\t\t}\n\n\t\t\t// In the future we'd want to signal to the DAVESession to transition also, but it only supports v1 at this time\n\t\t\ttransitioned = true;\n\t\t\tthis.reinitializing = false;\n\t\t\tthis.lastTransitionId = transitionId;\n\t\t\tthis.emit('debug', `Transition executed (v${oldVersion} -> v${this.protocolVersion}, id: ${transitionId})`);\n\t\t} else {\n\t\t\tthis.emit(\n\t\t\t\t'debug',\n\t\t\t\t`Received execute transition for an unexpected transition id (expected: ${this.pendingTransition.transition_id}, actual: ${transitionId})`,\n\t\t\t);\n\t\t}\n\n\t\tthis.pendingTransition = undefined;\n\t\treturn transitioned;\n\t}\n\n\t/**\n\t * Prepare for a new epoch.\n\t *\n\t * @param data - The epoch data\n\t */\n\tpublic prepareEpoch(data: VoiceDavePrepareEpochData) {\n\t\tthis.emit('debug', `Preparing for epoch (${data.epoch})`);\n\t\tif (data.epoch === 1) {\n\t\t\tthis.protocolVersion = data.protocol_version;\n\t\t\tthis.reinit();\n\t\t}\n\t}\n\n\t/**\n\t * Recover from an invalid transition by re-initializing.\n\t *\n\t * @param transitionId - The transition id to invalidate\n\t */\n\tpublic recoverFromInvalidTransition(transitionId: number) {\n\t\tif (this.reinitializing) return;\n\t\tthis.emit('debug', `Invalidating transition ${transitionId}`);\n\t\tthis.reinitializing = true;\n\t\tthis.consecutiveFailures = 0;\n\t\tthis.emit('invalidateTransition', transitionId);\n\t\tthis.reinit();\n\t}\n\n\t/**\n\t * Processes proposals from the MLS group.\n\t *\n\t * @param payload - The binary message payload\n\t * @param connectedClients - The set of connected client IDs\n\t * @returns The payload to send back to the voice server, if there is one\n\t */\n\tpublic processProposals(payload: Buffer, connectedClients: Set): Buffer | undefined {\n\t\tif (!this.session) throw new Error('No session available');\n\t\tconst optype = payload.readUInt8(0) as 0 | 1;\n\t\tconst { commit, welcome } = this.session.processProposals(\n\t\t\toptype,\n\t\t\tpayload.subarray(1),\n\t\t\tArray.from(connectedClients),\n\t\t);\n\t\tthis.emit('debug', 'MLS proposals processed');\n\t\tif (!commit) return;\n\t\treturn welcome ? Buffer.concat([commit, welcome]) : commit;\n\t}\n\n\t/**\n\t * Processes a commit from the MLS group.\n\t *\n\t * @param payload - The payload\n\t * @returns The transaction id and whether it was successful\n\t */\n\tpublic processCommit(payload: Buffer): TransitionResult {\n\t\tif (!this.session) throw new Error('No session available');\n\t\tconst transitionId = payload.readUInt16BE(0);\n\t\ttry {\n\t\t\tthis.session.processCommit(payload.subarray(2));\n\t\t\tif (transitionId === 0) {\n\t\t\t\tthis.reinitializing = false;\n\t\t\t\tthis.lastTransitionId = transitionId;\n\t\t\t} else {\n\t\t\t\tthis.pendingTransition = { transition_id: transitionId, protocol_version: this.protocolVersion };\n\t\t\t}\n\n\t\t\tthis.emit('debug', `MLS commit processed (transition id: ${transitionId})`);\n\t\t\treturn { transitionId, success: true };\n\t\t} catch (error) {\n\t\t\tthis.emit('debug', `MLS commit errored from transition ${transitionId}: ${error}`);\n\t\t\tthis.recoverFromInvalidTransition(transitionId);\n\t\t\treturn { transitionId, success: false };\n\t\t}\n\t}\n\n\t/**\n\t * Processes a welcome from the MLS group.\n\t *\n\t * @param payload - The payload\n\t * @returns The transaction id and whether it was successful\n\t */\n\tpublic processWelcome(payload: Buffer): TransitionResult {\n\t\tif (!this.session) throw new Error('No session available');\n\t\tconst transitionId = payload.readUInt16BE(0);\n\t\ttry {\n\t\t\tthis.session.processWelcome(payload.subarray(2));\n\t\t\tif (transitionId === 0) {\n\t\t\t\tthis.reinitializing = false;\n\t\t\t\tthis.lastTransitionId = transitionId;\n\t\t\t} else {\n\t\t\t\tthis.pendingTransition = { transition_id: transitionId, protocol_version: this.protocolVersion };\n\t\t\t}\n\n\t\t\tthis.emit('debug', `MLS welcome processed (transition id: ${transitionId})`);\n\t\t\treturn { transitionId, success: true };\n\t\t} catch (error) {\n\t\t\tthis.emit('debug', `MLS welcome errored from transition ${transitionId}: ${error}`);\n\t\t\tthis.recoverFromInvalidTransition(transitionId);\n\t\t\treturn { transitionId, success: false };\n\t\t}\n\t}\n\n\t/**\n\t * Encrypt a packet using end-to-end encryption.\n\t *\n\t * @param packet - The packet to encrypt\n\t */\n\tpublic encrypt(packet: Buffer) {\n\t\tif (this.protocolVersion === 0 || !this.session?.ready || packet.equals(SILENCE_FRAME)) return packet;\n\t\treturn this.session.encryptOpus(packet);\n\t}\n\n\t/**\n\t * Decrypt a packet using end-to-end encryption.\n\t *\n\t * @param packet - The packet to decrypt\n\t * @param userId - The user id that sent the packet\n\t * @returns The decrypted packet, or `null` if the decryption failed but should be ignored\n\t */\n\tpublic decrypt(packet: Buffer, userId: string) {\n\t\tconst canDecrypt = this.session?.ready && (this.protocolVersion !== 0 || this.session?.canPassthrough(userId));\n\t\tif (packet.equals(SILENCE_FRAME) || !canDecrypt || !this.session) return packet;\n\t\ttry {\n\t\t\tconst buffer = this.session.decrypt(userId, Davey.MediaType.AUDIO, packet);\n\t\t\tthis.consecutiveFailures = 0;\n\t\t\treturn buffer;\n\t\t} catch (error) {\n\t\t\tif (!this.reinitializing && !this.pendingTransition) {\n\t\t\t\tthis.consecutiveFailures++;\n\t\t\t\tthis.emit('debug', `Failed to decrypt a packet (${this.consecutiveFailures} consecutive fails)`);\n\t\t\t\tif (this.consecutiveFailures > this.failureTolerance) {\n\t\t\t\t\tif (this.lastTransitionId) this.recoverFromInvalidTransition(this.lastTransitionId);\n\t\t\t\t\telse throw error;\n\t\t\t\t}\n\t\t\t} else if (this.reinitializing) {\n\t\t\t\tthis.emit('debug', 'Failed to decrypt a packet (reinitializing session)');\n\t\t\t} else if (this.pendingTransition) {\n\t\t\t\tthis.emit(\n\t\t\t\t\t'debug',\n\t\t\t\t\t`Failed to decrypt a packet (pending transition ${this.pendingTransition.transition_id} to v${this.pendingTransition.protocol_version})`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Resets the session.\n\t */\n\tpublic destroy() {\n\t\ttry {\n\t\t\tthis.session?.reset();\n\t\t} catch {}\n\t}\n}\n","/* eslint-disable @typescript-eslint/prefer-ts-expect-error, @typescript-eslint/method-signature-style */\nimport { Buffer } from 'node:buffer';\nimport { EventEmitter } from 'node:events';\nimport { addAudioPlayer, deleteAudioPlayer } from '../DataStore';\nimport { VoiceConnectionStatus, type VoiceConnection } from '../VoiceConnection';\nimport { noop } from '../util/util';\nimport { AudioPlayerError } from './AudioPlayerError';\nimport type { AudioResource } from './AudioResource';\nimport { PlayerSubscription } from './PlayerSubscription';\n\n// The Opus \"silent\" frame\nexport const SILENCE_FRAME = Buffer.from([0xf8, 0xff, 0xfe]);\n\n/**\n * Describes the behavior of the player when an audio packet is played but there are no available\n * voice connections to play to.\n */\nexport enum NoSubscriberBehavior {\n\t/**\n\t * Pauses playing the stream until a voice connection becomes available.\n\t */\n\tPause = 'pause',\n\n\t/**\n\t * Continues to play through the resource regardless.\n\t */\n\tPlay = 'play',\n\n\t/**\n\t * The player stops and enters the Idle state.\n\t */\n\tStop = 'stop',\n}\n\nexport enum AudioPlayerStatus {\n\t/**\n\t * When the player has paused itself. Only possible with the \"pause\" no subscriber behavior.\n\t */\n\tAutoPaused = 'autopaused',\n\n\t/**\n\t * When the player is waiting for an audio resource to become readable before transitioning to Playing.\n\t */\n\tBuffering = 'buffering',\n\n\t/**\n\t * When there is currently no resource for the player to be playing.\n\t */\n\tIdle = 'idle',\n\n\t/**\n\t * When the player has been manually paused.\n\t */\n\tPaused = 'paused',\n\n\t/**\n\t * When the player is actively playing an audio resource.\n\t */\n\tPlaying = 'playing',\n}\n\n/**\n * Options that can be passed when creating an audio player, used to specify its behavior.\n */\nexport interface CreateAudioPlayerOptions {\n\tbehaviors?: {\n\t\tmaxMissedFrames?: number;\n\t\tnoSubscriber?: NoSubscriberBehavior;\n\t};\n\tdebug?: boolean;\n}\n\n/**\n * The state that an AudioPlayer is in when it has no resource to play. This is the starting state.\n */\nexport interface AudioPlayerIdleState {\n\tstatus: AudioPlayerStatus.Idle;\n}\n\n/**\n * The state that an AudioPlayer is in when it is waiting for a resource to become readable. Once this\n * happens, the AudioPlayer will enter the Playing state. If the resource ends/errors before this, then\n * it will re-enter the Idle state.\n */\nexport interface AudioPlayerBufferingState {\n\tonFailureCallback: () => void;\n\tonReadableCallback: () => void;\n\tonStreamError: (error: Error) => void;\n\t/**\n\t * The resource that the AudioPlayer is waiting for\n\t */\n\tresource: AudioResource;\n\tstatus: AudioPlayerStatus.Buffering;\n}\n\n/**\n * The state that an AudioPlayer is in when it is actively playing an AudioResource. When playback ends,\n * it will enter the Idle state.\n */\nexport interface AudioPlayerPlayingState {\n\t/**\n\t * The number of consecutive times that the audio resource has been unable to provide an Opus frame.\n\t */\n\tmissedFrames: number;\n\tonStreamError: (error: Error) => void;\n\n\t/**\n\t * The playback duration in milliseconds of the current audio resource. This includes filler silence packets\n\t * that have been played when the resource was buffering.\n\t */\n\tplaybackDuration: number;\n\n\t/**\n\t * The resource that is being played.\n\t */\n\tresource: AudioResource;\n\n\tstatus: AudioPlayerStatus.Playing;\n}\n\n/**\n * The state that an AudioPlayer is in when it has either been explicitly paused by the user, or done\n * automatically by the AudioPlayer itself if there are no available subscribers.\n */\nexport interface AudioPlayerPausedState {\n\tonStreamError: (error: Error) => void;\n\t/**\n\t * The playback duration in milliseconds of the current audio resource. This includes filler silence packets\n\t * that have been played when the resource was buffering.\n\t */\n\tplaybackDuration: number;\n\n\t/**\n\t * The current resource of the audio player.\n\t */\n\tresource: AudioResource;\n\n\t/**\n\t * How many silence packets still need to be played to avoid audio interpolation due to the stream suddenly pausing.\n\t */\n\tsilencePacketsRemaining: number;\n\n\tstatus: AudioPlayerStatus.AutoPaused | AudioPlayerStatus.Paused;\n}\n\n/**\n * The various states that the player can be in.\n */\nexport type AudioPlayerState =\n\t| AudioPlayerBufferingState\n\t| AudioPlayerIdleState\n\t| AudioPlayerPausedState\n\t| AudioPlayerPlayingState;\n\nexport interface AudioPlayer extends EventEmitter {\n\t/**\n\t * Emitted when there is an error emitted from the audio resource played by the audio player\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'error', listener: (error: AudioPlayerError) => void): this;\n\t/**\n\t * Emitted debugging information about the audio player\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'debug', listener: (message: string) => void): this;\n\t/**\n\t * Emitted when the state of the audio player changes\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'stateChange', listener: (oldState: AudioPlayerState, newState: AudioPlayerState) => void): this;\n\t/**\n\t * Emitted when the audio player is subscribed to a voice connection\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'subscribe' | 'unsubscribe', listener: (subscription: PlayerSubscription) => void): this;\n\t/**\n\t * Emitted when the status of state changes to a specific status\n\t *\n\t * @eventProperty\n\t */\n\ton(\n\t\tevent: Event,\n\t\tlistener: (oldState: AudioPlayerState, newState: AudioPlayerState & { status: Event }) => void,\n\t): this;\n}\n\n/**\n * Stringifies an AudioPlayerState instance.\n *\n * @param state - The state to stringify\n */\nfunction stringifyState(state: AudioPlayerState) {\n\treturn JSON.stringify({\n\t\t...state,\n\t\tresource: Reflect.has(state, 'resource'),\n\t\tstepTimeout: Reflect.has(state, 'stepTimeout'),\n\t});\n}\n\n/**\n * Used to play audio resources (i.e. tracks, streams) to voice connections.\n *\n * @remarks\n * Audio players are designed to be re-used - even if a resource has finished playing, the player itself\n * can still be used.\n *\n * The AudioPlayer drives the timing of playback, and therefore is unaffected by voice connections\n * becoming unavailable. Its behavior in these scenarios can be configured.\n */\nexport class AudioPlayer extends EventEmitter {\n\t/**\n\t * The state that the AudioPlayer is in.\n\t */\n\tprivate _state: AudioPlayerState;\n\n\t/**\n\t * A list of VoiceConnections that are registered to this AudioPlayer. The player will attempt to play audio\n\t * to the streams in this list.\n\t */\n\tprivate readonly subscribers: PlayerSubscription[] = [];\n\n\t/**\n\t * The behavior that the player should follow when it enters certain situations.\n\t */\n\tprivate readonly behaviors: {\n\t\tmaxMissedFrames: number;\n\t\tnoSubscriber: NoSubscriberBehavior;\n\t};\n\n\t/**\n\t * The debug logger function, if debugging is enabled.\n\t */\n\tprivate readonly debug: ((message: string) => void) | null;\n\n\t/**\n\t * Creates a new AudioPlayer.\n\t */\n\tpublic constructor(options: CreateAudioPlayerOptions = {}) {\n\t\tsuper();\n\t\tthis._state = { status: AudioPlayerStatus.Idle };\n\t\tthis.behaviors = {\n\t\t\tnoSubscriber: NoSubscriberBehavior.Pause,\n\t\t\tmaxMissedFrames: 5,\n\t\t\t...options.behaviors,\n\t\t};\n\t\tthis.debug = options.debug === false ? null : (message: string) => this.emit('debug', message);\n\t}\n\n\t/**\n\t * A list of subscribed voice connections that can currently receive audio to play.\n\t */\n\tpublic get playable() {\n\t\treturn this.subscribers\n\t\t\t.filter(({ connection }) => connection.state.status === VoiceConnectionStatus.Ready)\n\t\t\t.map(({ connection }) => connection);\n\t}\n\n\t/**\n\t * Subscribes a VoiceConnection to the audio player's play list. If the VoiceConnection is already subscribed,\n\t * then the existing subscription is used.\n\t *\n\t * @remarks\n\t * This method should not be directly called. Instead, use VoiceConnection#subscribe.\n\t * @param connection - The connection to subscribe\n\t * @returns The new subscription if the voice connection is not yet subscribed, otherwise the existing subscription\n\t */\n\t// @ts-ignore\n\tprivate subscribe(connection: VoiceConnection) {\n\t\tconst existingSubscription = this.subscribers.find((subscription) => subscription.connection === connection);\n\t\tif (!existingSubscription) {\n\t\t\tconst subscription = new PlayerSubscription(connection, this);\n\t\t\tthis.subscribers.push(subscription);\n\t\t\tsetImmediate(() => this.emit('subscribe', subscription));\n\t\t\treturn subscription;\n\t\t}\n\n\t\treturn existingSubscription;\n\t}\n\n\t/**\n\t * Unsubscribes a subscription - i.e. removes a voice connection from the play list of the audio player.\n\t *\n\t * @remarks\n\t * This method should not be directly called. Instead, use PlayerSubscription#unsubscribe.\n\t * @param subscription - The subscription to remove\n\t * @returns Whether or not the subscription existed on the player and was removed\n\t */\n\t// @ts-ignore\n\tprivate unsubscribe(subscription: PlayerSubscription) {\n\t\tconst index = this.subscribers.indexOf(subscription);\n\t\tconst exists = index !== -1;\n\t\tif (exists) {\n\t\t\tthis.subscribers.splice(index, 1);\n\t\t\tsubscription.connection.setSpeaking(false);\n\t\t\tthis.emit('unsubscribe', subscription);\n\t\t}\n\n\t\treturn exists;\n\t}\n\n\t/**\n\t * The state that the player is in.\n\t *\n\t * @remarks\n\t * The setter will perform clean-up operations where necessary.\n\t */\n\tpublic get state() {\n\t\treturn this._state;\n\t}\n\n\tpublic set state(newState: AudioPlayerState) {\n\t\tconst oldState = this._state;\n\t\tconst newResource = Reflect.get(newState, 'resource') as AudioResource | undefined;\n\n\t\tif (oldState.status !== AudioPlayerStatus.Idle && oldState.resource !== newResource) {\n\t\t\toldState.resource.playStream.on('error', noop);\n\t\t\toldState.resource.playStream.off('error', oldState.onStreamError);\n\t\t\toldState.resource.audioPlayer = undefined;\n\t\t\toldState.resource.playStream.destroy();\n\t\t\toldState.resource.playStream.read(); // required to ensure buffered data is drained, prevents memory leak\n\t\t}\n\n\t\t// When leaving the Buffering state (or buffering a new resource), then remove the event listeners from it\n\t\tif (\n\t\t\toldState.status === AudioPlayerStatus.Buffering &&\n\t\t\t(newState.status !== AudioPlayerStatus.Buffering || newState.resource !== oldState.resource)\n\t\t) {\n\t\t\toldState.resource.playStream.off('end', oldState.onFailureCallback);\n\t\t\toldState.resource.playStream.off('close', oldState.onFailureCallback);\n\t\t\toldState.resource.playStream.off('finish', oldState.onFailureCallback);\n\t\t\toldState.resource.playStream.off('readable', oldState.onReadableCallback);\n\t\t}\n\n\t\t// transitioning into an idle should ensure that connections stop speaking\n\t\tif (newState.status === AudioPlayerStatus.Idle) {\n\t\t\tthis._signalStopSpeaking();\n\t\t\tdeleteAudioPlayer(this);\n\t\t}\n\n\t\t// attach to the global audio player timer\n\t\tif (newResource) {\n\t\t\taddAudioPlayer(this);\n\t\t}\n\n\t\t// playing -> playing state changes should still transition if a resource changed (seems like it would be useful!)\n\t\tconst didChangeResources =\n\t\t\toldState.status !== AudioPlayerStatus.Idle &&\n\t\t\tnewState.status === AudioPlayerStatus.Playing &&\n\t\t\toldState.resource !== newState.resource;\n\n\t\tthis._state = newState;\n\n\t\tthis.emit('stateChange', oldState, this._state);\n\t\tif (oldState.status !== newState.status || didChangeResources) {\n\t\t\tthis.emit(newState.status, oldState, this._state as any);\n\t\t}\n\n\t\tthis.debug?.(`state change:\\nfrom ${stringifyState(oldState)}\\nto ${stringifyState(newState)}`);\n\t}\n\n\t/**\n\t * Plays a new resource on the player. If the player is already playing a resource, the existing resource is destroyed\n\t * (it cannot be reused, even in another player) and is replaced with the new resource.\n\t *\n\t * @remarks\n\t * The player will transition to the Playing state once playback begins, and will return to the Idle state once\n\t * playback is ended.\n\t *\n\t * If the player was previously playing a resource and this method is called, the player will not transition to the\n\t * Idle state during the swap over.\n\t * @param resource - The resource to play\n\t * @throws Will throw if attempting to play an audio resource that has already ended, or is being played by another player\n\t */\n\tpublic play(resource: AudioResource) {\n\t\tif (resource.ended) {\n\t\t\tthrow new Error('Cannot play a resource that has already ended.');\n\t\t}\n\n\t\tif (resource.audioPlayer) {\n\t\t\tif (resource.audioPlayer === this) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthrow new Error('Resource is already being played by another audio player.');\n\t\t}\n\n\t\tresource.audioPlayer = this;\n\n\t\t// Attach error listeners to the stream that will propagate the error and then return to the Idle\n\t\t// state if the resource is still being used.\n\t\tconst onStreamError = (error: Error) => {\n\t\t\tif (this.state.status !== AudioPlayerStatus.Idle) {\n\t\t\t\tthis.emit('error', new AudioPlayerError(error, this.state.resource));\n\t\t\t}\n\n\t\t\tif (this.state.status !== AudioPlayerStatus.Idle && this.state.resource === resource) {\n\t\t\t\tthis.state = {\n\t\t\t\t\tstatus: AudioPlayerStatus.Idle,\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\n\t\tresource.playStream.once('error', onStreamError);\n\n\t\tif (resource.started) {\n\t\t\tthis.state = {\n\t\t\t\tstatus: AudioPlayerStatus.Playing,\n\t\t\t\tmissedFrames: 0,\n\t\t\t\tplaybackDuration: 0,\n\t\t\t\tresource,\n\t\t\t\tonStreamError,\n\t\t\t};\n\t\t} else {\n\t\t\tconst onReadableCallback = () => {\n\t\t\t\tif (this.state.status === AudioPlayerStatus.Buffering && this.state.resource === resource) {\n\t\t\t\t\tthis.state = {\n\t\t\t\t\t\tstatus: AudioPlayerStatus.Playing,\n\t\t\t\t\t\tmissedFrames: 0,\n\t\t\t\t\t\tplaybackDuration: 0,\n\t\t\t\t\t\tresource,\n\t\t\t\t\t\tonStreamError,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst onFailureCallback = () => {\n\t\t\t\tif (this.state.status === AudioPlayerStatus.Buffering && this.state.resource === resource) {\n\t\t\t\t\tthis.state = {\n\t\t\t\t\t\tstatus: AudioPlayerStatus.Idle,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tresource.playStream.once('readable', onReadableCallback);\n\n\t\t\tresource.playStream.once('end', onFailureCallback);\n\t\t\tresource.playStream.once('close', onFailureCallback);\n\t\t\tresource.playStream.once('finish', onFailureCallback);\n\n\t\t\tthis.state = {\n\t\t\t\tstatus: AudioPlayerStatus.Buffering,\n\t\t\t\tresource,\n\t\t\t\tonReadableCallback,\n\t\t\t\tonFailureCallback,\n\t\t\t\tonStreamError,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Pauses playback of the current resource, if any.\n\t *\n\t * @param interpolateSilence - If true, the player will play 5 packets of silence after pausing to prevent audio glitches\n\t * @returns `true` if the player was successfully paused, otherwise `false`\n\t */\n\tpublic pause(interpolateSilence = true) {\n\t\tif (this.state.status !== AudioPlayerStatus.Playing) return false;\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\tstatus: AudioPlayerStatus.Paused,\n\t\t\tsilencePacketsRemaining: interpolateSilence ? 5 : 0,\n\t\t};\n\t\treturn true;\n\t}\n\n\t/**\n\t * Unpauses playback of the current resource, if any.\n\t *\n\t * @returns `true` if the player was successfully unpaused, otherwise `false`\n\t */\n\tpublic unpause() {\n\t\tif (this.state.status !== AudioPlayerStatus.Paused) return false;\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\tstatus: AudioPlayerStatus.Playing,\n\t\t\tmissedFrames: 0,\n\t\t};\n\t\treturn true;\n\t}\n\n\t/**\n\t * Stops playback of the current resource and destroys the resource. The player will either transition to the Idle state,\n\t * or remain in its current state until the silence padding frames of the resource have been played.\n\t *\n\t * @param force - If true, will force the player to enter the Idle state even if the resource has silence padding frames\n\t * @returns `true` if the player will come to a stop, otherwise `false`\n\t */\n\tpublic stop(force = false) {\n\t\tif (this.state.status === AudioPlayerStatus.Idle) return false;\n\t\tif (force || this.state.resource.silencePaddingFrames === 0) {\n\t\t\tthis.state = {\n\t\t\t\tstatus: AudioPlayerStatus.Idle,\n\t\t\t};\n\t\t} else if (this.state.resource.silenceRemaining === -1) {\n\t\t\tthis.state.resource.silenceRemaining = this.state.resource.silencePaddingFrames;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks whether the underlying resource (if any) is playable (readable)\n\t *\n\t * @returns `true` if the resource is playable, otherwise `false`\n\t */\n\tpublic checkPlayable() {\n\t\tconst state = this._state;\n\t\tif (state.status === AudioPlayerStatus.Idle || state.status === AudioPlayerStatus.Buffering) return false;\n\n\t\t// If the stream has been destroyed or is no longer readable, then transition to the Idle state.\n\t\tif (!state.resource.readable) {\n\t\t\tthis.state = {\n\t\t\t\tstatus: AudioPlayerStatus.Idle,\n\t\t\t};\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Called roughly every 20ms by the global audio player timer. Dispatches any audio packets that are buffered\n\t * by the active connections of this audio player.\n\t */\n\t// @ts-ignore\n\tprivate _stepDispatch() {\n\t\tconst state = this._state;\n\n\t\t// Guard against the Idle state\n\t\tif (state.status === AudioPlayerStatus.Idle || state.status === AudioPlayerStatus.Buffering) return;\n\n\t\t// Dispatch any audio packets that were prepared in the previous cycle\n\t\tfor (const connection of this.playable) {\n\t\t\tconnection.dispatchAudio();\n\t\t}\n\t}\n\n\t/**\n\t * Called roughly every 20ms by the global audio player timer. Attempts to read an audio packet from the\n\t * underlying resource of the stream, and then has all the active connections of the audio player prepare it\n\t * (encrypt it, append header data) so that it is ready to play at the start of the next cycle.\n\t */\n\t// @ts-ignore\n\tprivate _stepPrepare() {\n\t\tconst state = this._state;\n\n\t\t// Guard against the Idle state\n\t\tif (state.status === AudioPlayerStatus.Idle || state.status === AudioPlayerStatus.Buffering) return;\n\n\t\t// List of connections that can receive the packet\n\t\tconst playable = this.playable;\n\n\t\t/* If the player was previously in the AutoPaused state, check to see whether there are newly available\n\t\t connections, allowing us to transition out of the AutoPaused state back into the Playing state */\n\t\tif (state.status === AudioPlayerStatus.AutoPaused && playable.length > 0) {\n\t\t\tthis.state = {\n\t\t\t\t...state,\n\t\t\t\tstatus: AudioPlayerStatus.Playing,\n\t\t\t\tmissedFrames: 0,\n\t\t\t};\n\t\t}\n\n\t\t/* If the player is (auto)paused, check to see whether silence packets should be played and\n\t\t set a timeout to begin the next cycle, ending the current cycle here. */\n\t\tif (state.status === AudioPlayerStatus.Paused || state.status === AudioPlayerStatus.AutoPaused) {\n\t\t\tif (state.silencePacketsRemaining > 0) {\n\t\t\t\tstate.silencePacketsRemaining--;\n\t\t\t\tthis._preparePacket(SILENCE_FRAME, playable, state);\n\t\t\t\tif (state.silencePacketsRemaining === 0) {\n\t\t\t\t\tthis._signalStopSpeaking();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are no available connections in this cycle, observe the configured \"no subscriber\" behavior.\n\t\tif (playable.length === 0) {\n\t\t\tif (this.behaviors.noSubscriber === NoSubscriberBehavior.Pause) {\n\t\t\t\tthis.state = {\n\t\t\t\t\t...state,\n\t\t\t\t\tstatus: AudioPlayerStatus.AutoPaused,\n\t\t\t\t\tsilencePacketsRemaining: 5,\n\t\t\t\t};\n\t\t\t\treturn;\n\t\t\t} else if (this.behaviors.noSubscriber === NoSubscriberBehavior.Stop) {\n\t\t\t\tthis.stop(true);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Attempt to read an Opus packet from the resource. If there isn't an available packet,\n\t\t * play a silence packet. If there are 5 consecutive cycles with failed reads, then the\n\t\t * playback will end.\n\t\t */\n\t\tconst packet: Buffer | null = state.resource.read();\n\n\t\tif (state.status === AudioPlayerStatus.Playing) {\n\t\t\tif (packet) {\n\t\t\t\tthis._preparePacket(packet, playable, state);\n\t\t\t\tstate.missedFrames = 0;\n\t\t\t} else {\n\t\t\t\tthis._preparePacket(SILENCE_FRAME, playable, state);\n\t\t\t\tstate.missedFrames++;\n\t\t\t\tif (state.missedFrames >= this.behaviors.maxMissedFrames) {\n\t\t\t\t\tthis.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Signals to all the subscribed connections that they should send a packet to Discord indicating\n\t * they are no longer speaking. Called once playback of a resource ends.\n\t */\n\tprivate _signalStopSpeaking() {\n\t\tfor (const { connection } of this.subscribers) {\n\t\t\tconnection.setSpeaking(false);\n\t\t}\n\t}\n\n\t/**\n\t * Instructs the given connections to each prepare this packet to be played at the start of the\n\t * next cycle.\n\t *\n\t * @param packet - The Opus packet to be prepared by each receiver\n\t * @param receivers - The connections that should play this packet\n\t */\n\tprivate _preparePacket(\n\t\tpacket: Buffer,\n\t\treceivers: VoiceConnection[],\n\t\tstate: AudioPlayerPausedState | AudioPlayerPlayingState,\n\t) {\n\t\tstate.playbackDuration += 20;\n\t\tfor (const connection of receivers) {\n\t\t\tconnection.prepareAudioPacket(packet);\n\t\t}\n\t}\n}\n\n/**\n * Creates a new AudioPlayer to be used.\n */\nexport function createAudioPlayer(options?: CreateAudioPlayerOptions) {\n\treturn new AudioPlayer(options);\n}\n","import type { AudioResource } from './AudioResource';\n\n/**\n * An error emitted by an AudioPlayer. Contains an attached resource to aid with\n * debugging and identifying where the error came from.\n */\nexport class AudioPlayerError extends Error {\n\t/**\n\t * The resource associated with the audio player at the time the error was thrown.\n\t */\n\tpublic readonly resource: AudioResource;\n\n\tpublic constructor(error: Error, resource: AudioResource) {\n\t\tsuper(error.message);\n\t\tthis.resource = resource;\n\t\tthis.name = error.name;\n\t\tthis.stack = error.stack!;\n\t}\n}\n","/* eslint-disable @typescript-eslint/dot-notation */\nimport type { VoiceConnection } from '../VoiceConnection';\nimport type { AudioPlayer } from './AudioPlayer';\n\n/**\n * Represents a subscription of a voice connection to an audio player, allowing\n * the audio player to play audio on the voice connection.\n */\nexport class PlayerSubscription {\n\t/**\n\t * The voice connection of this subscription.\n\t */\n\tpublic readonly connection: VoiceConnection;\n\n\t/**\n\t * The audio player of this subscription.\n\t */\n\tpublic readonly player: AudioPlayer;\n\n\tpublic constructor(connection: VoiceConnection, player: AudioPlayer) {\n\t\tthis.connection = connection;\n\t\tthis.player = player;\n\t}\n\n\t/**\n\t * Unsubscribes the connection from the audio player, meaning that the\n\t * audio player cannot stream audio to it until a new subscription is made.\n\t */\n\tpublic unsubscribe() {\n\t\tthis.connection['onSubscriptionRemoved'](this);\n\t\tthis.player['unsubscribe'](this);\n\t}\n}\n","import { Buffer } from 'node:buffer';\nimport { createSocket, type Socket } from 'node:dgram';\nimport { EventEmitter } from 'node:events';\nimport { isIPv4 } from 'node:net';\n\n/**\n * Stores an IP address and port. Used to store socket details for the local client as well as\n * for Discord.\n */\nexport interface SocketConfig {\n\tip: string;\n\tport: number;\n}\n\n/**\n * Parses the response from Discord to aid with local IP discovery.\n *\n * @param message - The received message\n */\nexport function parseLocalPacket(message: Buffer): SocketConfig {\n\tconst packet = Buffer.from(message);\n\n\tconst ip = packet.slice(8, packet.indexOf(0, 8)).toString('utf8');\n\n\tif (!isIPv4(ip)) {\n\t\tthrow new Error('Malformed IP address');\n\t}\n\n\tconst port = packet.readUInt16BE(packet.length - 2);\n\n\treturn { ip, port };\n}\n\n/**\n * The interval in milliseconds at which keep alive datagrams are sent.\n */\nconst KEEP_ALIVE_INTERVAL = 5e3;\n\n/**\n * The maximum value of the keep alive counter.\n */\nconst MAX_COUNTER_VALUE = 2 ** 32 - 1;\n\nexport interface VoiceUDPSocket extends EventEmitter {\n\ton(event: 'error', listener: (error: Error) => void): this;\n\ton(event: 'close', listener: () => void): this;\n\ton(event: 'debug', listener: (message: string) => void): this;\n\ton(event: 'message', listener: (message: Buffer) => void): this;\n}\n\n/**\n * Manages the UDP networking for a voice connection.\n */\nexport class VoiceUDPSocket extends EventEmitter {\n\t/**\n\t * The underlying network Socket for the VoiceUDPSocket.\n\t */\n\tprivate readonly socket: Socket;\n\n\t/**\n\t * The socket details for Discord (remote)\n\t */\n\tprivate readonly remote: SocketConfig;\n\n\t/**\n\t * The counter used in the keep alive mechanism.\n\t */\n\tprivate keepAliveCounter = 0;\n\n\t/**\n\t * The buffer used to write the keep alive counter into.\n\t */\n\tprivate readonly keepAliveBuffer: Buffer;\n\n\t/**\n\t * The Node.js interval for the keep-alive mechanism.\n\t */\n\tprivate readonly keepAliveInterval: NodeJS.Timeout;\n\n\t/**\n\t * The time taken to receive a response to keep alive messages.\n\t *\n\t * @deprecated This field is no longer updated as keep alive messages are no longer tracked.\n\t */\n\tpublic ping?: number;\n\n\t/**\n\t * Creates a new VoiceUDPSocket.\n\t *\n\t * @param remote - Details of the remote socket\n\t */\n\tpublic constructor(remote: SocketConfig) {\n\t\tsuper();\n\t\tthis.socket = createSocket('udp4');\n\t\tthis.socket.on('error', (error: Error) => this.emit('error', error));\n\t\tthis.socket.on('message', (buffer: Buffer) => this.onMessage(buffer));\n\t\tthis.socket.on('close', () => this.emit('close'));\n\t\tthis.remote = remote;\n\t\tthis.keepAliveBuffer = Buffer.alloc(8);\n\t\tthis.keepAliveInterval = setInterval(() => this.keepAlive(), KEEP_ALIVE_INTERVAL);\n\t\tsetImmediate(() => this.keepAlive());\n\t}\n\n\t/**\n\t * Called when a message is received on the UDP socket.\n\t *\n\t * @param buffer - The received buffer\n\t */\n\tprivate onMessage(buffer: Buffer): void {\n\t\t// Propagate the message\n\t\tthis.emit('message', buffer);\n\t}\n\n\t/**\n\t * Called at a regular interval to check whether we are still able to send datagrams to Discord.\n\t */\n\tprivate keepAlive() {\n\t\tthis.keepAliveBuffer.writeUInt32LE(this.keepAliveCounter, 0);\n\t\tthis.send(this.keepAliveBuffer);\n\t\tthis.keepAliveCounter++;\n\t\tif (this.keepAliveCounter > MAX_COUNTER_VALUE) {\n\t\t\tthis.keepAliveCounter = 0;\n\t\t}\n\t}\n\n\t/**\n\t * Sends a buffer to Discord.\n\t *\n\t * @param buffer - The buffer to send\n\t */\n\tpublic send(buffer: Buffer) {\n\t\tthis.socket.send(buffer, this.remote.port, this.remote.ip);\n\t}\n\n\t/**\n\t * Closes the socket, the instance will not be able to be reused.\n\t */\n\tpublic destroy() {\n\t\ttry {\n\t\t\tthis.socket.close();\n\t\t} catch {}\n\n\t\tclearInterval(this.keepAliveInterval);\n\t}\n\n\t/**\n\t * Performs IP discovery to discover the local address and port to be used for the voice connection.\n\t *\n\t * @param ssrc - The SSRC received from Discord\n\t */\n\tpublic async performIPDiscovery(ssrc: number): Promise {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst listener = (message: Buffer) => {\n\t\t\t\ttry {\n\t\t\t\t\tif (message.readUInt16BE(0) !== 2) return;\n\t\t\t\t\tconst packet = parseLocalPacket(message);\n\t\t\t\t\tthis.socket.off('message', listener);\n\t\t\t\t\tresolve(packet);\n\t\t\t\t} catch {}\n\t\t\t};\n\n\t\t\tthis.socket.on('message', listener);\n\t\t\tthis.socket.once('close', () => reject(new Error('Cannot perform IP discovery - socket closed')));\n\n\t\t\tconst discoveryBuffer = Buffer.alloc(74);\n\n\t\t\tdiscoveryBuffer.writeUInt16BE(1, 0);\n\t\t\tdiscoveryBuffer.writeUInt16BE(70, 2);\n\t\t\tdiscoveryBuffer.writeUInt32BE(ssrc, 4);\n\t\t\tthis.send(discoveryBuffer);\n\t\t});\n\t}\n}\n","import { Buffer } from 'node:buffer';\nimport { EventEmitter } from 'node:events';\nimport type { VoiceSendPayload } from 'discord-api-types/voice/v8';\nimport { VoiceOpcodes } from 'discord-api-types/voice/v8';\nimport WebSocket, { type MessageEvent } from 'ws';\n\n/**\n * A binary WebSocket message.\n */\nexport interface BinaryWebSocketMessage {\n\top: VoiceOpcodes;\n\tpayload: Buffer;\n\tseq: number;\n}\n\nexport interface VoiceWebSocket extends EventEmitter {\n\ton(event: 'error', listener: (error: Error) => void): this;\n\ton(event: 'open', listener: (event: WebSocket.Event) => void): this;\n\ton(event: 'close', listener: (event: WebSocket.CloseEvent) => void): this;\n\t/**\n\t * Debug event for VoiceWebSocket.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'debug', listener: (message: string) => void): this;\n\t/**\n\t * Packet event.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'packet', listener: (packet: any) => void): this;\n\t/**\n\t * Binary message event.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'binary', listener: (message: BinaryWebSocketMessage) => void): this;\n}\n\n/**\n * An extension of the WebSocket class to provide helper functionality when interacting\n * with the Discord Voice gateway.\n */\nexport class VoiceWebSocket extends EventEmitter {\n\t/**\n\t * The current heartbeat interval, if any.\n\t */\n\tprivate heartbeatInterval?: NodeJS.Timeout;\n\n\t/**\n\t * The time (milliseconds since UNIX epoch) that the last heartbeat acknowledgement packet was received.\n\t * This is set to 0 if an acknowledgement packet hasn't been received yet.\n\t */\n\tprivate lastHeartbeatAck: number;\n\n\t/**\n\t * The time (milliseconds since UNIX epoch) that the last heartbeat was sent. This is set to 0 if a heartbeat\n\t * hasn't been sent yet.\n\t */\n\tprivate lastHeartbeatSend: number;\n\n\t/**\n\t * The number of consecutively missed heartbeats.\n\t */\n\tprivate missedHeartbeats = 0;\n\n\t/**\n\t * The last recorded ping.\n\t */\n\tpublic ping?: number;\n\n\t/**\n\t * The last sequence number acknowledged from Discord. Will be `-1` if no sequence numbered messages have been received.\n\t */\n\tpublic sequence = -1;\n\n\t/**\n\t * The debug logger function, if debugging is enabled.\n\t */\n\tprivate readonly debug: ((message: string) => void) | null;\n\n\t/**\n\t * The underlying WebSocket of this wrapper.\n\t */\n\tprivate readonly ws: WebSocket;\n\n\t/**\n\t * Creates a new VoiceWebSocket.\n\t *\n\t * @param address - The address to connect to\n\t */\n\tpublic constructor(address: string, debug: boolean) {\n\t\tsuper();\n\t\tthis.ws = new WebSocket(address);\n\t\tthis.ws.onmessage = (err) => this.onMessage(err);\n\t\tthis.ws.onopen = (err) => this.emit('open', err);\n\t\tthis.ws.onerror = (err: Error | WebSocket.ErrorEvent) => this.emit('error', err instanceof Error ? err : err.error);\n\t\tthis.ws.onclose = (err) => this.emit('close', err);\n\n\t\tthis.lastHeartbeatAck = 0;\n\t\tthis.lastHeartbeatSend = 0;\n\n\t\tthis.debug = debug ? (message: string) => this.emit('debug', message) : null;\n\t}\n\n\t/**\n\t * Destroys the VoiceWebSocket. The heartbeat interval is cleared, and the connection is closed.\n\t */\n\tpublic destroy() {\n\t\ttry {\n\t\t\tthis.debug?.('destroyed');\n\t\t\tthis.setHeartbeatInterval(-1);\n\t\t\tthis.ws.close(1_000);\n\t\t} catch (error) {\n\t\t\tconst err = error as Error;\n\t\t\tthis.emit('error', err);\n\t\t}\n\t}\n\n\t/**\n\t * Handles message events on the WebSocket. Attempts to JSON parse the messages and emit them\n\t * as packets. Binary messages will be parsed and emitted.\n\t *\n\t * @param event - The message event\n\t */\n\tpublic onMessage(event: MessageEvent) {\n\t\tif (event.data instanceof Buffer || event.data instanceof ArrayBuffer) {\n\t\t\tconst buffer = event.data instanceof ArrayBuffer ? Buffer.from(event.data) : event.data;\n\t\t\tconst seq = buffer.readUInt16BE(0);\n\t\t\tconst op = buffer.readUInt8(2);\n\t\t\tconst payload = buffer.subarray(3);\n\n\t\t\tthis.sequence = seq;\n\t\t\tthis.debug?.(`<< [bin] opcode ${op}, seq ${seq}, ${payload.byteLength} bytes`);\n\n\t\t\tthis.emit('binary', { op, seq, payload });\n\t\t\treturn;\n\t\t} else if (typeof event.data !== 'string') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.debug?.(`<< ${event.data}`);\n\n\t\tlet packet: any;\n\t\ttry {\n\t\t\tpacket = JSON.parse(event.data);\n\t\t} catch (error) {\n\t\t\tconst err = error as Error;\n\t\t\tthis.emit('error', err);\n\t\t\treturn;\n\t\t}\n\n\t\tif (packet.seq) {\n\t\t\tthis.sequence = packet.seq;\n\t\t}\n\n\t\tif (packet.op === VoiceOpcodes.HeartbeatAck) {\n\t\t\tthis.lastHeartbeatAck = Date.now();\n\t\t\tthis.missedHeartbeats = 0;\n\t\t\tthis.ping = this.lastHeartbeatAck - this.lastHeartbeatSend;\n\t\t}\n\n\t\tthis.emit('packet', packet);\n\t}\n\n\t/**\n\t * Sends a JSON-stringifiable packet over the WebSocket.\n\t *\n\t * @param packet - The packet to send\n\t */\n\tpublic sendPacket(packet: VoiceSendPayload) {\n\t\ttry {\n\t\t\tconst stringified = JSON.stringify(packet);\n\t\t\tthis.debug?.(`>> ${stringified}`);\n\t\t\tthis.ws.send(stringified);\n\t\t} catch (error) {\n\t\t\tconst err = error as Error;\n\t\t\tthis.emit('error', err);\n\t\t}\n\t}\n\n\t/**\n\t * Sends a binary message over the WebSocket.\n\t *\n\t * @param opcode - The opcode to use\n\t * @param payload - The payload to send\n\t */\n\tpublic sendBinaryMessage(opcode: VoiceOpcodes, payload: Buffer) {\n\t\ttry {\n\t\t\tconst message = Buffer.concat([new Uint8Array([opcode]), payload]);\n\t\t\tthis.debug?.(`>> [bin] opcode ${opcode}, ${payload.byteLength} bytes`);\n\t\t\tthis.ws.send(message);\n\t\t} catch (error) {\n\t\t\tconst err = error as Error;\n\t\t\tthis.emit('error', err);\n\t\t}\n\t}\n\n\t/**\n\t * Sends a heartbeat over the WebSocket.\n\t */\n\tprivate sendHeartbeat() {\n\t\tthis.lastHeartbeatSend = Date.now();\n\t\tthis.missedHeartbeats++;\n\t\tconst nonce = this.lastHeartbeatSend;\n\t\tthis.sendPacket({\n\t\t\top: VoiceOpcodes.Heartbeat,\n\t\t\t// eslint-disable-next-line id-length\n\t\t\td: {\n\t\t\t\t// eslint-disable-next-line id-length\n\t\t\t\tt: nonce,\n\t\t\t\tseq_ack: this.sequence,\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Sets/clears an interval to send heartbeats over the WebSocket.\n\t *\n\t * @param ms - The interval in milliseconds. If negative, the interval will be unset\n\t */\n\tpublic setHeartbeatInterval(ms: number) {\n\t\tif (this.heartbeatInterval !== undefined) clearInterval(this.heartbeatInterval);\n\t\tif (ms > 0) {\n\t\t\tthis.heartbeatInterval = setInterval(() => {\n\t\t\t\tif (this.lastHeartbeatSend !== 0 && this.missedHeartbeats >= 3) {\n\t\t\t\t\t// Missed too many heartbeats - disconnect\n\t\t\t\t\tthis.ws.close();\n\t\t\t\t\tthis.setHeartbeatInterval(-1);\n\t\t\t\t}\n\n\t\t\t\tthis.sendHeartbeat();\n\t\t\t}, ms);\n\t\t}\n\t}\n}\n","/* eslint-disable jsdoc/check-param-names */\n\nimport { Buffer } from 'node:buffer';\nimport crypto from 'node:crypto';\nimport type { VoiceReceivePayload } from 'discord-api-types/voice/v8';\nimport { VoiceOpcodes } from 'discord-api-types/voice/v8';\nimport { VoiceConnectionStatus, type VoiceConnection } from '../VoiceConnection';\nimport { NetworkingStatusCode, type ConnectionData } from '../networking/Networking';\nimport { methods } from '../util/Secretbox';\nimport {\n\tAudioReceiveStream,\n\tcreateDefaultAudioReceiveStreamOptions,\n\ttype AudioReceiveStreamOptions,\n} from './AudioReceiveStream';\nimport { SSRCMap } from './SSRCMap';\nimport { SpeakingMap } from './SpeakingMap';\n\nconst HEADER_EXTENSION_BYTE = Buffer.from([0xbe, 0xde]);\nconst UNPADDED_NONCE_LENGTH = 4;\nconst AUTH_TAG_LENGTH = 16;\n\n/**\n * Attaches to a VoiceConnection, allowing you to receive audio packets from other\n * users that are speaking.\n *\n * @beta\n */\nexport class VoiceReceiver {\n\t/**\n\t * The attached connection of this receiver.\n\t */\n\tpublic readonly voiceConnection;\n\n\t/**\n\t * Maps SSRCs to Discord user ids.\n\t */\n\tpublic readonly ssrcMap: SSRCMap;\n\n\t/**\n\t * The current audio subscriptions of this receiver.\n\t */\n\tpublic readonly subscriptions: Map;\n\n\t/**\n\t * The connection data of the receiver.\n\t *\n\t * @internal\n\t */\n\tpublic connectionData: Partial;\n\n\t/**\n\t * The speaking map of the receiver.\n\t */\n\tpublic readonly speaking: SpeakingMap;\n\n\tpublic constructor(voiceConnection: VoiceConnection) {\n\t\tthis.voiceConnection = voiceConnection;\n\t\tthis.ssrcMap = new SSRCMap();\n\t\tthis.speaking = new SpeakingMap();\n\t\tthis.subscriptions = new Map();\n\t\tthis.connectionData = {};\n\n\t\tthis.onWsPacket = this.onWsPacket.bind(this);\n\t\tthis.onUdpMessage = this.onUdpMessage.bind(this);\n\t}\n\n\t/**\n\t * Called when a packet is received on the attached connection's WebSocket.\n\t *\n\t * @param packet - The received packet\n\t * @internal\n\t */\n\tpublic onWsPacket(packet: VoiceReceivePayload) {\n\t\tif (packet.op === VoiceOpcodes.ClientDisconnect) {\n\t\t\tthis.ssrcMap.delete(packet.d.user_id);\n\t\t} else if (packet.op === VoiceOpcodes.Speaking) {\n\t\t\tthis.ssrcMap.update({ userId: packet.d.user_id, audioSSRC: packet.d.ssrc });\n\t\t}\n\t}\n\n\tprivate decrypt(buffer: Buffer, mode: string, nonce: Buffer, secretKey: Uint8Array) {\n\t\t// Copy the last 4 bytes of unpadded nonce to the padding of (12 - 4) or (24 - 4) bytes\n\t\tbuffer.copy(nonce, 0, buffer.length - UNPADDED_NONCE_LENGTH);\n\n\t\tlet headerSize = 12;\n\t\tconst first = buffer.readUint8();\n\t\tif ((first >> 4) & 0x01) headerSize += 4;\n\n\t\t// The unencrypted RTP header contains 12 bytes, HEADER_EXTENSION and the extension size\n\t\tconst header = buffer.subarray(0, headerSize);\n\n\t\t// Encrypted contains the extension, if any, the opus packet, and the auth tag\n\t\tconst encrypted = buffer.subarray(headerSize, buffer.length - AUTH_TAG_LENGTH - UNPADDED_NONCE_LENGTH);\n\t\tconst authTag = buffer.subarray(\n\t\t\tbuffer.length - AUTH_TAG_LENGTH - UNPADDED_NONCE_LENGTH,\n\t\t\tbuffer.length - UNPADDED_NONCE_LENGTH,\n\t\t);\n\n\t\tswitch (mode) {\n\t\t\tcase 'aead_aes256_gcm_rtpsize': {\n\t\t\t\tconst decipheriv = crypto.createDecipheriv('aes-256-gcm', secretKey, nonce);\n\t\t\t\tdecipheriv.setAAD(header);\n\t\t\t\tdecipheriv.setAuthTag(authTag);\n\n\t\t\t\treturn Buffer.concat([decipheriv.update(encrypted), decipheriv.final()]);\n\t\t\t}\n\n\t\t\tcase 'aead_xchacha20_poly1305_rtpsize': {\n\t\t\t\t// Combined mode expects authtag in the encrypted message\n\t\t\t\treturn Buffer.from(\n\t\t\t\t\tmethods.crypto_aead_xchacha20poly1305_ietf_decrypt(\n\t\t\t\t\t\tBuffer.concat([encrypted, authTag]),\n\t\t\t\t\t\theader,\n\t\t\t\t\t\tnonce,\n\t\t\t\t\t\tsecretKey,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tdefault: {\n\t\t\t\tthrow new RangeError(`Unsupported decryption method: ${mode}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Parses an audio packet, decrypting it to yield an Opus packet.\n\t *\n\t * @param buffer - The buffer to parse\n\t * @param mode - The encryption mode\n\t * @param nonce - The nonce buffer used by the connection for encryption\n\t * @param secretKey - The secret key used by the connection for encryption\n\t * @param userId - The user id that sent the packet\n\t * @returns The parsed Opus packet\n\t */\n\tprivate parsePacket(buffer: Buffer, mode: string, nonce: Buffer, secretKey: Uint8Array, userId: string) {\n\t\tlet packet = this.decrypt(buffer, mode, nonce, secretKey);\n\t\tif (!packet) throw new Error('Failed to parse packet');\n\n\t\t// Strip decrypted RTP Header Extension if present\n\t\t// The header is only indicated in the original data, so compare with buffer first\n\t\tif (buffer.subarray(12, 14).compare(HEADER_EXTENSION_BYTE) === 0) {\n\t\t\tconst headerExtensionLength = buffer.subarray(14).readUInt16BE();\n\t\t\tpacket = packet.subarray(4 * headerExtensionLength);\n\t\t}\n\n\t\t// Decrypt packet if in a DAVE session.\n\t\tif (\n\t\t\tthis.voiceConnection.state.status === VoiceConnectionStatus.Ready &&\n\t\t\t(this.voiceConnection.state.networking.state.code === NetworkingStatusCode.Ready ||\n\t\t\t\tthis.voiceConnection.state.networking.state.code === NetworkingStatusCode.Resuming)\n\t\t) {\n\t\t\tconst daveSession = this.voiceConnection.state.networking.state.dave;\n\t\t\tif (daveSession) packet = daveSession.decrypt(packet, userId)!;\n\t\t}\n\n\t\treturn packet;\n\t}\n\n\t/**\n\t * Called when the UDP socket of the attached connection receives a message.\n\t *\n\t * @param msg - The received message\n\t * @internal\n\t */\n\tpublic onUdpMessage(msg: Buffer) {\n\t\tif (msg.length <= 8) return;\n\t\tconst ssrc = msg.readUInt32BE(8);\n\n\t\tconst userData = this.ssrcMap.get(ssrc);\n\t\tif (!userData) return;\n\n\t\tthis.speaking.onPacket(userData.userId);\n\n\t\tconst stream = this.subscriptions.get(userData.userId);\n\t\tif (!stream) return;\n\n\t\tif (this.connectionData.encryptionMode && this.connectionData.nonceBuffer && this.connectionData.secretKey) {\n\t\t\ttry {\n\t\t\t\tconst packet = this.parsePacket(\n\t\t\t\t\tmsg,\n\t\t\t\t\tthis.connectionData.encryptionMode,\n\t\t\t\t\tthis.connectionData.nonceBuffer,\n\t\t\t\t\tthis.connectionData.secretKey,\n\t\t\t\t\tuserData.userId,\n\t\t\t\t);\n\t\t\t\tif (packet) stream.push(packet);\n\t\t\t} catch (error) {\n\t\t\t\tstream.destroy(error as Error);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Creates a subscription for the given user id.\n\t *\n\t * @param target - The id of the user to subscribe to\n\t * @returns A readable stream of Opus packets received from the target\n\t */\n\tpublic subscribe(userId: string, options?: Partial) {\n\t\tconst existing = this.subscriptions.get(userId);\n\t\tif (existing) return existing;\n\n\t\tconst stream = new AudioReceiveStream({\n\t\t\t...createDefaultAudioReceiveStreamOptions(),\n\t\t\t...options,\n\t\t});\n\n\t\tstream.once('close', () => this.subscriptions.delete(userId));\n\t\tthis.subscriptions.set(userId, stream);\n\t\treturn stream;\n\t}\n}\n","import type { Buffer } from 'node:buffer';\nimport { nextTick } from 'node:process';\nimport { Readable, type ReadableOptions } from 'node:stream';\nimport { SILENCE_FRAME } from '../audio/AudioPlayer';\n\n/**\n * The different behaviors an audio receive stream can have for deciding when to end.\n */\nexport enum EndBehaviorType {\n\t/**\n\t * The stream will only end when manually destroyed.\n\t */\n\tManual,\n\n\t/**\n\t * The stream will end after a given time period of silence/no audio packets.\n\t */\n\tAfterSilence,\n\n\t/**\n\t * The stream will end after a given time period of no audio packets.\n\t */\n\tAfterInactivity,\n}\n\nexport type EndBehavior =\n\t| {\n\t\t\tbehavior: EndBehaviorType.AfterInactivity | EndBehaviorType.AfterSilence;\n\t\t\tduration: number;\n\t }\n\t| {\n\t\t\tbehavior: EndBehaviorType.Manual;\n\t };\n\nexport interface AudioReceiveStreamOptions extends ReadableOptions {\n\tend: EndBehavior;\n}\n\nexport function createDefaultAudioReceiveStreamOptions(): AudioReceiveStreamOptions {\n\treturn {\n\t\tend: {\n\t\t\tbehavior: EndBehaviorType.Manual,\n\t\t},\n\t};\n}\n\n/**\n * A readable stream of Opus packets received from a specific entity\n * in a Discord voice connection.\n */\nexport class AudioReceiveStream extends Readable {\n\t/**\n\t * The end behavior of the receive stream.\n\t */\n\tpublic readonly end: EndBehavior;\n\n\tprivate endTimeout?: NodeJS.Timeout;\n\n\tpublic constructor(options: AudioReceiveStreamOptions) {\n\t\tconst { end, ...rest } = options;\n\n\t\tsuper({\n\t\t\t...rest,\n\t\t\tobjectMode: true,\n\t\t});\n\n\t\tthis.end = end;\n\t}\n\n\tpublic override push(buffer: Buffer | null) {\n\t\tif (\n\t\t\tbuffer &&\n\t\t\t(this.end.behavior === EndBehaviorType.AfterInactivity ||\n\t\t\t\t(this.end.behavior === EndBehaviorType.AfterSilence &&\n\t\t\t\t\t(buffer.compare(SILENCE_FRAME) !== 0 || this.endTimeout === undefined)))\n\t\t) {\n\t\t\tthis.renewEndTimeout(this.end);\n\t\t}\n\n\t\tif (buffer === null) {\n\t\t\t// null marks EOF for stream\n\t\t\tnextTick(() => this.destroy());\n\t\t}\n\n\t\treturn super.push(buffer);\n\t}\n\n\tprivate renewEndTimeout(end: EndBehavior & { duration: number }) {\n\t\tif (this.endTimeout) {\n\t\t\tclearTimeout(this.endTimeout);\n\t\t}\n\n\t\tthis.endTimeout = setTimeout(() => this.push(null), end.duration);\n\t}\n\n\tpublic override _read() {}\n}\n","import { EventEmitter } from 'node:events';\n\n/**\n * The known data for a user in a Discord voice connection.\n */\nexport interface VoiceUserData {\n\t/**\n\t * The SSRC of the user's audio stream.\n\t */\n\taudioSSRC: number;\n\n\t/**\n\t * The Discord user id of the user.\n\t */\n\tuserId: string;\n\n\t/**\n\t * The SSRC of the user's video stream (if one exists)\n\t * Cannot be 0. If undefined, the user has no video stream.\n\t */\n\tvideoSSRC?: number;\n}\n\nexport interface SSRCMap extends EventEmitter {\n\ton(event: 'create', listener: (newData: VoiceUserData) => void): this;\n\ton(event: 'update', listener: (oldData: VoiceUserData | undefined, newData: VoiceUserData) => void): this;\n\ton(event: 'delete', listener: (deletedData: VoiceUserData) => void): this;\n}\n\n/**\n * Maps audio SSRCs to data of users in voice connections.\n */\nexport class SSRCMap extends EventEmitter {\n\t/**\n\t * The underlying map.\n\t */\n\tprivate readonly map: Map;\n\n\tpublic constructor() {\n\t\tsuper();\n\t\tthis.map = new Map();\n\t}\n\n\t/**\n\t * Updates the map with new user data\n\t *\n\t * @param data - The data to update with\n\t */\n\tpublic update(data: VoiceUserData) {\n\t\tconst existing = this.map.get(data.audioSSRC);\n\n\t\tconst newValue = {\n\t\t\t...this.map.get(data.audioSSRC),\n\t\t\t...data,\n\t\t};\n\n\t\tthis.map.set(data.audioSSRC, newValue);\n\t\tif (!existing) this.emit('create', newValue);\n\t\tthis.emit('update', existing, newValue);\n\t}\n\n\t/**\n\t * Gets the stored voice data of a user.\n\t *\n\t * @param target - The target, either their user id or audio SSRC\n\t */\n\tpublic get(target: number | string) {\n\t\tif (typeof target === 'number') {\n\t\t\treturn this.map.get(target);\n\t\t}\n\n\t\tfor (const data of this.map.values()) {\n\t\t\tif (data.userId === target) {\n\t\t\t\treturn data;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Deletes the stored voice data about a user.\n\t *\n\t * @param target - The target of the delete operation, either their audio SSRC or user id\n\t * @returns The data that was deleted, if any\n\t */\n\tpublic delete(target: number | string) {\n\t\tif (typeof target === 'number') {\n\t\t\tconst existing = this.map.get(target);\n\t\t\tif (existing) {\n\t\t\t\tthis.map.delete(target);\n\t\t\t\tthis.emit('delete', existing);\n\t\t\t}\n\n\t\t\treturn existing;\n\t\t}\n\n\t\tfor (const [audioSSRC, data] of this.map.entries()) {\n\t\t\tif (data.userId === target) {\n\t\t\t\tthis.map.delete(audioSSRC);\n\t\t\t\tthis.emit('delete', data);\n\t\t\t\treturn data;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n","/* eslint-disable @typescript-eslint/unified-signatures */\nimport { EventEmitter } from 'node:events';\n\nexport interface SpeakingMap extends EventEmitter {\n\t/**\n\t * Emitted when a user starts speaking.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'start', listener: (userId: string) => void): this;\n\n\t/**\n\t * Emitted when a user ends speaking.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'end', listener: (userId: string) => void): this;\n}\n\n/**\n * Tracks the speaking states of users in a voice channel.\n */\nexport class SpeakingMap extends EventEmitter {\n\t/**\n\t * The delay after a packet is received from a user until they're marked as not speaking anymore.\n\t */\n\tpublic static readonly DELAY = 100;\n\n\t/**\n\t * The currently speaking users, mapped to the milliseconds since UNIX epoch at which they started speaking.\n\t */\n\tpublic readonly users: Map;\n\n\tprivate readonly speakingTimeouts: Map;\n\n\tpublic constructor() {\n\t\tsuper();\n\t\tthis.users = new Map();\n\t\tthis.speakingTimeouts = new Map();\n\t}\n\n\tpublic onPacket(userId: string) {\n\t\tconst timeout = this.speakingTimeouts.get(userId);\n\t\tif (timeout) {\n\t\t\tclearTimeout(timeout);\n\t\t} else {\n\t\t\tthis.users.set(userId, Date.now());\n\t\t\tthis.emit('start', userId);\n\t\t}\n\n\t\tthis.startTimeout(userId);\n\t}\n\n\tprivate startTimeout(userId: string) {\n\t\tthis.speakingTimeouts.set(\n\t\t\tuserId,\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.emit('end', userId);\n\t\t\t\tthis.speakingTimeouts.delete(userId);\n\t\t\t\tthis.users.delete(userId);\n\t\t\t}, SpeakingMap.DELAY),\n\t\t);\n\t}\n}\n","import type { JoinConfig } from './DataStore';\nimport { createVoiceConnection } from './VoiceConnection';\nimport type { DiscordGatewayAdapterCreator } from './util/adapter';\n\n/**\n * The options that can be given when creating a voice connection.\n */\nexport interface CreateVoiceConnectionOptions {\n\tadapterCreator: DiscordGatewayAdapterCreator;\n\n\t/**\n\t * Whether to use the DAVE protocol for end-to-end encryption. Defaults to true.\n\t */\n\tdaveEncryption?: boolean | undefined;\n\n\t/**\n\t * If true, debug messages will be enabled for the voice connection and its\n\t * related components. Defaults to false.\n\t */\n\tdebug?: boolean | undefined;\n\n\t/**\n\t * The amount of consecutive decryption failures needed to try to\n\t * re-initialize the end-to-end encrypted session to recover. Defaults to 24.\n\t */\n\tdecryptionFailureTolerance?: number | undefined;\n}\n\n/**\n * The options that can be given when joining a voice channel.\n */\nexport interface JoinVoiceChannelOptions {\n\t/**\n\t * The id of the Discord voice channel to join.\n\t */\n\tchannelId: string;\n\n\t/**\n\t * An optional group identifier for the voice connection.\n\t */\n\tgroup?: string;\n\n\t/**\n\t * The id of the guild that the voice channel belongs to.\n\t */\n\tguildId: string;\n\n\t/**\n\t * Whether to join the channel deafened (defaults to true)\n\t */\n\tselfDeaf?: boolean;\n\n\t/**\n\t * Whether to join the channel muted (defaults to true)\n\t */\n\tselfMute?: boolean;\n}\n\n/**\n * Creates a VoiceConnection to a Discord voice channel.\n *\n * @param options - the options for joining the voice channel\n */\nexport function joinVoiceChannel(options: CreateVoiceConnectionOptions & JoinVoiceChannelOptions) {\n\tconst joinConfig: JoinConfig = {\n\t\tselfDeaf: true,\n\t\tselfMute: false,\n\t\tgroup: 'default',\n\t\t...options,\n\t};\n\n\treturn createVoiceConnection(joinConfig, {\n\t\tadapterCreator: options.adapterCreator,\n\t\tdebug: options.debug,\n\t\tdaveEncryption: options.daveEncryption,\n\t\tdecryptionFailureTolerance: options.decryptionFailureTolerance,\n\t});\n}\n","import type { Buffer } from 'node:buffer';\nimport { pipeline, type Readable } from 'node:stream';\nimport prism from 'prism-media';\nimport { noop } from '../util/util';\nimport { SILENCE_FRAME, type AudioPlayer } from './AudioPlayer';\nimport { findPipeline, StreamType, TransformerType, type Edge } from './TransformerGraph';\n\n/**\n * Options that are set when creating a new audio resource.\n *\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport interface CreateAudioResourceOptions {\n\t/**\n\t * Whether or not inline volume should be enabled. If enabled, you will be able to change the volume\n\t * of the stream on-the-fly. However, this also increases the performance cost of playback. Defaults to `false`.\n\t */\n\tinlineVolume?: boolean;\n\n\t/**\n\t * The type of the input stream. Defaults to `StreamType.Arbitrary`.\n\t */\n\tinputType?: StreamType;\n\n\t/**\n\t * Optional metadata that can be attached to the resource (e.g. track title, random id).\n\t * This is useful for identification purposes when the resource is passed around in events.\n\t * See {@link AudioResource.metadata}\n\t */\n\tmetadata?: Metadata;\n\n\t/**\n\t * The number of silence frames to append to the end of the resource's audio stream, to prevent interpolation glitches.\n\t * Defaults to 5.\n\t */\n\tsilencePaddingFrames?: number;\n}\n\n/**\n * Represents an audio resource that can be played by an audio player.\n *\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport class AudioResource {\n\t/**\n\t * An object-mode Readable stream that emits Opus packets. This is what is played by audio players.\n\t */\n\tpublic readonly playStream: Readable;\n\n\t/**\n\t * The pipeline used to convert the input stream into a playable format. For example, this may\n\t * contain an FFmpeg component for arbitrary inputs, and it may contain a VolumeTransformer component\n\t * for resources with inline volume transformation enabled.\n\t */\n\tpublic readonly edges: readonly Edge[];\n\n\t/**\n\t * Optional metadata that can be used to identify the resource.\n\t */\n\tpublic metadata: Metadata;\n\n\t/**\n\t * If the resource was created with inline volume transformation enabled, then this will be a\n\t * prism-media VolumeTransformer. You can use this to alter the volume of the stream.\n\t */\n\tpublic readonly volume?: prism.VolumeTransformer;\n\n\t/**\n\t * If using an Opus encoder to create this audio resource, then this will be a prism-media opus.Encoder.\n\t * You can use this to control settings such as bitrate, FEC, PLP.\n\t */\n\tpublic readonly encoder?: prism.opus.Encoder;\n\n\t/**\n\t * The audio player that the resource is subscribed to, if any.\n\t */\n\tpublic audioPlayer?: AudioPlayer | undefined;\n\n\t/**\n\t * The playback duration of this audio resource, given in milliseconds.\n\t */\n\tpublic playbackDuration = 0;\n\n\t/**\n\t * Whether or not the stream for this resource has started (data has become readable)\n\t */\n\tpublic started = false;\n\n\t/**\n\t * The number of silence frames to append to the end of the resource's audio stream, to prevent interpolation glitches.\n\t */\n\tpublic readonly silencePaddingFrames: number;\n\n\t/**\n\t * The number of remaining silence frames to play. If -1, the frames have not yet started playing.\n\t */\n\tpublic silenceRemaining = -1;\n\n\tpublic constructor(\n\t\tedges: readonly Edge[],\n\t\tstreams: readonly Readable[],\n\t\tmetadata: Metadata,\n\t\tsilencePaddingFrames: number,\n\t) {\n\t\tthis.edges = edges;\n\t\tthis.playStream = streams.length > 1 ? (pipeline(streams, noop) as any as Readable) : streams[0]!;\n\t\tthis.metadata = metadata;\n\t\tthis.silencePaddingFrames = silencePaddingFrames;\n\n\t\tfor (const stream of streams) {\n\t\t\tif (stream instanceof prism.VolumeTransformer) {\n\t\t\t\tthis.volume = stream;\n\t\t\t} else if (stream instanceof prism.opus.Encoder) {\n\t\t\t\tthis.encoder = stream;\n\t\t\t}\n\t\t}\n\n\t\tthis.playStream.once('readable', () => (this.started = true));\n\t}\n\n\t/**\n\t * Whether this resource is readable. If the underlying resource is no longer readable, this will still return true\n\t * while there are silence padding frames left to play.\n\t */\n\tpublic get readable() {\n\t\tif (this.silenceRemaining === 0) return false;\n\t\tconst real = this.playStream.readable;\n\t\tif (!real) {\n\t\t\tif (this.silenceRemaining === -1) this.silenceRemaining = this.silencePaddingFrames;\n\t\t\treturn this.silenceRemaining !== 0;\n\t\t}\n\n\t\treturn real;\n\t}\n\n\t/**\n\t * Whether this resource has ended or not.\n\t */\n\tpublic get ended() {\n\t\treturn this.playStream.readableEnded || this.playStream.destroyed || this.silenceRemaining === 0;\n\t}\n\n\t/**\n\t * Attempts to read an Opus packet from the audio resource. If a packet is available, the playbackDuration\n\t * is incremented.\n\t *\n\t * @remarks\n\t * It is advisable to check that the playStream is readable before calling this method. While no runtime\n\t * errors will be thrown, you should check that the resource is still available before attempting to\n\t * read from it.\n\t * @internal\n\t */\n\tpublic read(): Buffer | null {\n\t\tif (this.silenceRemaining === 0) {\n\t\t\treturn null;\n\t\t} else if (this.silenceRemaining > 0) {\n\t\t\tthis.silenceRemaining--;\n\t\t\treturn SILENCE_FRAME;\n\t\t}\n\n\t\tconst packet = this.playStream.read() as Buffer | null;\n\t\tif (packet) {\n\t\t\tthis.playbackDuration += 20;\n\t\t}\n\n\t\treturn packet;\n\t}\n}\n\n/**\n * Ensures that a path contains at least one volume transforming component.\n *\n * @param path - The path to validate constraints on\n */\nexport const VOLUME_CONSTRAINT = (path: Edge[]) => path.some((edge) => edge.type === TransformerType.InlineVolume);\n\nexport const NO_CONSTRAINT = () => true;\n\n/**\n * Tries to infer the type of a stream to aid with transcoder pipelining.\n *\n * @param stream - The stream to infer the type of\n */\nexport function inferStreamType(stream: Readable): {\n\thasVolume: boolean;\n\tstreamType: StreamType;\n} {\n\tif (stream instanceof prism.opus.Encoder) {\n\t\treturn { streamType: StreamType.Opus, hasVolume: false };\n\t} else if (stream instanceof prism.opus.Decoder) {\n\t\treturn { streamType: StreamType.Raw, hasVolume: false };\n\t} else if (stream instanceof prism.VolumeTransformer) {\n\t\treturn { streamType: StreamType.Raw, hasVolume: true };\n\t} else if (stream instanceof prism.opus.OggDemuxer) {\n\t\treturn { streamType: StreamType.Opus, hasVolume: false };\n\t} else if (stream instanceof prism.opus.WebmDemuxer) {\n\t\treturn { streamType: StreamType.Opus, hasVolume: false };\n\t}\n\n\treturn { streamType: StreamType.Arbitrary, hasVolume: false };\n}\n\n/**\n * Creates an audio resource that can be played by audio players.\n *\n * @remarks\n * If the input is given as a string, then the inputType option will be overridden and FFmpeg will be used.\n *\n * If the input is not in the correct format, then a pipeline of transcoders and transformers will be created\n * to ensure that the resultant stream is in the correct format for playback. This could involve using FFmpeg,\n * Opus transcoders, and Ogg/WebM demuxers.\n * @param input - The resource to play\n * @param options - Configurable options for creating the resource\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport function createAudioResource(\n\tinput: Readable | string,\n\toptions: CreateAudioResourceOptions &\n\t\tPick<\n\t\t\tMetadata extends null | undefined\n\t\t\t\t? CreateAudioResourceOptions\n\t\t\t\t: Required>,\n\t\t\t'metadata'\n\t\t>,\n): AudioResource;\n\n/**\n * Creates an audio resource that can be played by audio players.\n *\n * @remarks\n * If the input is given as a string, then the inputType option will be overridden and FFmpeg will be used.\n *\n * If the input is not in the correct format, then a pipeline of transcoders and transformers will be created\n * to ensure that the resultant stream is in the correct format for playback. This could involve using FFmpeg,\n * Opus transcoders, and Ogg/WebM demuxers.\n * @param input - The resource to play\n * @param options - Configurable options for creating the resource\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport function createAudioResource(\n\tinput: Readable | string,\n\toptions?: Omit, 'metadata'>,\n): AudioResource;\n\n/**\n * Creates an audio resource that can be played by audio players.\n *\n * @remarks\n * If the input is given as a string, then the inputType option will be overridden and FFmpeg will be used.\n *\n * If the input is not in the correct format, then a pipeline of transcoders and transformers will be created\n * to ensure that the resultant stream is in the correct format for playback. This could involve using FFmpeg,\n * Opus transcoders, and Ogg/WebM demuxers.\n * @param input - The resource to play\n * @param options - Configurable options for creating the resource\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport function createAudioResource(\n\tinput: Readable | string,\n\toptions: CreateAudioResourceOptions = {},\n): AudioResource {\n\tlet inputType = options.inputType;\n\tlet needsInlineVolume = Boolean(options.inlineVolume);\n\n\t// string inputs can only be used with FFmpeg\n\tif (typeof input === 'string') {\n\t\tinputType = StreamType.Arbitrary;\n\t} else if (inputType === undefined) {\n\t\tconst analysis = inferStreamType(input);\n\t\tinputType = analysis.streamType;\n\t\tneedsInlineVolume = needsInlineVolume && !analysis.hasVolume;\n\t}\n\n\tconst transformerPipeline = findPipeline(inputType, needsInlineVolume ? VOLUME_CONSTRAINT : NO_CONSTRAINT);\n\n\tif (transformerPipeline.length === 0) {\n\t\tif (typeof input === 'string') throw new Error(`Invalid pipeline constructed for string resource '${input}'`);\n\t\t// No adjustments required\n\t\treturn new AudioResource(\n\t\t\t[],\n\t\t\t[input],\n\t\t\t(options.metadata ?? null) as Metadata,\n\t\t\toptions.silencePaddingFrames ?? 5,\n\t\t);\n\t}\n\n\tconst streams = transformerPipeline.map((edge) => edge.transformer(input));\n\tif (typeof input !== 'string') streams.unshift(input);\n\n\treturn new AudioResource(\n\t\ttransformerPipeline,\n\t\tstreams,\n\t\t(options.metadata ?? null) as Metadata,\n\t\toptions.silencePaddingFrames ?? 5,\n\t);\n}\n","import type { Readable } from 'node:stream';\nimport prism from 'prism-media';\n\n/**\n * This module creates a Transformer Graph to figure out what the most efficient way\n * of transforming the input stream into something playable would be.\n */\n\nconst FFMPEG_PCM_ARGUMENTS = ['-analyzeduration', '0', '-loglevel', '0', '-f', 's16le', '-ar', '48000', '-ac', '2'];\nconst FFMPEG_OPUS_ARGUMENTS = [\n\t'-analyzeduration',\n\t'0',\n\t'-loglevel',\n\t'0',\n\t'-acodec',\n\t'libopus',\n\t'-f',\n\t'opus',\n\t'-ar',\n\t'48000',\n\t'-ac',\n\t'2',\n];\n\n/**\n * The different types of stream that can exist within the pipeline.\n */\nexport enum StreamType {\n\t/**\n\t * The type of the stream at this point is unknown.\n\t */\n\tArbitrary = 'arbitrary',\n\t/**\n\t * The stream at this point is Opus audio encoded in an Ogg wrapper.\n\t */\n\tOggOpus = 'ogg/opus',\n\t/**\n\t * The stream at this point is Opus audio, and the stream is in object-mode. This is ready to play.\n\t */\n\tOpus = 'opus',\n\t/**\n\t * The stream at this point is s16le PCM.\n\t */\n\tRaw = 'raw',\n\t/**\n\t * The stream at this point is Opus audio encoded in a WebM wrapper.\n\t */\n\tWebmOpus = 'webm/opus',\n}\n\n/**\n * The different types of transformers that can exist within the pipeline.\n */\nexport enum TransformerType {\n\tFFmpegOgg = 'ffmpeg ogg',\n\tFFmpegPCM = 'ffmpeg pcm',\n\tInlineVolume = 'volume transformer',\n\tOggOpusDemuxer = 'ogg/opus demuxer',\n\tOpusDecoder = 'opus decoder',\n\tOpusEncoder = 'opus encoder',\n\tWebmOpusDemuxer = 'webm/opus demuxer',\n}\n\n/**\n * Represents a pathway from one stream type to another using a transformer.\n */\nexport interface Edge {\n\tcost: number;\n\tfrom: Node;\n\tto: Node;\n\ttransformer(input: Readable | string): Readable;\n\ttype: TransformerType;\n}\n\n/**\n * Represents a type of stream within the graph, e.g. an Opus stream, or a stream of raw audio.\n */\nexport class Node {\n\t/**\n\t * The outbound edges from this node.\n\t */\n\tpublic readonly edges: Edge[] = [];\n\n\t/**\n\t * The type of stream for this node.\n\t */\n\tpublic readonly type: StreamType;\n\n\tpublic constructor(type: StreamType) {\n\t\tthis.type = type;\n\t}\n\n\t/**\n\t * Creates an outbound edge from this node.\n\t *\n\t * @param edge - The edge to create\n\t */\n\tpublic addEdge(edge: Omit) {\n\t\tthis.edges.push({ ...edge, from: this });\n\t}\n}\n\n// Create a node for each stream type\nlet NODES: Map | null = null;\n\n/**\n * Gets a node from its stream type.\n *\n * @param type - The stream type of the target node\n */\nexport function getNode(type: StreamType) {\n\tconst node = (NODES ??= initializeNodes()).get(type);\n\tif (!node) throw new Error(`Node type '${type}' does not exist!`);\n\treturn node;\n}\n\n// Try to enable FFmpeg Ogg optimizations\nfunction canEnableFFmpegOptimizations(): boolean {\n\ttry {\n\t\treturn prism.FFmpeg.getInfo().output.includes('--enable-libopus');\n\t} catch {}\n\n\treturn false;\n}\n\nfunction initializeNodes(): Map {\n\tconst nodes = new Map();\n\tfor (const streamType of Object.values(StreamType)) {\n\t\tnodes.set(streamType, new Node(streamType));\n\t}\n\n\tnodes.get(StreamType.Raw)!.addEdge({\n\t\ttype: TransformerType.OpusEncoder,\n\t\tto: nodes.get(StreamType.Opus)!,\n\t\tcost: 1.5,\n\t\ttransformer: () => new prism.opus.Encoder({ rate: 48_000, channels: 2, frameSize: 960 }),\n\t});\n\n\tnodes.get(StreamType.Opus)!.addEdge({\n\t\ttype: TransformerType.OpusDecoder,\n\t\tto: nodes.get(StreamType.Raw)!,\n\t\tcost: 1.5,\n\t\ttransformer: () => new prism.opus.Decoder({ rate: 48_000, channels: 2, frameSize: 960 }),\n\t});\n\n\tnodes.get(StreamType.OggOpus)!.addEdge({\n\t\ttype: TransformerType.OggOpusDemuxer,\n\t\tto: nodes.get(StreamType.Opus)!,\n\t\tcost: 1,\n\t\ttransformer: () => new prism.opus.OggDemuxer(),\n\t});\n\n\tnodes.get(StreamType.WebmOpus)!.addEdge({\n\t\ttype: TransformerType.WebmOpusDemuxer,\n\t\tto: nodes.get(StreamType.Opus)!,\n\t\tcost: 1,\n\t\ttransformer: () => new prism.opus.WebmDemuxer(),\n\t});\n\n\tconst FFMPEG_PCM_EDGE: Omit = {\n\t\ttype: TransformerType.FFmpegPCM,\n\t\tto: nodes.get(StreamType.Raw)!,\n\t\tcost: 2,\n\t\ttransformer: (input) =>\n\t\t\tnew prism.FFmpeg({\n\t\t\t\targs: ['-i', typeof input === 'string' ? input : '-', ...FFMPEG_PCM_ARGUMENTS],\n\t\t\t}),\n\t};\n\n\tnodes.get(StreamType.Arbitrary)!.addEdge(FFMPEG_PCM_EDGE);\n\tnodes.get(StreamType.OggOpus)!.addEdge(FFMPEG_PCM_EDGE);\n\tnodes.get(StreamType.WebmOpus)!.addEdge(FFMPEG_PCM_EDGE);\n\n\tnodes.get(StreamType.Raw)!.addEdge({\n\t\ttype: TransformerType.InlineVolume,\n\t\tto: nodes.get(StreamType.Raw)!,\n\t\tcost: 0.5,\n\t\ttransformer: () => new prism.VolumeTransformer({ type: 's16le' }),\n\t});\n\n\tif (canEnableFFmpegOptimizations()) {\n\t\tconst FFMPEG_OGG_EDGE: Omit = {\n\t\t\ttype: TransformerType.FFmpegOgg,\n\t\t\tto: nodes.get(StreamType.OggOpus)!,\n\t\t\tcost: 2,\n\t\t\ttransformer: (input) =>\n\t\t\t\tnew prism.FFmpeg({\n\t\t\t\t\targs: ['-i', typeof input === 'string' ? input : '-', ...FFMPEG_OPUS_ARGUMENTS],\n\t\t\t\t}),\n\t\t};\n\t\tnodes.get(StreamType.Arbitrary)!.addEdge(FFMPEG_OGG_EDGE);\n\t\t// Include Ogg and WebM as well in case they have different sampling rates or are mono instead of stereo\n\t\t// at the moment, this will not do anything. However, if/when detection for correct Opus headers is\n\t\t// implemented, this will help inform the voice engine that it is able to transcode the audio.\n\t\tnodes.get(StreamType.OggOpus)!.addEdge(FFMPEG_OGG_EDGE);\n\t\tnodes.get(StreamType.WebmOpus)!.addEdge(FFMPEG_OGG_EDGE);\n\t}\n\n\treturn nodes;\n}\n\n/**\n * Represents a step in the path from node A to node B.\n */\ninterface Step {\n\t/**\n\t * The cost of the steps after this step.\n\t */\n\tcost: number;\n\n\t/**\n\t * The edge associated with this step.\n\t */\n\tedge?: Edge;\n\n\t/**\n\t * The next step.\n\t */\n\tnext?: Step;\n}\n\n/**\n * Finds the shortest cost path from node A to node B.\n *\n * @param from - The start node\n * @param constraints - Extra validation for a potential solution. Takes a path, returns true if the path is valid\n * @param goal - The target node\n * @param path - The running path\n * @param depth - The number of remaining recursions\n */\nfunction findPath(\n\tfrom: Node,\n\tconstraints: (path: Edge[]) => boolean,\n\tgoal = getNode(StreamType.Opus),\n\tpath: Edge[] = [],\n\tdepth = 5,\n): Step {\n\tif (from === goal && constraints(path)) {\n\t\treturn { cost: 0 };\n\t} else if (depth === 0) {\n\t\treturn { cost: Number.POSITIVE_INFINITY };\n\t}\n\n\tlet currentBest: Step | undefined;\n\tfor (const edge of from.edges) {\n\t\tif (currentBest && edge.cost > currentBest.cost) continue;\n\t\tconst next = findPath(edge.to, constraints, goal, [...path, edge], depth - 1);\n\t\tconst cost = edge.cost + next.cost;\n\t\tif (!currentBest || cost < currentBest.cost) {\n\t\t\tcurrentBest = { cost, edge, next };\n\t\t}\n\t}\n\n\treturn currentBest ?? { cost: Number.POSITIVE_INFINITY };\n}\n\n/**\n * Takes the solution from findPath and assembles it into a list of edges.\n *\n * @param step - The first step of the path\n */\nfunction constructPipeline(step: Step) {\n\tconst edges = [];\n\tlet current: Step | undefined = step;\n\twhile (current?.edge) {\n\t\tedges.push(current.edge);\n\t\tcurrent = current.next;\n\t}\n\n\treturn edges;\n}\n\n/**\n * Finds the lowest-cost pipeline to convert the input stream type into an Opus stream.\n *\n * @param from - The stream type to start from\n * @param constraint - Extra constraints that may be imposed on potential solution\n */\nexport function findPipeline(from: StreamType, constraint: (path: Edge[]) => boolean) {\n\treturn constructPipeline(findPath(getNode(from), constraint));\n}\n","/* eslint-disable @typescript-eslint/no-var-requires */\n/* eslint-disable @typescript-eslint/no-require-imports */\nimport { getCiphers } from 'node:crypto';\nimport { resolve, dirname } from 'node:path';\nimport prism from 'prism-media';\n\n/**\n * Tries to find the package.json file for a given module.\n *\n * @param dir - The directory to look in\n * @param packageName - The name of the package to look for\n * @param depth - The maximum recursion depth\n */\nfunction findPackageJSON(\n\tdir: string,\n\tpackageName: string,\n\tdepth: number,\n): { name: string; version: string } | undefined {\n\tif (depth === 0) return undefined;\n\tconst attemptedPath = resolve(dir, './package.json');\n\ttry {\n\t\tconst pkg = require(attemptedPath);\n\t\tif (pkg.name !== packageName) throw new Error('package.json does not match');\n\t\treturn pkg;\n\t} catch {\n\t\treturn findPackageJSON(resolve(dir, '..'), packageName, depth - 1);\n\t}\n}\n\n/**\n * Tries to find the version of a dependency.\n *\n * @param name - The package to find the version of\n */\nfunction version(name: string): string {\n\ttry {\n\t\tif (name === '@discordjs/voice') {\n\t\t\treturn '0.19.0';\n\t\t}\n\n\t\tconst pkg = findPackageJSON(dirname(require.resolve(name)), name, 3);\n\t\treturn pkg?.version ?? 'not found';\n\t} catch {\n\t\treturn 'not found';\n\t}\n}\n\n/**\n * Generates a report of the dependencies used by the \\@discordjs/voice module.\n * Useful for debugging.\n */\nexport function generateDependencyReport() {\n\tconst report = [];\n\tconst addVersion = (name: string) => report.push(`- ${name}: ${version(name)}`);\n\t// general\n\treport.push('Core Dependencies');\n\taddVersion('@discordjs/voice');\n\taddVersion('prism-media');\n\treport.push('');\n\n\t// opus\n\treport.push('Opus Libraries');\n\taddVersion('@discordjs/opus');\n\taddVersion('opusscript');\n\treport.push('');\n\n\t// encryption\n\treport.push('Encryption Libraries');\n\treport.push(`- native crypto support for aes-256-gcm: ${getCiphers().includes('aes-256-gcm') ? 'yes' : 'no'}`);\n\taddVersion('sodium-native');\n\taddVersion('sodium');\n\taddVersion('libsodium-wrappers');\n\taddVersion('@stablelib/xchacha20poly1305');\n\taddVersion('@noble/ciphers');\n\treport.push('');\n\n\t// dave\n\treport.push('DAVE Libraries');\n\taddVersion('@snazzah/davey');\n\treport.push('');\n\n\t// ffmpeg\n\treport.push('FFmpeg');\n\ttry {\n\t\tconst info = prism.FFmpeg.getInfo();\n\t\treport.push(`- version: ${info.version}`);\n\t\treport.push(`- libopus: ${info.output.includes('--enable-libopus') ? 'yes' : 'no'}`);\n\t} catch {\n\t\treport.push('- not found');\n\t}\n\n\treturn ['-'.repeat(50), ...report, '-'.repeat(50)].join('\\n');\n}\n","import { type EventEmitter, once } from 'node:events';\nimport type { VoiceConnection, VoiceConnectionStatus } from '../VoiceConnection';\nimport type { AudioPlayer, AudioPlayerStatus } from '../audio/AudioPlayer';\nimport { abortAfter } from './abortAfter';\n\n/**\n * Allows a voice connection a specified amount of time to enter a given state, otherwise rejects with an error.\n *\n * @param target - The voice connection that we want to observe the state change for\n * @param status - The status that the voice connection should be in\n * @param timeoutOrSignal - The maximum time we are allowing for this to occur, or a signal that will abort the operation\n */\nexport function entersState(\n\ttarget: VoiceConnection,\n\tstatus: VoiceConnectionStatus,\n\ttimeoutOrSignal: AbortSignal | number,\n): Promise;\n\n/**\n * Allows an audio player a specified amount of time to enter a given state, otherwise rejects with an error.\n *\n * @param target - The audio player that we want to observe the state change for\n * @param status - The status that the audio player should be in\n * @param timeoutOrSignal - The maximum time we are allowing for this to occur, or a signal that will abort the operation\n */\nexport function entersState(\n\ttarget: AudioPlayer,\n\tstatus: AudioPlayerStatus,\n\ttimeoutOrSignal: AbortSignal | number,\n): Promise;\n\n/**\n * Allows a target a specified amount of time to enter a given state, otherwise rejects with an error.\n *\n * @param target - The object that we want to observe the state change for\n * @param status - The status that the target should be in\n * @param timeoutOrSignal - The maximum time we are allowing for this to occur, or a signal that will abort the operation\n */\nexport async function entersState(\n\ttarget: Target,\n\tstatus: AudioPlayerStatus | VoiceConnectionStatus,\n\ttimeoutOrSignal: AbortSignal | number,\n) {\n\tif (target.state.status !== status) {\n\t\tconst [ac, signal] =\n\t\t\ttypeof timeoutOrSignal === 'number' ? abortAfter(timeoutOrSignal) : [undefined, timeoutOrSignal];\n\t\ttry {\n\t\t\tawait once(target as EventEmitter, status, { signal });\n\t\t} finally {\n\t\t\tac?.abort();\n\t\t}\n\t}\n\n\treturn target;\n}\n","/**\n * Creates an abort controller that aborts after the given time.\n *\n * @param delay - The time in milliseconds to wait before aborting\n */\nexport function abortAfter(delay: number): [AbortController, AbortSignal] {\n\tconst ac = new AbortController();\n\tconst timeout = setTimeout(() => ac.abort(), delay);\n\tac.signal.addEventListener('abort', () => clearTimeout(timeout));\n\treturn [ac, ac.signal];\n}\n","import { Buffer } from 'node:buffer';\nimport process from 'node:process';\nimport { Readable } from 'node:stream';\nimport prism from 'prism-media';\nimport { StreamType } from '..';\nimport { noop } from './util';\n\n/**\n * Takes an Opus Head, and verifies whether the associated Opus audio is suitable to play in a Discord voice channel.\n *\n * @param opusHead - The Opus Head to validate\n * @returns `true` if suitable to play in a Discord voice channel, otherwise `false`\n */\nexport function validateDiscordOpusHead(opusHead: Buffer): boolean {\n\tconst channels = opusHead.readUInt8(9);\n\tconst sampleRate = opusHead.readUInt32LE(12);\n\treturn channels === 2 && sampleRate === 48_000;\n}\n\n/**\n * The resulting information after probing an audio stream\n */\nexport interface ProbeInfo {\n\t/**\n\t * The readable audio stream to use. You should use this rather than the input stream, as the probing\n\t * function can sometimes read the input stream to its end and cause the stream to close.\n\t */\n\tstream: Readable;\n\n\t/**\n\t * The recommended stream type for this audio stream.\n\t */\n\ttype: StreamType;\n}\n\n/**\n * Attempt to probe a readable stream to figure out whether it can be demuxed using an Ogg or WebM Opus demuxer.\n *\n * @param stream - The readable stream to probe\n * @param probeSize - The number of bytes to attempt to read before giving up on the probe\n * @param validator - The Opus Head validator function\n * @experimental\n */\nexport async function demuxProbe(\n\tstream: Readable,\n\tprobeSize = 1_024,\n\tvalidator = validateDiscordOpusHead,\n): Promise {\n\treturn new Promise((resolve, reject) => {\n\t\t// Preconditions\n\t\tif (stream.readableObjectMode) {\n\t\t\treject(new Error('Cannot probe a readable stream in object mode'));\n\t\t\treturn;\n\t\t}\n\n\t\tif (stream.readableEnded) {\n\t\t\treject(new Error('Cannot probe a stream that has ended'));\n\t\t\treturn;\n\t\t}\n\n\t\tlet readBuffer = Buffer.alloc(0);\n\n\t\tlet resolved: StreamType | undefined;\n\n\t\tconst finish = (type: StreamType) => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\t\tstream.off('data', onData);\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\t\tstream.off('close', onClose);\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\t\tstream.off('end', onClose);\n\t\t\tstream.pause();\n\t\t\tresolved = type;\n\t\t\tif (stream.readableEnded) {\n\t\t\t\tresolve({\n\t\t\t\t\tstream: Readable.from(readBuffer),\n\t\t\t\t\ttype,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (readBuffer.length > 0) {\n\t\t\t\t\tstream.push(readBuffer);\n\t\t\t\t}\n\n\t\t\t\tresolve({\n\t\t\t\t\tstream,\n\t\t\t\t\ttype,\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tconst foundHead = (type: StreamType) => (head: Buffer) => {\n\t\t\tif (validator(head)) {\n\t\t\t\tfinish(type);\n\t\t\t}\n\t\t};\n\n\t\tconst webm = new prism.opus.WebmDemuxer();\n\t\twebm.once('error', noop);\n\t\twebm.on('head', foundHead(StreamType.WebmOpus));\n\n\t\tconst ogg = new prism.opus.OggDemuxer();\n\t\togg.once('error', noop);\n\t\togg.on('head', foundHead(StreamType.OggOpus));\n\n\t\tconst onClose = () => {\n\t\t\tif (!resolved) {\n\t\t\t\tfinish(StreamType.Arbitrary);\n\t\t\t}\n\t\t};\n\n\t\tconst onData = (buffer: Buffer) => {\n\t\t\treadBuffer = Buffer.concat([readBuffer, buffer]);\n\n\t\t\twebm.write(buffer);\n\t\t\togg.write(buffer);\n\n\t\t\tif (readBuffer.length >= probeSize) {\n\t\t\t\tstream.off('data', onData);\n\t\t\t\tstream.pause();\n\t\t\t\tprocess.nextTick(onClose);\n\t\t\t}\n\t\t};\n\n\t\tstream.once('error', reject);\n\t\tstream.on('data', onData);\n\t\tstream.once('close', onClose);\n\t\tstream.once('end', onClose);\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACEA,IAAAC,sBAA6B;;;ACF7B,iBAA+B;AAkBxB,SAAS,8BAA8B,QAAoB;AACjE,SAAO;AAAA,IACN,IAAI,0BAAe;AAAA;AAAA,IAEnB,GAAG;AAAA,MACF,UAAU,OAAO;AAAA,MACjB,YAAY,OAAO;AAAA,MACnB,WAAW,OAAO;AAAA,MAClB,WAAW,OAAO;AAAA,IACnB;AAAA,EACD;AACD;AAXgB;AAchB,IAAM,SAAS,oBAAI,IAA0C;AAC7D,OAAO,IAAI,WAAW,oBAAI,IAAI,CAAC;AAE/B,SAAS,iBAAiB,OAAe;AACxC,QAAM,WAAW,OAAO,IAAI,KAAK;AACjC,MAAI,SAAU,QAAO;AACrB,QAAM,MAAM,oBAAI,IAA6B;AAC7C,SAAO,IAAI,OAAO,GAAG;AACrB,SAAO;AACR;AANS;AAcF,SAAS,YAAY;AAC3B,SAAO;AACR;AAFgB;AA0BT,SAAS,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MlB,UAAM,OAAO,IAAI,oBAAAC,QAAM,KAAK,YAAY;AACxC,SAAK,KAAK,SAAS,IAAI;AACvB,SAAK,GAAG,QAAQ,oCAA6B,CAAC;AAE9C,UAAM,MAAM,IAAI,oBAAAA,QAAM,KAAK,WAAW;AACtC,QAAI,KAAK,SAAS,IAAI;AACtB,QAAI,GAAG,QAAQ,kCAA4B,CAAC;AAE5C,UAAM,UAAU,6BAAM;AACrB,UAAI,CAAC,UAAU;AACd,0CAA2B;AAAA,MAC5B;AAAA,IACD,GAJgB;AAMhB,UAAM,SAAS,wBAAC,WAAmB;AAClC,mBAAa,2BAAO,OAAO,CAAC,YAAY,MAAM,CAAC;AAE/C,WAAK,MAAM,MAAM;AACjB,UAAI,MAAM,MAAM;AAEhB,UAAI,WAAW,UAAU,WAAW;AACnC,eAAO,IAAI,QAAQ,MAAM;AACzB,eAAO,MAAM;AACb,6BAAAC,QAAQ,SAAS,OAAO;AAAA,MACzB;AAAA,IACD,GAXe;AAaf,WAAO,KAAK,SAAS,MAAM;AAC3B,WAAO,GAAG,QAAQ,MAAM;AACxB,WAAO,KAAK,SAAS,OAAO;AAC5B,WAAO,KAAK,OAAO,OAAO;AAAA,EAC3B,CAAC;AACF;AArFsB;;;AtBGf,IAAMC,WAAU;","names":["version","import_node_events","import_node_buffer","import_node_events","import_v8","nonce","crypto","resolve","import_node_buffer","import_node_events","import_node_buffer","NoSubscriberBehavior","AudioPlayerStatus","resolve","import_node_buffer","import_node_events","resolve","import_node_buffer","import_node_events","WebSocket","nonce","crypto","NetworkingStatusCode","stringifyState","option","import_node_buffer","import_node_crypto","import_v8","EndBehaviorType","import_node_events","import_node_events","nonce","crypto","VoiceConnectionStatus","VoiceConnectionDisconnectReason","import_node_stream","import_prism_media","StreamType","TransformerType","prism","prism","import_node_crypto","import_prism_media","prism","import_node_events","import_node_buffer","import_node_process","import_node_stream","import_prism_media","resolve","prism","process","version"]} \ No newline at end of file diff --git a/node_modules/@discordjs/voice/dist/index.mjs b/node_modules/@discordjs/voice/dist/index.mjs index dadce8a..c8120dd 100644 --- a/node_modules/@discordjs/voice/dist/index.mjs +++ b/node_modules/@discordjs/voice/dist/index.mjs @@ -1,15 +1,16 @@ -import{createRequire as topLevelCreateRequire}from"module";const require=topLevelCreateRequire(import.meta.url);var __defProp = Object.defineProperty; +import { createRequire as topLevelCreateRequire } from "module"; +const require = topLevelCreateRequire(import.meta.url); +var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) { - if (typeof require !== "undefined") - return require.apply(this, arguments); + if (typeof require !== "undefined") return require.apply(this, arguments); throw Error('Dynamic require of "' + x + '" is not supported'); }); // src/VoiceConnection.ts -import { EventEmitter as EventEmitter7 } from "node:events"; +import { EventEmitter as EventEmitter8 } from "events"; // src/DataStore.ts import { GatewayOpcodes } from "discord-api-types/v10"; @@ -30,8 +31,7 @@ var groups = /* @__PURE__ */ new Map(); groups.set("default", /* @__PURE__ */ new Map()); function getOrCreateGroup(group) { const existing = groups.get(group); - if (existing) - return existing; + if (existing) return existing; const map = /* @__PURE__ */ new Map(); groups.set(group, map); return map; @@ -62,8 +62,7 @@ var audioCycleInterval; var nextTime = -1; var audioPlayers = []; function audioCycleStep() { - if (nextTime === -1) - return; + if (nextTime === -1) return; nextTime += FRAME_LENGTH; const available = audioPlayers.filter((player) => player.checkPlayable()); for (const player of available) { @@ -89,8 +88,7 @@ function hasAudioPlayer(target) { } __name(hasAudioPlayer, "hasAudioPlayer"); function addAudioPlayer(player) { - if (hasAudioPlayer(player)) - return player; + if (hasAudioPlayer(player)) return player; audioPlayers.push(player); if (audioPlayers.length === 1) { nextTime = Date.now(); @@ -101,755 +99,107 @@ function addAudioPlayer(player) { __name(addAudioPlayer, "addAudioPlayer"); function deleteAudioPlayer(player) { const index = audioPlayers.indexOf(player); - if (index === -1) - return; + if (index === -1) return; audioPlayers.splice(index, 1); if (audioPlayers.length === 0) { nextTime = -1; - if (audioCycleInterval !== void 0) - clearTimeout(audioCycleInterval); + if (audioCycleInterval !== void 0) clearTimeout(audioCycleInterval); } } __name(deleteAudioPlayer, "deleteAudioPlayer"); // src/networking/Networking.ts -import { Buffer as Buffer4 } from "node:buffer"; -import { EventEmitter as EventEmitter3 } from "node:events"; -import { VoiceOpcodes as VoiceOpcodes2 } from "discord-api-types/voice/v4"; +import { Buffer as Buffer7 } from "buffer"; +import crypto from "crypto"; +import { EventEmitter as EventEmitter5 } from "events"; +import { VoiceEncryptionMode, VoiceOpcodes as VoiceOpcodes2 } from "discord-api-types/voice/v8"; // src/util/Secretbox.ts -import { Buffer as Buffer2 } from "node:buffer"; +import { Buffer as Buffer2 } from "buffer"; var libs = { - "sodium-native": (sodium) => ({ - open: (buffer, nonce2, secretKey) => { - if (buffer) { - const output = Buffer2.allocUnsafe(buffer.length - sodium.crypto_box_MACBYTES); - if (sodium.crypto_secretbox_open_easy(output, buffer, nonce2, secretKey)) - return output; - } - return null; + "sodium-native": /* @__PURE__ */ __name((sodium) => ({ + crypto_aead_xchacha20poly1305_ietf_decrypt: /* @__PURE__ */ __name((cipherText, additionalData, nonce2, key) => { + const message = Buffer2.alloc(cipherText.length - sodium.crypto_aead_xchacha20poly1305_ietf_ABYTES); + sodium.crypto_aead_xchacha20poly1305_ietf_decrypt(message, null, cipherText, additionalData, nonce2, key); + return message; + }, "crypto_aead_xchacha20poly1305_ietf_decrypt"), + crypto_aead_xchacha20poly1305_ietf_encrypt: /* @__PURE__ */ __name((plaintext, additionalData, nonce2, key) => { + const cipherText = Buffer2.alloc(plaintext.length + sodium.crypto_aead_xchacha20poly1305_ietf_ABYTES); + sodium.crypto_aead_xchacha20poly1305_ietf_encrypt(cipherText, plaintext, additionalData, null, nonce2, key); + return cipherText; + }, "crypto_aead_xchacha20poly1305_ietf_encrypt") + }), "sodium-native"), + sodium: /* @__PURE__ */ __name((sodium) => ({ + crypto_aead_xchacha20poly1305_ietf_decrypt: /* @__PURE__ */ __name((cipherText, additionalData, nonce2, key) => sodium.api.crypto_aead_xchacha20poly1305_ietf_decrypt(cipherText, additionalData, null, nonce2, key), "crypto_aead_xchacha20poly1305_ietf_decrypt"), + crypto_aead_xchacha20poly1305_ietf_encrypt: /* @__PURE__ */ __name((plaintext, additionalData, nonce2, key) => sodium.api.crypto_aead_xchacha20poly1305_ietf_encrypt(plaintext, additionalData, null, nonce2, key), "crypto_aead_xchacha20poly1305_ietf_encrypt") + }), "sodium"), + "libsodium-wrappers": /* @__PURE__ */ __name((sodium) => ({ + crypto_aead_xchacha20poly1305_ietf_decrypt: /* @__PURE__ */ __name((cipherText, additionalData, nonce2, key) => sodium.crypto_aead_xchacha20poly1305_ietf_decrypt(null, cipherText, additionalData, nonce2, key), "crypto_aead_xchacha20poly1305_ietf_decrypt"), + crypto_aead_xchacha20poly1305_ietf_encrypt: /* @__PURE__ */ __name((plaintext, additionalData, nonce2, key) => sodium.crypto_aead_xchacha20poly1305_ietf_encrypt(plaintext, additionalData, null, nonce2, key), "crypto_aead_xchacha20poly1305_ietf_encrypt") + }), "libsodium-wrappers"), + "@stablelib/xchacha20poly1305": /* @__PURE__ */ __name((stablelib) => ({ + crypto_aead_xchacha20poly1305_ietf_decrypt(plaintext, additionalData, nonce2, key) { + const crypto3 = new stablelib.XChaCha20Poly1305(key); + return crypto3.open(nonce2, plaintext, additionalData); }, - close: (opusPacket, nonce2, secretKey) => { - const output = Buffer2.allocUnsafe(opusPacket.length + sodium.crypto_box_MACBYTES); - sodium.crypto_secretbox_easy(output, opusPacket, nonce2, secretKey); - return output; + crypto_aead_xchacha20poly1305_ietf_encrypt(cipherText, additionalData, nonce2, key) { + const crypto3 = new stablelib.XChaCha20Poly1305(key); + return crypto3.seal(nonce2, cipherText, additionalData); + } + }), "@stablelib/xchacha20poly1305"), + "@noble/ciphers/chacha": /* @__PURE__ */ __name((noble) => ({ + crypto_aead_xchacha20poly1305_ietf_decrypt(cipherText, additionalData, nonce2, key) { + const chacha = noble.xchacha20poly1305(key, nonce2, additionalData); + return chacha.decrypt(cipherText); }, - random: (num, buffer = Buffer2.allocUnsafe(num)) => { - sodium.randombytes_buf(buffer); - return buffer; + crypto_aead_xchacha20poly1305_ietf_encrypt(plaintext, additionalData, nonce2, key) { + const chacha = noble.xchacha20poly1305(key, nonce2, additionalData); + return chacha.encrypt(plaintext); } - }), - sodium: (sodium) => ({ - open: sodium.api.crypto_secretbox_open_easy, - close: sodium.api.crypto_secretbox_easy, - random: (num, buffer = Buffer2.allocUnsafe(num)) => { - sodium.api.randombytes_buf(buffer); - return buffer; - } - }), - "libsodium-wrappers": (sodium) => ({ - open: sodium.crypto_secretbox_open_easy, - close: sodium.crypto_secretbox_easy, - random: sodium.randombytes_buf - }), - tweetnacl: (tweetnacl) => ({ - open: tweetnacl.secretbox.open, - close: tweetnacl.secretbox, - random: tweetnacl.randomBytes - }) + }), "@noble/ciphers/chacha") }; var fallbackError = /* @__PURE__ */ __name(() => { throw new Error( `Cannot play audio as no valid encryption package is installed. -- Install sodium, libsodium-wrappers, or tweetnacl. +- Install one of: + - sodium + - libsodium-wrappers + - @stablelib/xchacha20poly1305 + - @noble/ciphers. - Use the generateDependencyReport() function for more information. ` ); }, "fallbackError"); var methods = { - open: fallbackError, - close: fallbackError, - random: fallbackError + crypto_aead_xchacha20poly1305_ietf_encrypt: fallbackError, + crypto_aead_xchacha20poly1305_ietf_decrypt: fallbackError }; -void (async () => { +var secretboxLoadPromise = new Promise(async (resolve2) => { for (const libName of Object.keys(libs)) { try { - const lib = __require(libName); - if (libName === "libsodium-wrappers" && lib.ready) + const lib = await import(libName); + if (libName === "libsodium-wrappers" && lib.ready) { await lib.ready; + } Object.assign(methods, libs[libName](lib)); break; } catch { } } -})(); + resolve2(); +}); // src/util/util.ts var noop = /* @__PURE__ */ __name(() => { }, "noop"); -// src/networking/VoiceUDPSocket.ts -import { Buffer as Buffer3 } from "node:buffer"; -import { createSocket } from "node:dgram"; -import { EventEmitter } from "node:events"; -import { isIPv4 } from "node:net"; -function parseLocalPacket(message) { - const packet = Buffer3.from(message); - const ip = packet.slice(8, packet.indexOf(0, 8)).toString("utf8"); - if (!isIPv4(ip)) { - throw new Error("Malformed IP address"); - } - const port = packet.readUInt16BE(packet.length - 2); - return { ip, port }; -} -__name(parseLocalPacket, "parseLocalPacket"); -var KEEP_ALIVE_INTERVAL = 5e3; -var MAX_COUNTER_VALUE = 2 ** 32 - 1; -var VoiceUDPSocket = class extends EventEmitter { - static { - __name(this, "VoiceUDPSocket"); - } - /** - * The underlying network Socket for the VoiceUDPSocket. - */ - socket; - /** - * The socket details for Discord (remote) - */ - remote; - /** - * The counter used in the keep alive mechanism. - */ - keepAliveCounter = 0; - /** - * The buffer used to write the keep alive counter into. - */ - keepAliveBuffer; - /** - * The Node.js interval for the keep-alive mechanism. - */ - keepAliveInterval; - /** - * The time taken to receive a response to keep alive messages. - * - * @deprecated This field is no longer updated as keep alive messages are no longer tracked. - */ - ping; - /** - * Creates a new VoiceUDPSocket. - * - * @param remote - Details of the remote socket - */ - constructor(remote) { - super(); - this.socket = createSocket("udp4"); - this.socket.on("error", (error) => this.emit("error", error)); - this.socket.on("message", (buffer) => this.onMessage(buffer)); - this.socket.on("close", () => this.emit("close")); - this.remote = remote; - this.keepAliveBuffer = Buffer3.alloc(8); - this.keepAliveInterval = setInterval(() => this.keepAlive(), KEEP_ALIVE_INTERVAL); - setImmediate(() => this.keepAlive()); - } - /** - * Called when a message is received on the UDP socket. - * - * @param buffer - The received buffer - */ - onMessage(buffer) { - this.emit("message", buffer); - } - /** - * Called at a regular interval to check whether we are still able to send datagrams to Discord. - */ - keepAlive() { - this.keepAliveBuffer.writeUInt32LE(this.keepAliveCounter, 0); - this.send(this.keepAliveBuffer); - this.keepAliveCounter++; - if (this.keepAliveCounter > MAX_COUNTER_VALUE) { - this.keepAliveCounter = 0; - } - } - /** - * Sends a buffer to Discord. - * - * @param buffer - The buffer to send - */ - send(buffer) { - this.socket.send(buffer, this.remote.port, this.remote.ip); - } - /** - * Closes the socket, the instance will not be able to be reused. - */ - destroy() { - try { - this.socket.close(); - } catch { - } - clearInterval(this.keepAliveInterval); - } - /** - * Performs IP discovery to discover the local address and port to be used for the voice connection. - * - * @param ssrc - The SSRC received from Discord - */ - async performIPDiscovery(ssrc) { - return new Promise((resolve2, reject) => { - const listener = /* @__PURE__ */ __name((message) => { - try { - if (message.readUInt16BE(0) !== 2) - return; - const packet = parseLocalPacket(message); - this.socket.off("message", listener); - resolve2(packet); - } catch { - } - }, "listener"); - this.socket.on("message", listener); - this.socket.once("close", () => reject(new Error("Cannot perform IP discovery - socket closed"))); - const discoveryBuffer = Buffer3.alloc(74); - discoveryBuffer.writeUInt16BE(1, 0); - discoveryBuffer.writeUInt16BE(70, 2); - discoveryBuffer.writeUInt32BE(ssrc, 4); - this.send(discoveryBuffer); - }); - } -}; - -// src/networking/VoiceWebSocket.ts -import { EventEmitter as EventEmitter2 } from "node:events"; -import { VoiceOpcodes } from "discord-api-types/voice/v4"; -import WebSocket from "ws"; -var VoiceWebSocket = class extends EventEmitter2 { - static { - __name(this, "VoiceWebSocket"); - } - /** - * The current heartbeat interval, if any. - */ - heartbeatInterval; - /** - * The time (milliseconds since UNIX epoch) that the last heartbeat acknowledgement packet was received. - * This is set to 0 if an acknowledgement packet hasn't been received yet. - */ - lastHeartbeatAck; - /** - * The time (milliseconds since UNIX epoch) that the last heartbeat was sent. This is set to 0 if a heartbeat - * hasn't been sent yet. - */ - lastHeartbeatSend; - /** - * The number of consecutively missed heartbeats. - */ - missedHeartbeats = 0; - /** - * The last recorded ping. - */ - ping; - /** - * The debug logger function, if debugging is enabled. - */ - debug; - /** - * The underlying WebSocket of this wrapper. - */ - ws; - /** - * Creates a new VoiceWebSocket. - * - * @param address - The address to connect to - */ - constructor(address, debug) { - super(); - this.ws = new WebSocket(address); - this.ws.onmessage = (err) => this.onMessage(err); - this.ws.onopen = (err) => this.emit("open", err); - this.ws.onerror = (err) => this.emit("error", err instanceof Error ? err : err.error); - this.ws.onclose = (err) => this.emit("close", err); - this.lastHeartbeatAck = 0; - this.lastHeartbeatSend = 0; - this.debug = debug ? (message) => this.emit("debug", message) : null; - } - /** - * Destroys the VoiceWebSocket. The heartbeat interval is cleared, and the connection is closed. - */ - destroy() { - try { - this.debug?.("destroyed"); - this.setHeartbeatInterval(-1); - this.ws.close(1e3); - } catch (error) { - const err = error; - this.emit("error", err); - } - } - /** - * Handles message events on the WebSocket. Attempts to JSON parse the messages and emit them - * as packets. - * - * @param event - The message event - */ - onMessage(event) { - if (typeof event.data !== "string") - return; - this.debug?.(`<< ${event.data}`); - let packet; - try { - packet = JSON.parse(event.data); - } catch (error) { - const err = error; - this.emit("error", err); - return; - } - if (packet.op === VoiceOpcodes.HeartbeatAck) { - this.lastHeartbeatAck = Date.now(); - this.missedHeartbeats = 0; - this.ping = this.lastHeartbeatAck - this.lastHeartbeatSend; - } - this.emit("packet", packet); - } - /** - * Sends a JSON-stringifiable packet over the WebSocket. - * - * @param packet - The packet to send - */ - sendPacket(packet) { - try { - const stringified = JSON.stringify(packet); - this.debug?.(`>> ${stringified}`); - this.ws.send(stringified); - } catch (error) { - const err = error; - this.emit("error", err); - } - } - /** - * Sends a heartbeat over the WebSocket. - */ - sendHeartbeat() { - this.lastHeartbeatSend = Date.now(); - this.missedHeartbeats++; - const nonce2 = this.lastHeartbeatSend; - this.sendPacket({ - op: VoiceOpcodes.Heartbeat, - // eslint-disable-next-line id-length - d: nonce2 - }); - } - /** - * Sets/clears an interval to send heartbeats over the WebSocket. - * - * @param ms - The interval in milliseconds. If negative, the interval will be unset - */ - setHeartbeatInterval(ms) { - if (this.heartbeatInterval !== void 0) - clearInterval(this.heartbeatInterval); - if (ms > 0) { - this.heartbeatInterval = setInterval(() => { - if (this.lastHeartbeatSend !== 0 && this.missedHeartbeats >= 3) { - this.ws.close(); - this.setHeartbeatInterval(-1); - } - this.sendHeartbeat(); - }, ms); - } - } -}; - -// src/networking/Networking.ts -var CHANNELS = 2; -var TIMESTAMP_INC = 48e3 / 100 * CHANNELS; -var MAX_NONCE_SIZE = 2 ** 32 - 1; -var SUPPORTED_ENCRYPTION_MODES = ["xsalsa20_poly1305_lite", "xsalsa20_poly1305_suffix", "xsalsa20_poly1305"]; -var nonce = Buffer4.alloc(24); -function stringifyState(state) { - return JSON.stringify({ - ...state, - ws: Reflect.has(state, "ws"), - udp: Reflect.has(state, "udp") - }); -} -__name(stringifyState, "stringifyState"); -function chooseEncryptionMode(options) { - const option = options.find((option2) => SUPPORTED_ENCRYPTION_MODES.includes(option2)); - if (!option) { - throw new Error(`No compatible encryption modes. Available include: ${options.join(", ")}`); - } - return option; -} -__name(chooseEncryptionMode, "chooseEncryptionMode"); -function randomNBit(numberOfBits) { - return Math.floor(Math.random() * 2 ** numberOfBits); -} -__name(randomNBit, "randomNBit"); -var Networking = class extends EventEmitter3 { - static { - __name(this, "Networking"); - } - _state; - /** - * The debug logger function, if debugging is enabled. - */ - debug; - /** - * Creates a new Networking instance. - */ - constructor(options, debug) { - super(); - this.onWsOpen = this.onWsOpen.bind(this); - this.onChildError = this.onChildError.bind(this); - this.onWsPacket = this.onWsPacket.bind(this); - this.onWsClose = this.onWsClose.bind(this); - this.onWsDebug = this.onWsDebug.bind(this); - this.onUdpDebug = this.onUdpDebug.bind(this); - this.onUdpClose = this.onUdpClose.bind(this); - this.debug = debug ? (message) => this.emit("debug", message) : null; - this._state = { - code: 0 /* OpeningWs */, - ws: this.createWebSocket(options.endpoint), - connectionOptions: options - }; - } - /** - * Destroys the Networking instance, transitioning it into the Closed state. - */ - destroy() { - this.state = { - code: 6 /* Closed */ - }; - } - /** - * The current state of the networking instance. - */ - get state() { - return this._state; - } - /** - * Sets a new state for the networking instance, performing clean-up operations where necessary. - */ - set state(newState) { - const oldWs = Reflect.get(this._state, "ws"); - const newWs = Reflect.get(newState, "ws"); - if (oldWs && oldWs !== newWs) { - oldWs.off("debug", this.onWsDebug); - oldWs.on("error", noop); - oldWs.off("error", this.onChildError); - oldWs.off("open", this.onWsOpen); - oldWs.off("packet", this.onWsPacket); - oldWs.off("close", this.onWsClose); - oldWs.destroy(); - } - const oldUdp = Reflect.get(this._state, "udp"); - const newUdp = Reflect.get(newState, "udp"); - if (oldUdp && oldUdp !== newUdp) { - oldUdp.on("error", noop); - oldUdp.off("error", this.onChildError); - oldUdp.off("close", this.onUdpClose); - oldUdp.off("debug", this.onUdpDebug); - oldUdp.destroy(); - } - const oldState = this._state; - this._state = newState; - this.emit("stateChange", oldState, newState); - this.debug?.(`state change: -from ${stringifyState(oldState)} -to ${stringifyState(newState)}`); - } - /** - * Creates a new WebSocket to a Discord Voice gateway. - * - * @param endpoint - The endpoint to connect to - */ - createWebSocket(endpoint) { - const ws = new VoiceWebSocket(`wss://${endpoint}?v=4`, Boolean(this.debug)); - ws.on("error", this.onChildError); - ws.once("open", this.onWsOpen); - ws.on("packet", this.onWsPacket); - ws.once("close", this.onWsClose); - ws.on("debug", this.onWsDebug); - return ws; - } - /** - * Propagates errors from the children VoiceWebSocket and VoiceUDPSocket. - * - * @param error - The error that was emitted by a child - */ - onChildError(error) { - this.emit("error", error); - } - /** - * Called when the WebSocket opens. Depending on the state that the instance is in, - * it will either identify with a new session, or it will attempt to resume an existing session. - */ - onWsOpen() { - if (this.state.code === 0 /* OpeningWs */) { - const packet = { - op: VoiceOpcodes2.Identify, - d: { - server_id: this.state.connectionOptions.serverId, - user_id: this.state.connectionOptions.userId, - session_id: this.state.connectionOptions.sessionId, - token: this.state.connectionOptions.token - } - }; - this.state.ws.sendPacket(packet); - this.state = { - ...this.state, - code: 1 /* Identifying */ - }; - } else if (this.state.code === 5 /* Resuming */) { - const packet = { - op: VoiceOpcodes2.Resume, - d: { - server_id: this.state.connectionOptions.serverId, - session_id: this.state.connectionOptions.sessionId, - token: this.state.connectionOptions.token - } - }; - this.state.ws.sendPacket(packet); - } - } - /** - * Called when the WebSocket closes. Based on the reason for closing (given by the code parameter), - * the instance will either attempt to resume, or enter the closed state and emit a 'close' event - * with the close code, allowing the user to decide whether or not they would like to reconnect. - * - * @param code - The close code - */ - onWsClose({ code }) { - const canResume = code === 4015 || code < 4e3; - if (canResume && this.state.code === 4 /* Ready */) { - this.state = { - ...this.state, - code: 5 /* Resuming */, - ws: this.createWebSocket(this.state.connectionOptions.endpoint) - }; - } else if (this.state.code !== 6 /* Closed */) { - this.destroy(); - this.emit("close", code); - } - } - /** - * Called when the UDP socket has closed itself if it has stopped receiving replies from Discord. - */ - onUdpClose() { - if (this.state.code === 4 /* Ready */) { - this.state = { - ...this.state, - code: 5 /* Resuming */, - ws: this.createWebSocket(this.state.connectionOptions.endpoint) - }; - } - } - /** - * Called when a packet is received on the connection's WebSocket. - * - * @param packet - The received packet - */ - onWsPacket(packet) { - if (packet.op === VoiceOpcodes2.Hello && this.state.code !== 6 /* Closed */) { - this.state.ws.setHeartbeatInterval(packet.d.heartbeat_interval); - } else if (packet.op === VoiceOpcodes2.Ready && this.state.code === 1 /* Identifying */) { - const { ip, port, ssrc, modes } = packet.d; - const udp = new VoiceUDPSocket({ ip, port }); - udp.on("error", this.onChildError); - udp.on("debug", this.onUdpDebug); - udp.once("close", this.onUdpClose); - udp.performIPDiscovery(ssrc).then((localConfig) => { - if (this.state.code !== 2 /* UdpHandshaking */) - return; - this.state.ws.sendPacket({ - op: VoiceOpcodes2.SelectProtocol, - d: { - protocol: "udp", - data: { - address: localConfig.ip, - port: localConfig.port, - mode: chooseEncryptionMode(modes) - } - } - }); - this.state = { - ...this.state, - code: 3 /* SelectingProtocol */ - }; - }).catch((error) => this.emit("error", error)); - this.state = { - ...this.state, - code: 2 /* UdpHandshaking */, - udp, - connectionData: { - ssrc - } - }; - } else if (packet.op === VoiceOpcodes2.SessionDescription && this.state.code === 3 /* SelectingProtocol */) { - const { mode: encryptionMode, secret_key: secretKey } = packet.d; - this.state = { - ...this.state, - code: 4 /* Ready */, - connectionData: { - ...this.state.connectionData, - encryptionMode, - secretKey: new Uint8Array(secretKey), - sequence: randomNBit(16), - timestamp: randomNBit(32), - nonce: 0, - nonceBuffer: Buffer4.alloc(24), - speaking: false, - packetsPlayed: 0 - } - }; - } else if (packet.op === VoiceOpcodes2.Resumed && this.state.code === 5 /* Resuming */) { - this.state = { - ...this.state, - code: 4 /* Ready */ - }; - this.state.connectionData.speaking = false; - } - } - /** - * Propagates debug messages from the child WebSocket. - * - * @param message - The emitted debug message - */ - onWsDebug(message) { - this.debug?.(`[WS] ${message}`); - } - /** - * Propagates debug messages from the child UDPSocket. - * - * @param message - The emitted debug message - */ - onUdpDebug(message) { - this.debug?.(`[UDP] ${message}`); - } - /** - * Prepares an Opus packet for playback. This includes attaching metadata to it and encrypting it. - * It will be stored within the instance, and can be played by dispatchAudio() - * - * @remarks - * Calling this method while there is already a prepared audio packet that has not yet been dispatched - * will overwrite the existing audio packet. This should be avoided. - * @param opusPacket - The Opus packet to encrypt - * @returns The audio packet that was prepared - */ - prepareAudioPacket(opusPacket) { - const state = this.state; - if (state.code !== 4 /* Ready */) - return; - state.preparedPacket = this.createAudioPacket(opusPacket, state.connectionData); - return state.preparedPacket; - } - /** - * Dispatches the audio packet previously prepared by prepareAudioPacket(opusPacket). The audio packet - * is consumed and cannot be dispatched again. - */ - dispatchAudio() { - const state = this.state; - if (state.code !== 4 /* Ready */) - return false; - if (state.preparedPacket !== void 0) { - this.playAudioPacket(state.preparedPacket); - state.preparedPacket = void 0; - return true; - } - return false; - } - /** - * Plays an audio packet, updating timing metadata used for playback. - * - * @param audioPacket - The audio packet to play - */ - playAudioPacket(audioPacket) { - const state = this.state; - if (state.code !== 4 /* Ready */) - return; - const { connectionData } = state; - connectionData.packetsPlayed++; - connectionData.sequence++; - connectionData.timestamp += TIMESTAMP_INC; - if (connectionData.sequence >= 2 ** 16) - connectionData.sequence = 0; - if (connectionData.timestamp >= 2 ** 32) - connectionData.timestamp = 0; - this.setSpeaking(true); - state.udp.send(audioPacket); - } - /** - * Sends a packet to the voice gateway indicating that the client has start/stopped sending - * audio. - * - * @param speaking - Whether or not the client should be shown as speaking - */ - setSpeaking(speaking) { - const state = this.state; - if (state.code !== 4 /* Ready */) - return; - if (state.connectionData.speaking === speaking) - return; - state.connectionData.speaking = speaking; - state.ws.sendPacket({ - op: VoiceOpcodes2.Speaking, - d: { - speaking: speaking ? 1 : 0, - delay: 0, - ssrc: state.connectionData.ssrc - } - }); - } - /** - * Creates a new audio packet from an Opus packet. This involves encrypting the packet, - * then prepending a header that includes metadata. - * - * @param opusPacket - The Opus packet to prepare - * @param connectionData - The current connection data of the instance - */ - createAudioPacket(opusPacket, connectionData) { - const packetBuffer = Buffer4.alloc(12); - packetBuffer[0] = 128; - packetBuffer[1] = 120; - const { sequence, timestamp, ssrc } = connectionData; - packetBuffer.writeUIntBE(sequence, 2, 2); - packetBuffer.writeUIntBE(timestamp, 4, 4); - packetBuffer.writeUIntBE(ssrc, 8, 4); - packetBuffer.copy(nonce, 0, 0, 12); - return Buffer4.concat([packetBuffer, ...this.encryptOpusPacket(opusPacket, connectionData)]); - } - /** - * Encrypts an Opus packet using the format agreed upon by the instance and Discord. - * - * @param opusPacket - The Opus packet to encrypt - * @param connectionData - The current connection data of the instance - */ - encryptOpusPacket(opusPacket, connectionData) { - const { secretKey, encryptionMode } = connectionData; - if (encryptionMode === "xsalsa20_poly1305_lite") { - connectionData.nonce++; - if (connectionData.nonce > MAX_NONCE_SIZE) - connectionData.nonce = 0; - connectionData.nonceBuffer.writeUInt32BE(connectionData.nonce, 0); - return [ - methods.close(opusPacket, connectionData.nonceBuffer, secretKey), - connectionData.nonceBuffer.slice(0, 4) - ]; - } else if (encryptionMode === "xsalsa20_poly1305_suffix") { - const random = methods.random(24, connectionData.nonceBuffer); - return [methods.close(opusPacket, random, secretKey), random]; - } - return [methods.close(opusPacket, nonce, secretKey)]; - } -}; - -// src/receive/VoiceReceiver.ts -import { Buffer as Buffer6 } from "node:buffer"; -import { VoiceOpcodes as VoiceOpcodes3 } from "discord-api-types/voice/v4"; - -// src/receive/AudioReceiveStream.ts -import { Readable } from "node:stream"; +// src/networking/DAVESession.ts +import { Buffer as Buffer4 } from "buffer"; +import { EventEmitter as EventEmitter2 } from "events"; // src/audio/AudioPlayer.ts -import { Buffer as Buffer5 } from "node:buffer"; -import { EventEmitter as EventEmitter4 } from "node:events"; +import { Buffer as Buffer3 } from "buffer"; +import { EventEmitter } from "events"; // src/audio/AudioPlayerError.ts var AudioPlayerError = class extends Error { @@ -896,7 +246,7 @@ var PlayerSubscription = class { }; // src/audio/AudioPlayer.ts -var SILENCE_FRAME = Buffer5.from([248, 255, 254]); +var SILENCE_FRAME = Buffer3.from([248, 255, 254]); var NoSubscriberBehavior = /* @__PURE__ */ ((NoSubscriberBehavior2) => { NoSubscriberBehavior2["Pause"] = "pause"; NoSubscriberBehavior2["Play"] = "play"; @@ -911,15 +261,15 @@ var AudioPlayerStatus = /* @__PURE__ */ ((AudioPlayerStatus2) => { AudioPlayerStatus2["Playing"] = "playing"; return AudioPlayerStatus2; })(AudioPlayerStatus || {}); -function stringifyState2(state) { +function stringifyState(state) { return JSON.stringify({ ...state, resource: Reflect.has(state, "resource"), stepTimeout: Reflect.has(state, "stepTimeout") }); } -__name(stringifyState2, "stringifyState"); -var AudioPlayer = class extends EventEmitter4 { +__name(stringifyState, "stringifyState"); +var AudioPlayer = class extends EventEmitter { static { __name(this, "AudioPlayer"); } @@ -1000,13 +350,13 @@ var AudioPlayer = class extends EventEmitter4 { } /** * The state that the player is in. + * + * @remarks + * The setter will perform clean-up operations where necessary. */ get state() { return this._state; } - /** - * Sets a new state for the player, performing clean-up operations where necessary. - */ set state(newState) { const oldState = this._state; const newResource = Reflect.get(newState, "resource"); @@ -1037,8 +387,8 @@ var AudioPlayer = class extends EventEmitter4 { this.emit(newState.status, oldState, this._state); } this.debug?.(`state change: -from ${stringifyState2(oldState)} -to ${stringifyState2(newState)}`); +from ${stringifyState(oldState)} +to ${stringifyState(newState)}`); } /** * Plays a new resource on the player. If the player is already playing a resource, the existing resource is destroyed @@ -1122,8 +472,7 @@ to ${stringifyState2(newState)}`); * @returns `true` if the player was successfully paused, otherwise `false` */ pause(interpolateSilence = true) { - if (this.state.status !== "playing" /* Playing */) - return false; + if (this.state.status !== "playing" /* Playing */) return false; this.state = { ...this.state, status: "paused" /* Paused */, @@ -1137,8 +486,7 @@ to ${stringifyState2(newState)}`); * @returns `true` if the player was successfully unpaused, otherwise `false` */ unpause() { - if (this.state.status !== "paused" /* Paused */) - return false; + if (this.state.status !== "paused" /* Paused */) return false; this.state = { ...this.state, status: "playing" /* Playing */, @@ -1154,8 +502,7 @@ to ${stringifyState2(newState)}`); * @returns `true` if the player will come to a stop, otherwise `false` */ stop(force = false) { - if (this.state.status === "idle" /* Idle */) - return false; + if (this.state.status === "idle" /* Idle */) return false; if (force || this.state.resource.silencePaddingFrames === 0) { this.state = { status: "idle" /* Idle */ @@ -1172,8 +519,7 @@ to ${stringifyState2(newState)}`); */ checkPlayable() { const state = this._state; - if (state.status === "idle" /* Idle */ || state.status === "buffering" /* Buffering */) - return false; + if (state.status === "idle" /* Idle */ || state.status === "buffering" /* Buffering */) return false; if (!state.resource.readable) { this.state = { status: "idle" /* Idle */ @@ -1189,8 +535,7 @@ to ${stringifyState2(newState)}`); // @ts-ignore _stepDispatch() { const state = this._state; - if (state.status === "idle" /* Idle */ || state.status === "buffering" /* Buffering */) - return; + if (state.status === "idle" /* Idle */ || state.status === "buffering" /* Buffering */) return; for (const connection of this.playable) { connection.dispatchAudio(); } @@ -1203,8 +548,7 @@ to ${stringifyState2(newState)}`); // @ts-ignore _stepPrepare() { const state = this._state; - if (state.status === "idle" /* Idle */ || state.status === "buffering" /* Buffering */) - return; + if (state.status === "idle" /* Idle */ || state.status === "buffering" /* Buffering */) return; const playable = this.playable; if (state.status === "autopaused" /* AutoPaused */ && playable.length > 0) { this.state = { @@ -1277,7 +621,1180 @@ function createAudioPlayer(options) { } __name(createAudioPlayer, "createAudioPlayer"); +// src/networking/DAVESession.ts +var Davey = null; +var TRANSITION_EXPIRY = 10; +var TRANSITION_EXPIRY_PENDING_DOWNGRADE = 24; +var DEFAULT_DECRYPTION_FAILURE_TOLERANCE = 36; +var daveLoadPromise = new Promise(async (resolve2) => { + try { + const lib = await import("@snazzah/davey"); + Davey = lib; + } catch { + } + resolve2(); +}); +function getMaxProtocolVersion() { + return Davey?.DAVE_PROTOCOL_VERSION; +} +__name(getMaxProtocolVersion, "getMaxProtocolVersion"); +var DAVESession = class extends EventEmitter2 { + static { + __name(this, "DAVESession"); + } + /** + * The channel id represented by this session. + */ + channelId; + /** + * The user id represented by this session. + */ + userId; + /** + * The protocol version being used. + */ + protocolVersion; + /** + * The last transition id executed. + */ + lastTransitionId; + /** + * The pending transition. + */ + pendingTransition; + /** + * Whether this session was downgraded previously. + */ + downgraded = false; + /** + * The amount of consecutive failures encountered when decrypting. + */ + consecutiveFailures = 0; + /** + * The amount of consecutive failures needed to attempt to recover. + */ + failureTolerance; + /** + * Whether this session is currently re-initializing due to an invalid transition. + */ + reinitializing = false; + /** + * The underlying DAVE Session of this wrapper. + */ + session; + constructor(protocolVersion, userId, channelId, options) { + if (Davey === null) + throw new Error( + `Cannot utilize the DAVE protocol as the @snazzah/davey package has not been installed. +- Use the generateDependencyReport() function for more information. +` + ); + super(); + this.protocolVersion = protocolVersion; + this.userId = userId; + this.channelId = channelId; + this.failureTolerance = options.decryptionFailureTolerance ?? DEFAULT_DECRYPTION_FAILURE_TOLERANCE; + } + /** + * The current voice privacy code of the session. Will be `null` if there is no session. + */ + get voicePrivacyCode() { + if (this.protocolVersion === 0 || !this.session?.voicePrivacyCode) { + return null; + } + return this.session.voicePrivacyCode; + } + /** + * Gets the verification code for a user in the session. + * + * @throws Will throw if there is not an active session or the user id provided is invalid or not in the session. + */ + async getVerificationCode(userId) { + if (!this.session) throw new Error("Session not available"); + return this.session.getVerificationCode(userId); + } + /** + * Re-initializes (or initializes) the underlying session. + */ + reinit() { + if (this.protocolVersion > 0) { + if (this.session) { + this.session.reinit(this.protocolVersion, this.userId, this.channelId); + this.emit("debug", `Session reinitialized for protocol version ${this.protocolVersion}`); + } else { + this.session = new Davey.DAVESession(this.protocolVersion, this.userId, this.channelId); + this.emit("debug", `Session initialized for protocol version ${this.protocolVersion}`); + } + this.emit("keyPackage", this.session.getSerializedKeyPackage()); + } else if (this.session) { + this.session.reset(); + this.session.setPassthroughMode(true, TRANSITION_EXPIRY); + this.emit("debug", "Session reset"); + } + } + /** + * Set the external sender for this session. + * + * @param externalSender - The external sender + */ + setExternalSender(externalSender) { + if (!this.session) throw new Error("No session available"); + this.session.setExternalSender(externalSender); + this.emit("debug", "Set MLS external sender"); + } + /** + * Prepare for a transition. + * + * @param data - The transition data + * @returns Whether we should signal to the voice server that we are ready + */ + prepareTransition(data) { + this.emit("debug", `Preparing for transition (${data.transition_id}, v${data.protocol_version})`); + this.pendingTransition = data; + if (data.transition_id === 0) { + this.executeTransition(data.transition_id); + } else { + if (data.protocol_version === 0) this.session?.setPassthroughMode(true, TRANSITION_EXPIRY_PENDING_DOWNGRADE); + return true; + } + return false; + } + /** + * Execute a transition. + * + * @param transitionId - The transition id to execute on + */ + executeTransition(transitionId) { + this.emit("debug", `Executing transition (${transitionId})`); + if (!this.pendingTransition) { + this.emit("debug", `Received execute transition, but we don't have a pending transition for ${transitionId}`); + return; + } + let transitioned = false; + if (transitionId === this.pendingTransition.transition_id) { + const oldVersion = this.protocolVersion; + this.protocolVersion = this.pendingTransition.protocol_version; + if (oldVersion !== this.protocolVersion && this.protocolVersion === 0) { + this.downgraded = true; + this.emit("debug", "Session downgraded"); + } else if (transitionId > 0 && this.downgraded) { + this.downgraded = false; + this.session?.setPassthroughMode(true, TRANSITION_EXPIRY); + this.emit("debug", "Session upgraded"); + } + transitioned = true; + this.reinitializing = false; + this.lastTransitionId = transitionId; + this.emit("debug", `Transition executed (v${oldVersion} -> v${this.protocolVersion}, id: ${transitionId})`); + } else { + this.emit( + "debug", + `Received execute transition for an unexpected transition id (expected: ${this.pendingTransition.transition_id}, actual: ${transitionId})` + ); + } + this.pendingTransition = void 0; + return transitioned; + } + /** + * Prepare for a new epoch. + * + * @param data - The epoch data + */ + prepareEpoch(data) { + this.emit("debug", `Preparing for epoch (${data.epoch})`); + if (data.epoch === 1) { + this.protocolVersion = data.protocol_version; + this.reinit(); + } + } + /** + * Recover from an invalid transition by re-initializing. + * + * @param transitionId - The transition id to invalidate + */ + recoverFromInvalidTransition(transitionId) { + if (this.reinitializing) return; + this.emit("debug", `Invalidating transition ${transitionId}`); + this.reinitializing = true; + this.consecutiveFailures = 0; + this.emit("invalidateTransition", transitionId); + this.reinit(); + } + /** + * Processes proposals from the MLS group. + * + * @param payload - The binary message payload + * @param connectedClients - The set of connected client IDs + * @returns The payload to send back to the voice server, if there is one + */ + processProposals(payload, connectedClients) { + if (!this.session) throw new Error("No session available"); + const optype = payload.readUInt8(0); + const { commit, welcome } = this.session.processProposals( + optype, + payload.subarray(1), + Array.from(connectedClients) + ); + this.emit("debug", "MLS proposals processed"); + if (!commit) return; + return welcome ? Buffer4.concat([commit, welcome]) : commit; + } + /** + * Processes a commit from the MLS group. + * + * @param payload - The payload + * @returns The transaction id and whether it was successful + */ + processCommit(payload) { + if (!this.session) throw new Error("No session available"); + const transitionId = payload.readUInt16BE(0); + try { + this.session.processCommit(payload.subarray(2)); + if (transitionId === 0) { + this.reinitializing = false; + this.lastTransitionId = transitionId; + } else { + this.pendingTransition = { transition_id: transitionId, protocol_version: this.protocolVersion }; + } + this.emit("debug", `MLS commit processed (transition id: ${transitionId})`); + return { transitionId, success: true }; + } catch (error) { + this.emit("debug", `MLS commit errored from transition ${transitionId}: ${error}`); + this.recoverFromInvalidTransition(transitionId); + return { transitionId, success: false }; + } + } + /** + * Processes a welcome from the MLS group. + * + * @param payload - The payload + * @returns The transaction id and whether it was successful + */ + processWelcome(payload) { + if (!this.session) throw new Error("No session available"); + const transitionId = payload.readUInt16BE(0); + try { + this.session.processWelcome(payload.subarray(2)); + if (transitionId === 0) { + this.reinitializing = false; + this.lastTransitionId = transitionId; + } else { + this.pendingTransition = { transition_id: transitionId, protocol_version: this.protocolVersion }; + } + this.emit("debug", `MLS welcome processed (transition id: ${transitionId})`); + return { transitionId, success: true }; + } catch (error) { + this.emit("debug", `MLS welcome errored from transition ${transitionId}: ${error}`); + this.recoverFromInvalidTransition(transitionId); + return { transitionId, success: false }; + } + } + /** + * Encrypt a packet using end-to-end encryption. + * + * @param packet - The packet to encrypt + */ + encrypt(packet) { + if (this.protocolVersion === 0 || !this.session?.ready || packet.equals(SILENCE_FRAME)) return packet; + return this.session.encryptOpus(packet); + } + /** + * Decrypt a packet using end-to-end encryption. + * + * @param packet - The packet to decrypt + * @param userId - The user id that sent the packet + * @returns The decrypted packet, or `null` if the decryption failed but should be ignored + */ + decrypt(packet, userId) { + const canDecrypt = this.session?.ready && (this.protocolVersion !== 0 || this.session?.canPassthrough(userId)); + if (packet.equals(SILENCE_FRAME) || !canDecrypt || !this.session) return packet; + try { + const buffer = this.session.decrypt(userId, Davey.MediaType.AUDIO, packet); + this.consecutiveFailures = 0; + return buffer; + } catch (error) { + if (!this.reinitializing && !this.pendingTransition) { + this.consecutiveFailures++; + this.emit("debug", `Failed to decrypt a packet (${this.consecutiveFailures} consecutive fails)`); + if (this.consecutiveFailures > this.failureTolerance) { + if (this.lastTransitionId) this.recoverFromInvalidTransition(this.lastTransitionId); + else throw error; + } + } else if (this.reinitializing) { + this.emit("debug", "Failed to decrypt a packet (reinitializing session)"); + } else if (this.pendingTransition) { + this.emit( + "debug", + `Failed to decrypt a packet (pending transition ${this.pendingTransition.transition_id} to v${this.pendingTransition.protocol_version})` + ); + } + } + return null; + } + /** + * Resets the session. + */ + destroy() { + try { + this.session?.reset(); + } catch { + } + } +}; + +// src/networking/VoiceUDPSocket.ts +import { Buffer as Buffer5 } from "buffer"; +import { createSocket } from "dgram"; +import { EventEmitter as EventEmitter3 } from "events"; +import { isIPv4 } from "net"; +function parseLocalPacket(message) { + const packet = Buffer5.from(message); + const ip = packet.slice(8, packet.indexOf(0, 8)).toString("utf8"); + if (!isIPv4(ip)) { + throw new Error("Malformed IP address"); + } + const port = packet.readUInt16BE(packet.length - 2); + return { ip, port }; +} +__name(parseLocalPacket, "parseLocalPacket"); +var KEEP_ALIVE_INTERVAL = 5e3; +var MAX_COUNTER_VALUE = 2 ** 32 - 1; +var VoiceUDPSocket = class extends EventEmitter3 { + static { + __name(this, "VoiceUDPSocket"); + } + /** + * The underlying network Socket for the VoiceUDPSocket. + */ + socket; + /** + * The socket details for Discord (remote) + */ + remote; + /** + * The counter used in the keep alive mechanism. + */ + keepAliveCounter = 0; + /** + * The buffer used to write the keep alive counter into. + */ + keepAliveBuffer; + /** + * The Node.js interval for the keep-alive mechanism. + */ + keepAliveInterval; + /** + * The time taken to receive a response to keep alive messages. + * + * @deprecated This field is no longer updated as keep alive messages are no longer tracked. + */ + ping; + /** + * Creates a new VoiceUDPSocket. + * + * @param remote - Details of the remote socket + */ + constructor(remote) { + super(); + this.socket = createSocket("udp4"); + this.socket.on("error", (error) => this.emit("error", error)); + this.socket.on("message", (buffer) => this.onMessage(buffer)); + this.socket.on("close", () => this.emit("close")); + this.remote = remote; + this.keepAliveBuffer = Buffer5.alloc(8); + this.keepAliveInterval = setInterval(() => this.keepAlive(), KEEP_ALIVE_INTERVAL); + setImmediate(() => this.keepAlive()); + } + /** + * Called when a message is received on the UDP socket. + * + * @param buffer - The received buffer + */ + onMessage(buffer) { + this.emit("message", buffer); + } + /** + * Called at a regular interval to check whether we are still able to send datagrams to Discord. + */ + keepAlive() { + this.keepAliveBuffer.writeUInt32LE(this.keepAliveCounter, 0); + this.send(this.keepAliveBuffer); + this.keepAliveCounter++; + if (this.keepAliveCounter > MAX_COUNTER_VALUE) { + this.keepAliveCounter = 0; + } + } + /** + * Sends a buffer to Discord. + * + * @param buffer - The buffer to send + */ + send(buffer) { + this.socket.send(buffer, this.remote.port, this.remote.ip); + } + /** + * Closes the socket, the instance will not be able to be reused. + */ + destroy() { + try { + this.socket.close(); + } catch { + } + clearInterval(this.keepAliveInterval); + } + /** + * Performs IP discovery to discover the local address and port to be used for the voice connection. + * + * @param ssrc - The SSRC received from Discord + */ + async performIPDiscovery(ssrc) { + return new Promise((resolve2, reject) => { + const listener = /* @__PURE__ */ __name((message) => { + try { + if (message.readUInt16BE(0) !== 2) return; + const packet = parseLocalPacket(message); + this.socket.off("message", listener); + resolve2(packet); + } catch { + } + }, "listener"); + this.socket.on("message", listener); + this.socket.once("close", () => reject(new Error("Cannot perform IP discovery - socket closed"))); + const discoveryBuffer = Buffer5.alloc(74); + discoveryBuffer.writeUInt16BE(1, 0); + discoveryBuffer.writeUInt16BE(70, 2); + discoveryBuffer.writeUInt32BE(ssrc, 4); + this.send(discoveryBuffer); + }); + } +}; + +// src/networking/VoiceWebSocket.ts +import { Buffer as Buffer6 } from "buffer"; +import { EventEmitter as EventEmitter4 } from "events"; +import { VoiceOpcodes } from "discord-api-types/voice/v8"; +import WebSocket from "ws"; +var VoiceWebSocket = class extends EventEmitter4 { + static { + __name(this, "VoiceWebSocket"); + } + /** + * The current heartbeat interval, if any. + */ + heartbeatInterval; + /** + * The time (milliseconds since UNIX epoch) that the last heartbeat acknowledgement packet was received. + * This is set to 0 if an acknowledgement packet hasn't been received yet. + */ + lastHeartbeatAck; + /** + * The time (milliseconds since UNIX epoch) that the last heartbeat was sent. This is set to 0 if a heartbeat + * hasn't been sent yet. + */ + lastHeartbeatSend; + /** + * The number of consecutively missed heartbeats. + */ + missedHeartbeats = 0; + /** + * The last recorded ping. + */ + ping; + /** + * The last sequence number acknowledged from Discord. Will be `-1` if no sequence numbered messages have been received. + */ + sequence = -1; + /** + * The debug logger function, if debugging is enabled. + */ + debug; + /** + * The underlying WebSocket of this wrapper. + */ + ws; + /** + * Creates a new VoiceWebSocket. + * + * @param address - The address to connect to + */ + constructor(address, debug) { + super(); + this.ws = new WebSocket(address); + this.ws.onmessage = (err) => this.onMessage(err); + this.ws.onopen = (err) => this.emit("open", err); + this.ws.onerror = (err) => this.emit("error", err instanceof Error ? err : err.error); + this.ws.onclose = (err) => this.emit("close", err); + this.lastHeartbeatAck = 0; + this.lastHeartbeatSend = 0; + this.debug = debug ? (message) => this.emit("debug", message) : null; + } + /** + * Destroys the VoiceWebSocket. The heartbeat interval is cleared, and the connection is closed. + */ + destroy() { + try { + this.debug?.("destroyed"); + this.setHeartbeatInterval(-1); + this.ws.close(1e3); + } catch (error) { + const err = error; + this.emit("error", err); + } + } + /** + * Handles message events on the WebSocket. Attempts to JSON parse the messages and emit them + * as packets. Binary messages will be parsed and emitted. + * + * @param event - The message event + */ + onMessage(event) { + if (event.data instanceof Buffer6 || event.data instanceof ArrayBuffer) { + const buffer = event.data instanceof ArrayBuffer ? Buffer6.from(event.data) : event.data; + const seq = buffer.readUInt16BE(0); + const op = buffer.readUInt8(2); + const payload = buffer.subarray(3); + this.sequence = seq; + this.debug?.(`<< [bin] opcode ${op}, seq ${seq}, ${payload.byteLength} bytes`); + this.emit("binary", { op, seq, payload }); + return; + } else if (typeof event.data !== "string") { + return; + } + this.debug?.(`<< ${event.data}`); + let packet; + try { + packet = JSON.parse(event.data); + } catch (error) { + const err = error; + this.emit("error", err); + return; + } + if (packet.seq) { + this.sequence = packet.seq; + } + if (packet.op === VoiceOpcodes.HeartbeatAck) { + this.lastHeartbeatAck = Date.now(); + this.missedHeartbeats = 0; + this.ping = this.lastHeartbeatAck - this.lastHeartbeatSend; + } + this.emit("packet", packet); + } + /** + * Sends a JSON-stringifiable packet over the WebSocket. + * + * @param packet - The packet to send + */ + sendPacket(packet) { + try { + const stringified = JSON.stringify(packet); + this.debug?.(`>> ${stringified}`); + this.ws.send(stringified); + } catch (error) { + const err = error; + this.emit("error", err); + } + } + /** + * Sends a binary message over the WebSocket. + * + * @param opcode - The opcode to use + * @param payload - The payload to send + */ + sendBinaryMessage(opcode, payload) { + try { + const message = Buffer6.concat([new Uint8Array([opcode]), payload]); + this.debug?.(`>> [bin] opcode ${opcode}, ${payload.byteLength} bytes`); + this.ws.send(message); + } catch (error) { + const err = error; + this.emit("error", err); + } + } + /** + * Sends a heartbeat over the WebSocket. + */ + sendHeartbeat() { + this.lastHeartbeatSend = Date.now(); + this.missedHeartbeats++; + const nonce2 = this.lastHeartbeatSend; + this.sendPacket({ + op: VoiceOpcodes.Heartbeat, + // eslint-disable-next-line id-length + d: { + // eslint-disable-next-line id-length + t: nonce2, + seq_ack: this.sequence + } + }); + } + /** + * Sets/clears an interval to send heartbeats over the WebSocket. + * + * @param ms - The interval in milliseconds. If negative, the interval will be unset + */ + setHeartbeatInterval(ms) { + if (this.heartbeatInterval !== void 0) clearInterval(this.heartbeatInterval); + if (ms > 0) { + this.heartbeatInterval = setInterval(() => { + if (this.lastHeartbeatSend !== 0 && this.missedHeartbeats >= 3) { + this.ws.close(); + this.setHeartbeatInterval(-1); + } + this.sendHeartbeat(); + }, ms); + } + } +}; + +// src/networking/Networking.ts +var CHANNELS = 2; +var TIMESTAMP_INC = 48e3 / 100 * CHANNELS; +var MAX_NONCE_SIZE = 2 ** 32 - 1; +var SUPPORTED_ENCRYPTION_MODES = [VoiceEncryptionMode.AeadXChaCha20Poly1305RtpSize]; +if (crypto.getCiphers().includes("aes-256-gcm")) { + SUPPORTED_ENCRYPTION_MODES.unshift(VoiceEncryptionMode.AeadAes256GcmRtpSize); +} +var NetworkingStatusCode = /* @__PURE__ */ ((NetworkingStatusCode2) => { + NetworkingStatusCode2[NetworkingStatusCode2["OpeningWs"] = 0] = "OpeningWs"; + NetworkingStatusCode2[NetworkingStatusCode2["Identifying"] = 1] = "Identifying"; + NetworkingStatusCode2[NetworkingStatusCode2["UdpHandshaking"] = 2] = "UdpHandshaking"; + NetworkingStatusCode2[NetworkingStatusCode2["SelectingProtocol"] = 3] = "SelectingProtocol"; + NetworkingStatusCode2[NetworkingStatusCode2["Ready"] = 4] = "Ready"; + NetworkingStatusCode2[NetworkingStatusCode2["Resuming"] = 5] = "Resuming"; + NetworkingStatusCode2[NetworkingStatusCode2["Closed"] = 6] = "Closed"; + return NetworkingStatusCode2; +})(NetworkingStatusCode || {}); +var nonce = Buffer7.alloc(24); +function stringifyState2(state) { + return JSON.stringify({ + ...state, + ws: Reflect.has(state, "ws"), + udp: Reflect.has(state, "udp") + }); +} +__name(stringifyState2, "stringifyState"); +function chooseEncryptionMode(options) { + const option = options.find((option2) => SUPPORTED_ENCRYPTION_MODES.includes(option2)); + if (!option) { + throw new Error(`No compatible encryption modes. Available include: ${options.join(", ")}`); + } + return option; +} +__name(chooseEncryptionMode, "chooseEncryptionMode"); +function randomNBit(numberOfBits) { + return Math.floor(Math.random() * 2 ** numberOfBits); +} +__name(randomNBit, "randomNBit"); +var Networking = class extends EventEmitter5 { + static { + __name(this, "Networking"); + } + _state; + /** + * The debug logger function, if debugging is enabled. + */ + debug; + /** + * The options used to create this Networking instance. + */ + options; + /** + * Creates a new Networking instance. + */ + constructor(connectionOptions, options) { + super(); + this.onWsOpen = this.onWsOpen.bind(this); + this.onChildError = this.onChildError.bind(this); + this.onWsPacket = this.onWsPacket.bind(this); + this.onWsBinary = this.onWsBinary.bind(this); + this.onWsClose = this.onWsClose.bind(this); + this.onWsDebug = this.onWsDebug.bind(this); + this.onUdpDebug = this.onUdpDebug.bind(this); + this.onUdpClose = this.onUdpClose.bind(this); + this.onDaveDebug = this.onDaveDebug.bind(this); + this.onDaveKeyPackage = this.onDaveKeyPackage.bind(this); + this.onDaveInvalidateTransition = this.onDaveInvalidateTransition.bind(this); + this.debug = options?.debug ? (message) => this.emit("debug", message) : null; + this._state = { + code: 0 /* OpeningWs */, + ws: this.createWebSocket(connectionOptions.endpoint), + connectionOptions + }; + this.options = options; + } + /** + * Destroys the Networking instance, transitioning it into the Closed state. + */ + destroy() { + this.state = { + code: 6 /* Closed */ + }; + } + /** + * The current state of the networking instance. + * + * @remarks + * The setter will perform clean-up operations where necessary. + */ + get state() { + return this._state; + } + set state(newState) { + const oldWs = Reflect.get(this._state, "ws"); + const newWs = Reflect.get(newState, "ws"); + if (oldWs && oldWs !== newWs) { + oldWs.off("debug", this.onWsDebug); + oldWs.on("error", noop); + oldWs.off("error", this.onChildError); + oldWs.off("open", this.onWsOpen); + oldWs.off("packet", this.onWsPacket); + oldWs.off("binary", this.onWsBinary); + oldWs.off("close", this.onWsClose); + oldWs.destroy(); + } + const oldUdp = Reflect.get(this._state, "udp"); + const newUdp = Reflect.get(newState, "udp"); + if (oldUdp && oldUdp !== newUdp) { + oldUdp.on("error", noop); + oldUdp.off("error", this.onChildError); + oldUdp.off("close", this.onUdpClose); + oldUdp.off("debug", this.onUdpDebug); + oldUdp.destroy(); + } + const oldDave = Reflect.get(this._state, "dave"); + const newDave = Reflect.get(newState, "dave"); + if (oldDave && oldDave !== newDave) { + oldDave.off("error", this.onChildError); + oldDave.off("debug", this.onDaveDebug); + oldDave.off("keyPackage", this.onDaveKeyPackage); + oldDave.off("invalidateTransition", this.onDaveInvalidateTransition); + oldDave.destroy(); + } + const oldState = this._state; + this._state = newState; + this.emit("stateChange", oldState, newState); + this.debug?.(`state change: +from ${stringifyState2(oldState)} +to ${stringifyState2(newState)}`); + } + /** + * Creates a new WebSocket to a Discord Voice gateway. + * + * @param endpoint - The endpoint to connect to + * @param lastSequence - The last sequence to set for this WebSocket + */ + createWebSocket(endpoint, lastSequence) { + const ws = new VoiceWebSocket(`wss://${endpoint}?v=8`, Boolean(this.debug)); + if (lastSequence !== void 0) { + ws.sequence = lastSequence; + } + ws.on("error", this.onChildError); + ws.once("open", this.onWsOpen); + ws.on("packet", this.onWsPacket); + ws.on("binary", this.onWsBinary); + ws.once("close", this.onWsClose); + ws.on("debug", this.onWsDebug); + return ws; + } + /** + * Creates a new DAVE session for this voice connection if we can create one. + * + * @param protocolVersion - The protocol version to use + */ + createDaveSession(protocolVersion) { + if (getMaxProtocolVersion() === null || this.options.daveEncryption === false || this.state.code !== 3 /* SelectingProtocol */ && this.state.code !== 4 /* Ready */ && this.state.code !== 5 /* Resuming */) { + return; + } + const session = new DAVESession( + protocolVersion, + this.state.connectionOptions.userId, + this.state.connectionOptions.channelId, + { + decryptionFailureTolerance: this.options.decryptionFailureTolerance + } + ); + session.on("error", this.onChildError); + session.on("debug", this.onDaveDebug); + session.on("keyPackage", this.onDaveKeyPackage); + session.on("invalidateTransition", this.onDaveInvalidateTransition); + session.reinit(); + return session; + } + /** + * Propagates errors from the children VoiceWebSocket, VoiceUDPSocket and DAVESession. + * + * @param error - The error that was emitted by a child + */ + onChildError(error) { + this.emit("error", error); + } + /** + * Called when the WebSocket opens. Depending on the state that the instance is in, + * it will either identify with a new session, or it will attempt to resume an existing session. + */ + onWsOpen() { + if (this.state.code === 0 /* OpeningWs */) { + this.state.ws.sendPacket({ + op: VoiceOpcodes2.Identify, + d: { + server_id: this.state.connectionOptions.serverId, + user_id: this.state.connectionOptions.userId, + session_id: this.state.connectionOptions.sessionId, + token: this.state.connectionOptions.token, + max_dave_protocol_version: this.options.daveEncryption === false ? 0 : getMaxProtocolVersion() ?? 0 + } + }); + this.state = { + ...this.state, + code: 1 /* Identifying */ + }; + } else if (this.state.code === 5 /* Resuming */) { + this.state.ws.sendPacket({ + op: VoiceOpcodes2.Resume, + d: { + server_id: this.state.connectionOptions.serverId, + session_id: this.state.connectionOptions.sessionId, + token: this.state.connectionOptions.token, + seq_ack: this.state.ws.sequence + } + }); + } + } + /** + * Called when the WebSocket closes. Based on the reason for closing (given by the code parameter), + * the instance will either attempt to resume, or enter the closed state and emit a 'close' event + * with the close code, allowing the user to decide whether or not they would like to reconnect. + * + * @param code - The close code + */ + onWsClose({ code }) { + const canResume = code === 4015 || code < 4e3; + if (canResume && this.state.code === 4 /* Ready */) { + const lastSequence = this.state.ws.sequence; + this.state = { + ...this.state, + code: 5 /* Resuming */, + ws: this.createWebSocket(this.state.connectionOptions.endpoint, lastSequence) + }; + } else if (this.state.code !== 6 /* Closed */) { + this.destroy(); + this.emit("close", code); + } + } + /** + * Called when the UDP socket has closed itself if it has stopped receiving replies from Discord. + */ + onUdpClose() { + if (this.state.code === 4 /* Ready */) { + const lastSequence = this.state.ws.sequence; + this.state = { + ...this.state, + code: 5 /* Resuming */, + ws: this.createWebSocket(this.state.connectionOptions.endpoint, lastSequence) + }; + } + } + /** + * Called when a packet is received on the connection's WebSocket. + * + * @param packet - The received packet + */ + onWsPacket(packet) { + if (packet.op === VoiceOpcodes2.Hello && this.state.code !== 6 /* Closed */) { + this.state.ws.setHeartbeatInterval(packet.d.heartbeat_interval); + } else if (packet.op === VoiceOpcodes2.Ready && this.state.code === 1 /* Identifying */) { + const { ip, port, ssrc, modes } = packet.d; + const udp = new VoiceUDPSocket({ ip, port }); + udp.on("error", this.onChildError); + udp.on("debug", this.onUdpDebug); + udp.once("close", this.onUdpClose); + udp.performIPDiscovery(ssrc).then((localConfig) => { + if (this.state.code !== 2 /* UdpHandshaking */) return; + this.state.ws.sendPacket({ + op: VoiceOpcodes2.SelectProtocol, + d: { + protocol: "udp", + data: { + address: localConfig.ip, + port: localConfig.port, + mode: chooseEncryptionMode(modes) + } + } + }); + this.state = { + ...this.state, + code: 3 /* SelectingProtocol */ + }; + }).catch((error) => this.emit("error", error)); + this.state = { + ...this.state, + code: 2 /* UdpHandshaking */, + udp, + connectionData: { + ssrc, + connectedClients: /* @__PURE__ */ new Set() + } + }; + } else if (packet.op === VoiceOpcodes2.SessionDescription && this.state.code === 3 /* SelectingProtocol */) { + const { mode: encryptionMode, secret_key: secretKey, dave_protocol_version: daveProtocolVersion } = packet.d; + this.state = { + ...this.state, + code: 4 /* Ready */, + dave: this.createDaveSession(daveProtocolVersion), + connectionData: { + ...this.state.connectionData, + encryptionMode, + secretKey: new Uint8Array(secretKey), + sequence: randomNBit(16), + timestamp: randomNBit(32), + nonce: 0, + nonceBuffer: encryptionMode === "aead_aes256_gcm_rtpsize" ? Buffer7.alloc(12) : Buffer7.alloc(24), + speaking: false, + packetsPlayed: 0 + } + }; + } else if (packet.op === VoiceOpcodes2.Resumed && this.state.code === 5 /* Resuming */) { + this.state = { + ...this.state, + code: 4 /* Ready */ + }; + this.state.connectionData.speaking = false; + } else if ((packet.op === VoiceOpcodes2.ClientsConnect || packet.op === VoiceOpcodes2.ClientDisconnect) && (this.state.code === 4 /* Ready */ || this.state.code === 2 /* UdpHandshaking */ || this.state.code === 3 /* SelectingProtocol */ || this.state.code === 5 /* Resuming */)) { + const { connectionData } = this.state; + if (packet.op === VoiceOpcodes2.ClientsConnect) + for (const id of packet.d.user_ids) connectionData.connectedClients.add(id); + else { + connectionData.connectedClients.delete(packet.d.user_id); + } + } else if ((this.state.code === 4 /* Ready */ || this.state.code === 5 /* Resuming */) && this.state.dave) { + if (packet.op === VoiceOpcodes2.DavePrepareTransition) { + const sendReady = this.state.dave.prepareTransition(packet.d); + if (sendReady) + this.state.ws.sendPacket({ + op: VoiceOpcodes2.DaveTransitionReady, + d: { transition_id: packet.d.transition_id } + }); + if (packet.d.transition_id === 0) { + this.emit("transitioned", 0); + } + } else if (packet.op === VoiceOpcodes2.DaveExecuteTransition) { + const transitioned = this.state.dave.executeTransition(packet.d.transition_id); + if (transitioned) this.emit("transitioned", packet.d.transition_id); + } else if (packet.op === VoiceOpcodes2.DavePrepareEpoch) this.state.dave.prepareEpoch(packet.d); + } + } + /** + * Called when a binary message is received on the connection's WebSocket. + * + * @param message - The received message + */ + onWsBinary(message) { + if (this.state.code === 4 /* Ready */ && this.state.dave) { + if (message.op === VoiceOpcodes2.DaveMlsExternalSender) { + this.state.dave.setExternalSender(message.payload); + } else if (message.op === VoiceOpcodes2.DaveMlsProposals) { + const payload = this.state.dave.processProposals(message.payload, this.state.connectionData.connectedClients); + if (payload) this.state.ws.sendBinaryMessage(VoiceOpcodes2.DaveMlsCommitWelcome, payload); + } else if (message.op === VoiceOpcodes2.DaveMlsAnnounceCommitTransition) { + const { transitionId, success } = this.state.dave.processCommit(message.payload); + if (success) { + if (transitionId === 0) this.emit("transitioned", transitionId); + else + this.state.ws.sendPacket({ + op: VoiceOpcodes2.DaveTransitionReady, + d: { transition_id: transitionId } + }); + } + } else if (message.op === VoiceOpcodes2.DaveMlsWelcome) { + const { transitionId, success } = this.state.dave.processWelcome(message.payload); + if (success) { + if (transitionId === 0) this.emit("transitioned", transitionId); + else + this.state.ws.sendPacket({ + op: VoiceOpcodes2.DaveTransitionReady, + d: { transition_id: transitionId } + }); + } + } + } + } + /** + * Called when a new key package is ready to be sent to the voice server. + * + * @param keyPackage - The new key package + */ + onDaveKeyPackage(keyPackage) { + if (this.state.code === 3 /* SelectingProtocol */ || this.state.code === 4 /* Ready */) + this.state.ws.sendBinaryMessage(VoiceOpcodes2.DaveMlsKeyPackage, keyPackage); + } + /** + * Called when the DAVE session wants to invalidate their transition and re-initialize. + * + * @param transitionId - The transition to invalidate + */ + onDaveInvalidateTransition(transitionId) { + if (this.state.code === 3 /* SelectingProtocol */ || this.state.code === 4 /* Ready */) + this.state.ws.sendPacket({ + op: VoiceOpcodes2.DaveMlsInvalidCommitWelcome, + d: { transition_id: transitionId } + }); + } + /** + * Propagates debug messages from the child WebSocket. + * + * @param message - The emitted debug message + */ + onWsDebug(message) { + this.debug?.(`[WS] ${message}`); + } + /** + * Propagates debug messages from the child UDPSocket. + * + * @param message - The emitted debug message + */ + onUdpDebug(message) { + this.debug?.(`[UDP] ${message}`); + } + /** + * Propagates debug messages from the child DAVESession. + * + * @param message - The emitted debug message + */ + onDaveDebug(message) { + this.debug?.(`[DAVE] ${message}`); + } + /** + * Prepares an Opus packet for playback. This includes attaching metadata to it and encrypting it. + * It will be stored within the instance, and can be played by dispatchAudio() + * + * @remarks + * Calling this method while there is already a prepared audio packet that has not yet been dispatched + * will overwrite the existing audio packet. This should be avoided. + * @param opusPacket - The Opus packet to encrypt + * @returns The audio packet that was prepared + */ + prepareAudioPacket(opusPacket) { + const state = this.state; + if (state.code !== 4 /* Ready */) return; + state.preparedPacket = this.createAudioPacket(opusPacket, state.connectionData, state.dave); + return state.preparedPacket; + } + /** + * Dispatches the audio packet previously prepared by prepareAudioPacket(opusPacket). The audio packet + * is consumed and cannot be dispatched again. + */ + dispatchAudio() { + const state = this.state; + if (state.code !== 4 /* Ready */) return false; + if (state.preparedPacket !== void 0) { + this.playAudioPacket(state.preparedPacket); + state.preparedPacket = void 0; + return true; + } + return false; + } + /** + * Plays an audio packet, updating timing metadata used for playback. + * + * @param audioPacket - The audio packet to play + */ + playAudioPacket(audioPacket) { + const state = this.state; + if (state.code !== 4 /* Ready */) return; + const { connectionData } = state; + connectionData.packetsPlayed++; + connectionData.sequence++; + connectionData.timestamp += TIMESTAMP_INC; + if (connectionData.sequence >= 2 ** 16) connectionData.sequence = 0; + if (connectionData.timestamp >= 2 ** 32) connectionData.timestamp = 0; + this.setSpeaking(true); + state.udp.send(audioPacket); + } + /** + * Sends a packet to the voice gateway indicating that the client has start/stopped sending + * audio. + * + * @param speaking - Whether or not the client should be shown as speaking + */ + setSpeaking(speaking) { + const state = this.state; + if (state.code !== 4 /* Ready */) return; + if (state.connectionData.speaking === speaking) return; + state.connectionData.speaking = speaking; + state.ws.sendPacket({ + op: VoiceOpcodes2.Speaking, + d: { + speaking: speaking ? 1 : 0, + delay: 0, + ssrc: state.connectionData.ssrc + } + }); + } + /** + * Creates a new audio packet from an Opus packet. This involves encrypting the packet, + * then prepending a header that includes metadata. + * + * @param opusPacket - The Opus packet to prepare + * @param connectionData - The current connection data of the instance + * @param daveSession - The DAVE session to use for encryption + */ + createAudioPacket(opusPacket, connectionData, daveSession) { + const rtpHeader = Buffer7.alloc(12); + rtpHeader[0] = 128; + rtpHeader[1] = 120; + const { sequence, timestamp, ssrc } = connectionData; + rtpHeader.writeUIntBE(sequence, 2, 2); + rtpHeader.writeUIntBE(timestamp, 4, 4); + rtpHeader.writeUIntBE(ssrc, 8, 4); + rtpHeader.copy(nonce, 0, 0, 12); + return Buffer7.concat([rtpHeader, ...this.encryptOpusPacket(opusPacket, connectionData, rtpHeader, daveSession)]); + } + /** + * Encrypts an Opus packet using the format agreed upon by the instance and Discord. + * + * @param opusPacket - The Opus packet to encrypt + * @param connectionData - The current connection data of the instance + * @param daveSession - The DAVE session to use for encryption + */ + encryptOpusPacket(opusPacket, connectionData, additionalData, daveSession) { + const { secretKey, encryptionMode } = connectionData; + const packet = daveSession?.encrypt(opusPacket) ?? opusPacket; + connectionData.nonce++; + if (connectionData.nonce > MAX_NONCE_SIZE) connectionData.nonce = 0; + connectionData.nonceBuffer.writeUInt32BE(connectionData.nonce, 0); + const noncePadding = connectionData.nonceBuffer.subarray(0, 4); + let encrypted; + switch (encryptionMode) { + case "aead_aes256_gcm_rtpsize": { + const cipher = crypto.createCipheriv("aes-256-gcm", secretKey, connectionData.nonceBuffer); + cipher.setAAD(additionalData); + encrypted = Buffer7.concat([cipher.update(packet), cipher.final(), cipher.getAuthTag()]); + return [encrypted, noncePadding]; + } + case "aead_xchacha20_poly1305_rtpsize": { + encrypted = methods.crypto_aead_xchacha20poly1305_ietf_encrypt( + packet, + additionalData, + connectionData.nonceBuffer, + secretKey + ); + return [encrypted, noncePadding]; + } + default: { + throw new RangeError(`Unsupported encryption method: ${encryptionMode}`); + } + } + } +}; + +// src/receive/VoiceReceiver.ts +import { Buffer as Buffer8 } from "buffer"; +import crypto2 from "crypto"; +import { VoiceOpcodes as VoiceOpcodes3 } from "discord-api-types/voice/v8"; + // src/receive/AudioReceiveStream.ts +import { nextTick } from "process"; +import { Readable } from "stream"; var EndBehaviorType = /* @__PURE__ */ ((EndBehaviorType2) => { EndBehaviorType2[EndBehaviorType2["Manual"] = 0] = "Manual"; EndBehaviorType2[EndBehaviorType2["AfterSilence"] = 1] = "AfterSilence"; @@ -1301,9 +1818,10 @@ var AudioReceiveStream = class extends Readable { */ end; endTimeout; - constructor({ end, ...options }) { + constructor(options) { + const { end, ...rest } = options; super({ - ...options, + ...rest, objectMode: true }); this.end = end; @@ -1312,6 +1830,9 @@ var AudioReceiveStream = class extends Readable { if (buffer && (this.end.behavior === 2 /* AfterInactivity */ || this.end.behavior === 1 /* AfterSilence */ && (buffer.compare(SILENCE_FRAME) !== 0 || this.endTimeout === void 0))) { this.renewEndTimeout(this.end); } + if (buffer === null) { + nextTick(() => this.destroy()); + } return super.push(buffer); } renewEndTimeout(end) { @@ -1325,8 +1846,8 @@ var AudioReceiveStream = class extends Readable { }; // src/receive/SSRCMap.ts -import { EventEmitter as EventEmitter5 } from "node:events"; -var SSRCMap = class extends EventEmitter5 { +import { EventEmitter as EventEmitter6 } from "events"; +var SSRCMap = class extends EventEmitter6 { static { __name(this, "SSRCMap"); } @@ -1350,8 +1871,7 @@ var SSRCMap = class extends EventEmitter5 { ...data }; this.map.set(data.audioSSRC, newValue); - if (!existing) - this.emit("create", newValue); + if (!existing) this.emit("create", newValue); this.emit("update", existing, newValue); } /** @@ -1397,8 +1917,8 @@ var SSRCMap = class extends EventEmitter5 { }; // src/receive/SpeakingMap.ts -import { EventEmitter as EventEmitter6 } from "node:events"; -var SpeakingMap = class _SpeakingMap extends EventEmitter6 { +import { EventEmitter as EventEmitter7 } from "events"; +var SpeakingMap = class _SpeakingMap extends EventEmitter7 { static { __name(this, "SpeakingMap"); } @@ -1439,6 +1959,9 @@ var SpeakingMap = class _SpeakingMap extends EventEmitter6 { }; // src/receive/VoiceReceiver.ts +var HEADER_EXTENSION_BYTE = Buffer8.from([190, 222]); +var UNPADDED_NONCE_LENGTH = 4; +var AUTH_TAG_LENGTH = 16; var VoiceReceiver = class { static { __name(this, "VoiceReceiver"); @@ -1481,33 +2004,44 @@ var VoiceReceiver = class { * @internal */ onWsPacket(packet) { - if (packet.op === VoiceOpcodes3.ClientDisconnect && typeof packet.d?.user_id === "string") { + if (packet.op === VoiceOpcodes3.ClientDisconnect) { this.ssrcMap.delete(packet.d.user_id); - } else if (packet.op === VoiceOpcodes3.Speaking && typeof packet.d?.user_id === "string" && typeof packet.d?.ssrc === "number") { + } else if (packet.op === VoiceOpcodes3.Speaking) { this.ssrcMap.update({ userId: packet.d.user_id, audioSSRC: packet.d.ssrc }); - } else if (packet.op === VoiceOpcodes3.ClientConnect && typeof packet.d?.user_id === "string" && typeof packet.d?.audio_ssrc === "number") { - this.ssrcMap.update({ - userId: packet.d.user_id, - audioSSRC: packet.d.audio_ssrc, - videoSSRC: packet.d.video_ssrc === 0 ? void 0 : packet.d.video_ssrc - }); } } decrypt(buffer, mode, nonce2, secretKey) { - let end; - if (mode === "xsalsa20_poly1305_lite") { - buffer.copy(nonce2, 0, buffer.length - 4); - end = buffer.length - 4; - } else if (mode === "xsalsa20_poly1305_suffix") { - buffer.copy(nonce2, 0, buffer.length - 24); - end = buffer.length - 24; - } else { - buffer.copy(nonce2, 0, 0, 12); + buffer.copy(nonce2, 0, buffer.length - UNPADDED_NONCE_LENGTH); + let headerSize = 12; + const first = buffer.readUint8(); + if (first >> 4 & 1) headerSize += 4; + const header = buffer.subarray(0, headerSize); + const encrypted = buffer.subarray(headerSize, buffer.length - AUTH_TAG_LENGTH - UNPADDED_NONCE_LENGTH); + const authTag = buffer.subarray( + buffer.length - AUTH_TAG_LENGTH - UNPADDED_NONCE_LENGTH, + buffer.length - UNPADDED_NONCE_LENGTH + ); + switch (mode) { + case "aead_aes256_gcm_rtpsize": { + const decipheriv = crypto2.createDecipheriv("aes-256-gcm", secretKey, nonce2); + decipheriv.setAAD(header); + decipheriv.setAuthTag(authTag); + return Buffer8.concat([decipheriv.update(encrypted), decipheriv.final()]); + } + case "aead_xchacha20_poly1305_rtpsize": { + return Buffer8.from( + methods.crypto_aead_xchacha20poly1305_ietf_decrypt( + Buffer8.concat([encrypted, authTag]), + header, + nonce2, + secretKey + ) + ); + } + default: { + throw new RangeError(`Unsupported decryption method: ${mode}`); + } } - const decrypted = methods.open(buffer.slice(12, end), nonce2, secretKey); - if (!decrypted) - return; - return Buffer6.from(decrypted); } /** * Parses an audio packet, decrypting it to yield an Opus packet. @@ -1516,15 +2050,19 @@ var VoiceReceiver = class { * @param mode - The encryption mode * @param nonce - The nonce buffer used by the connection for encryption * @param secretKey - The secret key used by the connection for encryption + * @param userId - The user id that sent the packet * @returns The parsed Opus packet */ - parsePacket(buffer, mode, nonce2, secretKey) { + parsePacket(buffer, mode, nonce2, secretKey, userId) { let packet = this.decrypt(buffer, mode, nonce2, secretKey); - if (!packet) - return; - if (packet[0] === 190 && packet[1] === 222) { - const headerExtensionLength = packet.readUInt16BE(2); - packet = packet.subarray(4 + 4 * headerExtensionLength); + if (!packet) throw new Error("Failed to parse packet"); + if (buffer.subarray(12, 14).compare(HEADER_EXTENSION_BYTE) === 0) { + const headerExtensionLength = buffer.subarray(14).readUInt16BE(); + packet = packet.subarray(4 * headerExtensionLength); + } + if (this.voiceConnection.state.status === "ready" /* Ready */ && (this.voiceConnection.state.networking.state.code === 4 /* Ready */ || this.voiceConnection.state.networking.state.code === 5 /* Resuming */)) { + const daveSession = this.voiceConnection.state.networking.state.dave; + if (daveSession) packet = daveSession.decrypt(packet, userId); } return packet; } @@ -1535,27 +2073,25 @@ var VoiceReceiver = class { * @internal */ onUdpMessage(msg) { - if (msg.length <= 8) - return; + if (msg.length <= 8) return; const ssrc = msg.readUInt32BE(8); const userData = this.ssrcMap.get(ssrc); - if (!userData) - return; + if (!userData) return; this.speaking.onPacket(userData.userId); const stream = this.subscriptions.get(userData.userId); - if (!stream) - return; + if (!stream) return; if (this.connectionData.encryptionMode && this.connectionData.nonceBuffer && this.connectionData.secretKey) { - const packet = this.parsePacket( - msg, - this.connectionData.encryptionMode, - this.connectionData.nonceBuffer, - this.connectionData.secretKey - ); - if (packet) { - stream.push(packet); - } else { - stream.destroy(new Error("Failed to parse packet")); + try { + const packet = this.parsePacket( + msg, + this.connectionData.encryptionMode, + this.connectionData.nonceBuffer, + this.connectionData.secretKey, + userData.userId + ); + if (packet) stream.push(packet); + } catch (error) { + stream.destroy(error); } } } @@ -1567,8 +2103,7 @@ var VoiceReceiver = class { */ subscribe(userId, options) { const existing = this.subscriptions.get(userId); - if (existing) - return existing; + if (existing) return existing; const stream = new AudioReceiveStream({ ...createDefaultAudioReceiveStreamOptions(), ...options @@ -1595,7 +2130,7 @@ var VoiceConnectionDisconnectReason = /* @__PURE__ */ ((VoiceConnectionDisconnec VoiceConnectionDisconnectReason2[VoiceConnectionDisconnectReason2["Manual"] = 3] = "Manual"; return VoiceConnectionDisconnectReason2; })(VoiceConnectionDisconnectReason || {}); -var VoiceConnection = class extends EventEmitter7 { +var VoiceConnection = class extends EventEmitter8 { static { __name(this, "VoiceConnection"); } @@ -1628,6 +2163,10 @@ var VoiceConnection = class extends EventEmitter7 { * The debug logger function, if debugging is enabled. */ debug; + /** + * The options used to create this voice connection. + */ + options; /** * Creates a new voice connection. * @@ -1643,10 +2182,11 @@ var VoiceConnection = class extends EventEmitter7 { this.onNetworkingStateChange = this.onNetworkingStateChange.bind(this); this.onNetworkingError = this.onNetworkingError.bind(this); this.onNetworkingDebug = this.onNetworkingDebug.bind(this); + this.onNetworkingTransitioned = this.onNetworkingTransitioned.bind(this); const adapter = options.adapterCreator({ - onVoiceServerUpdate: (data) => this.addServerPacket(data), - onVoiceStateUpdate: (data) => this.addStatePacket(data), - destroy: () => this.destroy(false) + onVoiceServerUpdate: /* @__PURE__ */ __name((data) => this.addServerPacket(data), "onVoiceServerUpdate"), + onVoiceStateUpdate: /* @__PURE__ */ __name((data) => this.addStatePacket(data), "onVoiceStateUpdate"), + destroy: /* @__PURE__ */ __name(() => this.destroy(false), "destroy") }); this._state = { status: "signalling" /* Signalling */, adapter }; this.packets = { @@ -1654,16 +2194,17 @@ var VoiceConnection = class extends EventEmitter7 { state: void 0 }; this.joinConfig = joinConfig; + this.options = options; } /** * The current state of the voice connection. + * + * @remarks + * The setter will perform clean-up operations where necessary. */ get state() { return this._state; } - /** - * Updates the state of the voice connection, performing clean-up operations where necessary. - */ set state(newState) { const oldState = this._state; const oldNetworking = Reflect.get(oldState, "networking"); @@ -1677,17 +2218,16 @@ var VoiceConnection = class extends EventEmitter7 { oldNetworking.off("error", this.onNetworkingError); oldNetworking.off("close", this.onNetworkingClose); oldNetworking.off("stateChange", this.onNetworkingStateChange); + oldNetworking.off("transitioned", this.onNetworkingTransitioned); oldNetworking.destroy(); } - if (newNetworking) - this.updateReceiveBindings(newNetworking.state, oldNetworking?.state); + if (newNetworking) this.updateReceiveBindings(newNetworking.state, oldNetworking?.state); } if (newState.status === "ready" /* Ready */) { this.rejoinAttempts = 0; } else if (newState.status === "destroyed" /* Destroyed */) { for (const stream of this.receiver.subscriptions.values()) { - if (!stream.destroyed) - stream.destroy(); + if (!stream.destroyed) stream.destroy(); } } if (oldState.status !== "destroyed" /* Destroyed */ && newState.status === "destroyed" /* Destroyed */) { @@ -1728,12 +2268,9 @@ var VoiceConnection = class extends EventEmitter7 { */ addStatePacket(packet) { this.packets.state = packet; - if (packet.self_deaf !== void 0) - this.joinConfig.selfDeaf = packet.self_deaf; - if (packet.self_mute !== void 0) - this.joinConfig.selfMute = packet.self_mute; - if (packet.channel_id) - this.joinConfig.channelId = packet.channel_id; + if (packet.self_deaf !== void 0) this.joinConfig.selfDeaf = packet.self_deaf; + if (packet.self_mute !== void 0) this.joinConfig.selfMute = packet.self_mute; + if (packet.channel_id) this.joinConfig.channelId = packet.channel_id; } /** * Called when the networking state changes, and the new ws/udp packet/message handlers need to be rebound @@ -1770,22 +2307,27 @@ var VoiceConnection = class extends EventEmitter7 { */ configureNetworking() { const { server, state } = this.packets; - if (!server || !state || this.state.status === "destroyed" /* Destroyed */ || !server.endpoint) - return; + if (!server || !state || this.state.status === "destroyed" /* Destroyed */ || !server.endpoint) return; const networking = new Networking( { endpoint: server.endpoint, serverId: server.guild_id, token: server.token, sessionId: state.session_id, - userId: state.user_id + userId: state.user_id, + channelId: state.channel_id }, - Boolean(this.debug) + { + debug: Boolean(this.debug), + daveEncryption: this.options.daveEncryption ?? true, + decryptionFailureTolerance: this.options.decryptionFailureTolerance + } ); networking.once("close", this.onNetworkingClose); networking.on("stateChange", this.onNetworkingStateChange); networking.on("error", this.onNetworkingError); networking.on("debug", this.onNetworkingDebug); + networking.on("transitioned", this.onNetworkingTransitioned); this.state = { ...this.state, status: "connecting" /* Connecting */, @@ -1804,8 +2346,7 @@ var VoiceConnection = class extends EventEmitter7 { * @param code - The close code */ onNetworkingClose(code) { - if (this.state.status === "destroyed" /* Destroyed */) - return; + if (this.state.status === "destroyed" /* Destroyed */) return; if (code === 4014) { this.state = { ...this.state, @@ -1836,8 +2377,7 @@ var VoiceConnection = class extends EventEmitter7 { */ onNetworkingStateChange(oldState, newState) { this.updateReceiveBindings(newState, oldState); - if (oldState.code === newState.code) - return; + if (oldState.code === newState.code) return; if (this.state.status !== "connecting" /* Connecting */ && this.state.status !== "ready" /* Ready */) return; if (newState.code === 4 /* Ready */) { @@ -1868,6 +2408,14 @@ var VoiceConnection = class extends EventEmitter7 { onNetworkingDebug(message) { this.debug?.(`[NW] ${message}`); } + /** + * Propagates transitions from the underlying network instance. + * + * @param transitionId - The transition id + */ + onNetworkingTransitioned(transitionId) { + this.emit("transitioned", transitionId); + } /** * Prepares an audio packet for dispatch. * @@ -1875,8 +2423,7 @@ var VoiceConnection = class extends EventEmitter7 { */ prepareAudioPacket(buffer) { const state = this.state; - if (state.status !== "ready" /* Ready */) - return; + if (state.status !== "ready" /* Ready */) return; return state.networking.prepareAudioPacket(buffer); } /** @@ -1884,8 +2431,7 @@ var VoiceConnection = class extends EventEmitter7 { */ dispatchAudio() { const state = this.state; - if (state.status !== "ready" /* Ready */) - return; + if (state.status !== "ready" /* Ready */) return; return state.networking.dispatchAudio(); } /** @@ -1895,8 +2441,7 @@ var VoiceConnection = class extends EventEmitter7 { */ playOpusPacket(buffer) { const state = this.state; - if (state.status !== "ready" /* Ready */) - return; + if (state.status !== "ready" /* Ready */) return; state.networking.prepareAudioPacket(buffer); return state.networking.dispatchAudio(); } @@ -1962,8 +2507,7 @@ var VoiceConnection = class extends EventEmitter7 { return false; } const notReady = this.state.status !== "ready" /* Ready */; - if (notReady) - this.rejoinAttempts++; + if (notReady) this.rejoinAttempts++; Object.assign(this.joinConfig, joinConfig); if (this.state.adapter.sendPayload(createJoinVoiceChannelPayload(this.joinConfig))) { if (notReady) { @@ -1989,8 +2533,7 @@ var VoiceConnection = class extends EventEmitter7 { * @param enabled - Whether or not to show as speaking */ setSpeaking(enabled) { - if (this.state.status !== "ready" /* Ready */) - return false; + if (this.state.status !== "ready" /* Ready */) return false; return this.state.networking.setSpeaking(enabled); } /** @@ -2000,8 +2543,7 @@ var VoiceConnection = class extends EventEmitter7 { * @returns The created subscription */ subscribe(player) { - if (this.state.status === "destroyed" /* Destroyed */) - return; + if (this.state.status === "destroyed" /* Destroyed */) return; const subscription = player["subscribe"](this); this.state = { ...this.state, @@ -2029,6 +2571,30 @@ var VoiceConnection = class extends EventEmitter7 { udp: void 0 }; } + /** + * The current voice privacy code of the encrypted session. + * + * @remarks + * For this data to be available, the VoiceConnection must be in the Ready state, + * and the connection would have to be end-to-end encrypted. + */ + get voicePrivacyCode() { + if (this.state.status === "ready" /* Ready */ && this.state.networking.state.code === 4 /* Ready */) { + return this.state.networking.state.dave?.voicePrivacyCode ?? void 0; + } + return void 0; + } + /** + * Gets the verification code for a user in the session. + * + * @throws Will throw if end-to-end encryption is not on or if the user id provided is not in the session. + */ + async getVerificationCode(userId) { + if (this.state.status === "ready" /* Ready */ && this.state.networking.state.code === 4 /* Ready */ && this.state.networking.state.dave) { + return this.state.networking.state.dave.getVerificationCode(userId); + } + throw new Error("Session not available"); + } /** * Called when a subscription of this voice connection to an audio player is removed. * @@ -2085,13 +2651,15 @@ function joinVoiceChannel(options) { }; return createVoiceConnection(joinConfig, { adapterCreator: options.adapterCreator, - debug: options.debug + debug: options.debug, + daveEncryption: options.daveEncryption, + decryptionFailureTolerance: options.decryptionFailureTolerance }); } __name(joinVoiceChannel, "joinVoiceChannel"); // src/audio/AudioResource.ts -import { pipeline } from "node:stream"; +import { pipeline } from "stream"; import prism2 from "prism-media"; // src/audio/TransformerGraph.ts @@ -2119,6 +2687,16 @@ var StreamType = /* @__PURE__ */ ((StreamType2) => { StreamType2["WebmOpus"] = "webm/opus"; return StreamType2; })(StreamType || {}); +var TransformerType = /* @__PURE__ */ ((TransformerType2) => { + TransformerType2["FFmpegOgg"] = "ffmpeg ogg"; + TransformerType2["FFmpegPCM"] = "ffmpeg pcm"; + TransformerType2["InlineVolume"] = "volume transformer"; + TransformerType2["OggOpusDemuxer"] = "ogg/opus demuxer"; + TransformerType2["OpusDecoder"] = "opus decoder"; + TransformerType2["OpusEncoder"] = "opus encoder"; + TransformerType2["WebmOpusDemuxer"] = "webm/opus demuxer"; + return TransformerType2; +})(TransformerType || {}); var Node = class { static { __name(this, "Node"); @@ -2146,8 +2724,7 @@ var Node = class { var NODES = null; function getNode(type) { const node = (NODES ??= initializeNodes()).get(type); - if (!node) - throw new Error(`Node type '${type}' does not exist!`); + if (!node) throw new Error(`Node type '${type}' does not exist!`); return node; } __name(getNode, "getNode"); @@ -2168,33 +2745,33 @@ function initializeNodes() { type: "opus encoder" /* OpusEncoder */, to: nodes.get("opus" /* Opus */), cost: 1.5, - transformer: () => new prism.opus.Encoder({ rate: 48e3, channels: 2, frameSize: 960 }) + transformer: /* @__PURE__ */ __name(() => new prism.opus.Encoder({ rate: 48e3, channels: 2, frameSize: 960 }), "transformer") }); nodes.get("opus" /* Opus */).addEdge({ type: "opus decoder" /* OpusDecoder */, to: nodes.get("raw" /* Raw */), cost: 1.5, - transformer: () => new prism.opus.Decoder({ rate: 48e3, channels: 2, frameSize: 960 }) + transformer: /* @__PURE__ */ __name(() => new prism.opus.Decoder({ rate: 48e3, channels: 2, frameSize: 960 }), "transformer") }); nodes.get("ogg/opus" /* OggOpus */).addEdge({ type: "ogg/opus demuxer" /* OggOpusDemuxer */, to: nodes.get("opus" /* Opus */), cost: 1, - transformer: () => new prism.opus.OggDemuxer() + transformer: /* @__PURE__ */ __name(() => new prism.opus.OggDemuxer(), "transformer") }); nodes.get("webm/opus" /* WebmOpus */).addEdge({ type: "webm/opus demuxer" /* WebmOpusDemuxer */, to: nodes.get("opus" /* Opus */), cost: 1, - transformer: () => new prism.opus.WebmDemuxer() + transformer: /* @__PURE__ */ __name(() => new prism.opus.WebmDemuxer(), "transformer") }); const FFMPEG_PCM_EDGE = { type: "ffmpeg pcm" /* FFmpegPCM */, to: nodes.get("raw" /* Raw */), cost: 2, - transformer: (input) => new prism.FFmpeg({ + transformer: /* @__PURE__ */ __name((input) => new prism.FFmpeg({ args: ["-i", typeof input === "string" ? input : "-", ...FFMPEG_PCM_ARGUMENTS] - }) + }), "transformer") }; nodes.get("arbitrary" /* Arbitrary */).addEdge(FFMPEG_PCM_EDGE); nodes.get("ogg/opus" /* OggOpus */).addEdge(FFMPEG_PCM_EDGE); @@ -2203,16 +2780,16 @@ function initializeNodes() { type: "volume transformer" /* InlineVolume */, to: nodes.get("raw" /* Raw */), cost: 0.5, - transformer: () => new prism.VolumeTransformer({ type: "s16le" }) + transformer: /* @__PURE__ */ __name(() => new prism.VolumeTransformer({ type: "s16le" }), "transformer") }); if (canEnableFFmpegOptimizations()) { const FFMPEG_OGG_EDGE = { type: "ffmpeg ogg" /* FFmpegOgg */, to: nodes.get("ogg/opus" /* OggOpus */), cost: 2, - transformer: (input) => new prism.FFmpeg({ + transformer: /* @__PURE__ */ __name((input) => new prism.FFmpeg({ args: ["-i", typeof input === "string" ? input : "-", ...FFMPEG_OPUS_ARGUMENTS] - }) + }), "transformer") }; nodes.get("arbitrary" /* Arbitrary */).addEdge(FFMPEG_OGG_EDGE); nodes.get("ogg/opus" /* OggOpus */).addEdge(FFMPEG_OGG_EDGE); @@ -2229,8 +2806,7 @@ function findPath(from, constraints, goal = getNode("opus" /* Opus */), path = [ } let currentBest; for (const edge of from.edges) { - if (currentBest && edge.cost > currentBest.cost) - continue; + if (currentBest && edge.cost > currentBest.cost) continue; const next = findPath(edge.to, constraints, goal, [...path, edge], depth - 1); const cost = edge.cost + next.cost; if (!currentBest || cost < currentBest.cost) { @@ -2323,12 +2899,10 @@ var AudioResource = class { * while there are silence padding frames left to play. */ get readable() { - if (this.silenceRemaining === 0) - return false; + if (this.silenceRemaining === 0) return false; const real = this.playStream.readable; if (!real) { - if (this.silenceRemaining === -1) - this.silenceRemaining = this.silencePaddingFrames; + if (this.silenceRemaining === -1) this.silenceRemaining = this.silencePaddingFrames; return this.silenceRemaining !== 0; } return real; @@ -2392,8 +2966,7 @@ function createAudioResource(input, options = {}) { } const transformerPipeline = findPipeline(inputType, needsInlineVolume ? VOLUME_CONSTRAINT : NO_CONSTRAINT); if (transformerPipeline.length === 0) { - if (typeof input === "string") - throw new Error(`Invalid pipeline constructed for string resource '${input}'`); + if (typeof input === "string") throw new Error(`Invalid pipeline constructed for string resource '${input}'`); return new AudioResource( [], [input], @@ -2402,8 +2975,7 @@ function createAudioResource(input, options = {}) { ); } const streams = transformerPipeline.map((edge) => edge.transformer(input)); - if (typeof input !== "string") - streams.unshift(input); + if (typeof input !== "string") streams.unshift(input); return new AudioResource( transformerPipeline, streams, @@ -2414,16 +2986,15 @@ function createAudioResource(input, options = {}) { __name(createAudioResource, "createAudioResource"); // src/util/generateDependencyReport.ts -import { resolve, dirname } from "node:path"; +import { getCiphers } from "crypto"; +import { resolve, dirname } from "path"; import prism3 from "prism-media"; function findPackageJSON(dir, packageName, depth) { - if (depth === 0) - return void 0; + if (depth === 0) return void 0; const attemptedPath = resolve(dir, "./package.json"); try { const pkg = __require(attemptedPath); - if (pkg.name !== packageName) - throw new Error("package.json does not match"); + if (pkg.name !== packageName) throw new Error("package.json does not match"); return pkg; } catch { return findPackageJSON(resolve(dir, ".."), packageName, depth - 1); @@ -2433,7 +3004,7 @@ __name(findPackageJSON, "findPackageJSON"); function version(name) { try { if (name === "@discordjs/voice") { - return "0.17.0"; + return "0.19.0"; } const pkg = findPackageJSON(dirname(__require.resolve(name)), name, 3); return pkg?.version ?? "not found"; @@ -2454,10 +3025,15 @@ function generateDependencyReport() { addVersion("opusscript"); report.push(""); report.push("Encryption Libraries"); + report.push(`- native crypto support for aes-256-gcm: ${getCiphers().includes("aes-256-gcm") ? "yes" : "no"}`); addVersion("sodium-native"); addVersion("sodium"); addVersion("libsodium-wrappers"); - addVersion("tweetnacl"); + addVersion("@stablelib/xchacha20poly1305"); + addVersion("@noble/ciphers"); + report.push(""); + report.push("DAVE Libraries"); + addVersion("@snazzah/davey"); report.push(""); report.push("FFmpeg"); try { @@ -2472,7 +3048,7 @@ function generateDependencyReport() { __name(generateDependencyReport, "generateDependencyReport"); // src/util/entersState.ts -import { once } from "node:events"; +import { once } from "events"; // src/util/abortAfter.ts function abortAfter(delay) { @@ -2498,9 +3074,9 @@ async function entersState(target, status, timeoutOrSignal) { __name(entersState, "entersState"); // src/util/demuxProbe.ts -import { Buffer as Buffer7 } from "node:buffer"; -import process from "node:process"; -import { Readable as Readable2 } from "node:stream"; +import { Buffer as Buffer9 } from "buffer"; +import process from "process"; +import { Readable as Readable2 } from "stream"; import prism4 from "prism-media"; function validateDiscordOpusHead(opusHead) { const channels = opusHead.readUInt8(9); @@ -2518,7 +3094,7 @@ async function demuxProbe(stream, probeSize = 1024, validator = validateDiscordO reject(new Error("Cannot probe a stream that has ended")); return; } - let readBuffer = Buffer7.alloc(0); + let readBuffer = Buffer9.alloc(0); let resolved; const finish = /* @__PURE__ */ __name((type) => { stream.off("data", onData); @@ -2558,7 +3134,7 @@ async function demuxProbe(stream, probeSize = 1024, validator = validateDiscordO } }, "onClose"); const onData = /* @__PURE__ */ __name((buffer) => { - readBuffer = Buffer7.concat([readBuffer, buffer]); + readBuffer = Buffer9.concat([readBuffer, buffer]); webm.write(buffer); ogg.write(buffer); if (readBuffer.length >= probeSize) { @@ -2576,23 +3152,30 @@ async function demuxProbe(stream, probeSize = 1024, validator = validateDiscordO __name(demuxProbe, "demuxProbe"); // src/index.ts -var version2 = "0.17.0"; +var version2 = "0.19.0"; export { AudioPlayer, AudioPlayerError, AudioPlayerStatus, AudioReceiveStream, AudioResource, + DAVESession, EndBehaviorType, + Networking, + NetworkingStatusCode, NoSubscriberBehavior, + Node, PlayerSubscription, SSRCMap, SpeakingMap, StreamType, + TransformerType, VoiceConnection, VoiceConnectionDisconnectReason, VoiceConnectionStatus, VoiceReceiver, + VoiceUDPSocket, + VoiceWebSocket, createAudioPlayer, createAudioResource, createDefaultAudioReceiveStreamOptions, diff --git a/node_modules/@discordjs/voice/dist/index.mjs.map b/node_modules/@discordjs/voice/dist/index.mjs.map index f38645c..c0e3fa9 100644 --- a/node_modules/@discordjs/voice/dist/index.mjs.map +++ b/node_modules/@discordjs/voice/dist/index.mjs.map @@ -1 +1 @@ -{"version":3,"sources":["../src/VoiceConnection.ts","../src/DataStore.ts","../src/networking/Networking.ts","../src/util/Secretbox.ts","../src/util/util.ts","../src/networking/VoiceUDPSocket.ts","../src/networking/VoiceWebSocket.ts","../src/receive/VoiceReceiver.ts","../src/receive/AudioReceiveStream.ts","../src/audio/AudioPlayer.ts","../src/audio/AudioPlayerError.ts","../src/audio/PlayerSubscription.ts","../src/receive/SSRCMap.ts","../src/receive/SpeakingMap.ts","../src/joinVoiceChannel.ts","../src/audio/AudioResource.ts","../src/audio/TransformerGraph.ts","../src/util/generateDependencyReport.ts","../src/util/entersState.ts","../src/util/abortAfter.ts","../src/util/demuxProbe.ts","../src/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/unbound-method */\nimport type { Buffer } from 'node:buffer';\nimport { EventEmitter } from 'node:events';\nimport type { GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData } from 'discord-api-types/v10';\nimport type { JoinConfig } from './DataStore';\nimport {\n\tgetVoiceConnection,\n\tcreateJoinVoiceChannelPayload,\n\ttrackVoiceConnection,\n\tuntrackVoiceConnection,\n} from './DataStore';\nimport type { AudioPlayer } from './audio/AudioPlayer';\nimport type { PlayerSubscription } from './audio/PlayerSubscription';\nimport type { VoiceWebSocket, VoiceUDPSocket } from './networking';\nimport { Networking, NetworkingStatusCode, type NetworkingState } from './networking/Networking';\nimport { VoiceReceiver } from './receive/index';\nimport type { DiscordGatewayAdapterImplementerMethods } from './util/adapter';\nimport { noop } from './util/util';\nimport type { CreateVoiceConnectionOptions } from './index';\n\n/**\n * The various status codes a voice connection can hold at any one time.\n */\nexport enum VoiceConnectionStatus {\n\t/**\n\t * The `VOICE_SERVER_UPDATE` and `VOICE_STATE_UPDATE` packets have been received, now attempting to establish a voice connection.\n\t */\n\tConnecting = 'connecting',\n\n\t/**\n\t * The voice connection has been destroyed and untracked, it cannot be reused.\n\t */\n\tDestroyed = 'destroyed',\n\n\t/**\n\t * The voice connection has either been severed or not established.\n\t */\n\tDisconnected = 'disconnected',\n\n\t/**\n\t * A voice connection has been established, and is ready to be used.\n\t */\n\tReady = 'ready',\n\n\t/**\n\t * Sending a packet to the main Discord gateway to indicate we want to change our voice state.\n\t */\n\tSignalling = 'signalling',\n}\n\n/**\n * The state that a VoiceConnection will be in when it is waiting to receive a VOICE_SERVER_UPDATE and\n * VOICE_STATE_UPDATE packet from Discord, provided by the adapter.\n */\nexport interface VoiceConnectionSignallingState {\n\tadapter: DiscordGatewayAdapterImplementerMethods;\n\tstatus: VoiceConnectionStatus.Signalling;\n\tsubscription?: PlayerSubscription | undefined;\n}\n\n/**\n * The reasons a voice connection can be in the disconnected state.\n */\nexport enum VoiceConnectionDisconnectReason {\n\t/**\n\t * When the WebSocket connection has been closed.\n\t */\n\tWebSocketClose,\n\n\t/**\n\t * When the adapter was unable to send a message requested by the VoiceConnection.\n\t */\n\tAdapterUnavailable,\n\n\t/**\n\t * When a VOICE_SERVER_UPDATE packet is received with a null endpoint, causing the connection to be severed.\n\t */\n\tEndpointRemoved,\n\n\t/**\n\t * When a manual disconnect was requested.\n\t */\n\tManual,\n}\n\n/**\n * The state that a VoiceConnection will be in when it is not connected to a Discord voice server nor is\n * it attempting to connect. You can manually attempt to reconnect using VoiceConnection#reconnect.\n */\nexport interface VoiceConnectionDisconnectedBaseState {\n\tadapter: DiscordGatewayAdapterImplementerMethods;\n\tstatus: VoiceConnectionStatus.Disconnected;\n\tsubscription?: PlayerSubscription | undefined;\n}\n\n/**\n * The state that a VoiceConnection will be in when it is not connected to a Discord voice server nor is\n * it attempting to connect. You can manually attempt to reconnect using VoiceConnection#reconnect.\n */\nexport interface VoiceConnectionDisconnectedOtherState extends VoiceConnectionDisconnectedBaseState {\n\treason: Exclude;\n}\n\n/**\n * The state that a VoiceConnection will be in when its WebSocket connection was closed.\n * You can manually attempt to reconnect using VoiceConnection#reconnect.\n */\nexport interface VoiceConnectionDisconnectedWebSocketState extends VoiceConnectionDisconnectedBaseState {\n\t/**\n\t * The close code of the WebSocket connection to the Discord voice server.\n\t */\n\tcloseCode: number;\n\n\treason: VoiceConnectionDisconnectReason.WebSocketClose;\n}\n\n/**\n * The states that a VoiceConnection can be in when it is not connected to a Discord voice server nor is\n * it attempting to connect. You can manually attempt to connect using VoiceConnection#reconnect.\n */\nexport type VoiceConnectionDisconnectedState =\n\t| VoiceConnectionDisconnectedOtherState\n\t| VoiceConnectionDisconnectedWebSocketState;\n\n/**\n * The state that a VoiceConnection will be in when it is establishing a connection to a Discord\n * voice server.\n */\nexport interface VoiceConnectionConnectingState {\n\tadapter: DiscordGatewayAdapterImplementerMethods;\n\tnetworking: Networking;\n\tstatus: VoiceConnectionStatus.Connecting;\n\tsubscription?: PlayerSubscription | undefined;\n}\n\n/**\n * The state that a VoiceConnection will be in when it has an active connection to a Discord\n * voice server.\n */\nexport interface VoiceConnectionReadyState {\n\tadapter: DiscordGatewayAdapterImplementerMethods;\n\tnetworking: Networking;\n\tstatus: VoiceConnectionStatus.Ready;\n\tsubscription?: PlayerSubscription | undefined;\n}\n\n/**\n * The state that a VoiceConnection will be in when it has been permanently been destroyed by the\n * user and untracked by the library. It cannot be reconnected, instead, a new VoiceConnection\n * needs to be established.\n */\nexport interface VoiceConnectionDestroyedState {\n\tstatus: VoiceConnectionStatus.Destroyed;\n}\n\n/**\n * The various states that a voice connection can be in.\n */\nexport type VoiceConnectionState =\n\t| VoiceConnectionConnectingState\n\t| VoiceConnectionDestroyedState\n\t| VoiceConnectionDisconnectedState\n\t| VoiceConnectionReadyState\n\t| VoiceConnectionSignallingState;\n\nexport interface VoiceConnection extends EventEmitter {\n\t/**\n\t * Emitted when there is an error emitted from the voice connection\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'error', listener: (error: Error) => void): this;\n\t/**\n\t * Emitted debugging information about the voice connection\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'debug', listener: (message: string) => void): this;\n\t/**\n\t * Emitted when the state of the voice connection changes\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'stateChange', listener: (oldState: VoiceConnectionState, newState: VoiceConnectionState) => void): this;\n\t/**\n\t * Emitted when the state of the voice connection changes to a specific status\n\t *\n\t * @eventProperty\n\t */\n\ton(\n\t\tevent: Event,\n\t\tlistener: (oldState: VoiceConnectionState, newState: VoiceConnectionState & { status: Event }) => void,\n\t): this;\n}\n\n/**\n * A connection to the voice server of a Guild, can be used to play audio in voice channels.\n */\nexport class VoiceConnection extends EventEmitter {\n\t/**\n\t * The number of consecutive rejoin attempts. Initially 0, and increments for each rejoin.\n\t * When a connection is successfully established, it resets to 0.\n\t */\n\tpublic rejoinAttempts: number;\n\n\t/**\n\t * The state of the voice connection.\n\t */\n\tprivate _state: VoiceConnectionState;\n\n\t/**\n\t * A configuration storing all the data needed to reconnect to a Guild's voice server.\n\t *\n\t * @internal\n\t */\n\tpublic readonly joinConfig: JoinConfig;\n\n\t/**\n\t * The two packets needed to successfully establish a voice connection. They are received\n\t * from the main Discord gateway after signalling to change the voice state.\n\t */\n\tprivate readonly packets: {\n\t\tserver: GatewayVoiceServerUpdateDispatchData | undefined;\n\t\tstate: GatewayVoiceStateUpdateDispatchData | undefined;\n\t};\n\n\t/**\n\t * The receiver of this voice connection. You should join the voice channel with `selfDeaf` set\n\t * to false for this feature to work properly.\n\t */\n\tpublic readonly receiver: VoiceReceiver;\n\n\t/**\n\t * The debug logger function, if debugging is enabled.\n\t */\n\tprivate readonly debug: ((message: string) => void) | null;\n\n\t/**\n\t * Creates a new voice connection.\n\t *\n\t * @param joinConfig - The data required to establish the voice connection\n\t * @param options - The options used to create this voice connection\n\t */\n\tpublic constructor(joinConfig: JoinConfig, options: CreateVoiceConnectionOptions) {\n\t\tsuper();\n\n\t\tthis.debug = options.debug ? (message: string) => this.emit('debug', message) : null;\n\t\tthis.rejoinAttempts = 0;\n\n\t\tthis.receiver = new VoiceReceiver(this);\n\n\t\tthis.onNetworkingClose = this.onNetworkingClose.bind(this);\n\t\tthis.onNetworkingStateChange = this.onNetworkingStateChange.bind(this);\n\t\tthis.onNetworkingError = this.onNetworkingError.bind(this);\n\t\tthis.onNetworkingDebug = this.onNetworkingDebug.bind(this);\n\n\t\tconst adapter = options.adapterCreator({\n\t\t\tonVoiceServerUpdate: (data) => this.addServerPacket(data),\n\t\t\tonVoiceStateUpdate: (data) => this.addStatePacket(data),\n\t\t\tdestroy: () => this.destroy(false),\n\t\t});\n\n\t\tthis._state = { status: VoiceConnectionStatus.Signalling, adapter };\n\n\t\tthis.packets = {\n\t\t\tserver: undefined,\n\t\t\tstate: undefined,\n\t\t};\n\n\t\tthis.joinConfig = joinConfig;\n\t}\n\n\t/**\n\t * The current state of the voice connection.\n\t */\n\tpublic get state() {\n\t\treturn this._state;\n\t}\n\n\t/**\n\t * Updates the state of the voice connection, performing clean-up operations where necessary.\n\t */\n\tpublic set state(newState: VoiceConnectionState) {\n\t\tconst oldState = this._state;\n\t\tconst oldNetworking = Reflect.get(oldState, 'networking') as Networking | undefined;\n\t\tconst newNetworking = Reflect.get(newState, 'networking') as Networking | undefined;\n\n\t\tconst oldSubscription = Reflect.get(oldState, 'subscription') as PlayerSubscription | undefined;\n\t\tconst newSubscription = Reflect.get(newState, 'subscription') as PlayerSubscription | undefined;\n\n\t\tif (oldNetworking !== newNetworking) {\n\t\t\tif (oldNetworking) {\n\t\t\t\toldNetworking.on('error', noop);\n\t\t\t\toldNetworking.off('debug', this.onNetworkingDebug);\n\t\t\t\toldNetworking.off('error', this.onNetworkingError);\n\t\t\t\toldNetworking.off('close', this.onNetworkingClose);\n\t\t\t\toldNetworking.off('stateChange', this.onNetworkingStateChange);\n\t\t\t\toldNetworking.destroy();\n\t\t\t}\n\n\t\t\tif (newNetworking) this.updateReceiveBindings(newNetworking.state, oldNetworking?.state);\n\t\t}\n\n\t\tif (newState.status === VoiceConnectionStatus.Ready) {\n\t\t\tthis.rejoinAttempts = 0;\n\t\t} else if (newState.status === VoiceConnectionStatus.Destroyed) {\n\t\t\tfor (const stream of this.receiver.subscriptions.values()) {\n\t\t\t\tif (!stream.destroyed) stream.destroy();\n\t\t\t}\n\t\t}\n\n\t\t// If destroyed, the adapter can also be destroyed so it can be cleaned up by the user\n\t\tif (oldState.status !== VoiceConnectionStatus.Destroyed && newState.status === VoiceConnectionStatus.Destroyed) {\n\t\t\toldState.adapter.destroy();\n\t\t}\n\n\t\tthis._state = newState;\n\n\t\tif (oldSubscription && oldSubscription !== newSubscription) {\n\t\t\toldSubscription.unsubscribe();\n\t\t}\n\n\t\tthis.emit('stateChange', oldState, newState);\n\t\tif (oldState.status !== newState.status) {\n\t\t\tthis.emit(newState.status, oldState, newState as any);\n\t\t}\n\t}\n\n\t/**\n\t * Registers a `VOICE_SERVER_UPDATE` packet to the voice connection. This will cause it to reconnect using the\n\t * new data provided in the packet.\n\t *\n\t * @param packet - The received `VOICE_SERVER_UPDATE` packet\n\t */\n\tprivate addServerPacket(packet: GatewayVoiceServerUpdateDispatchData) {\n\t\tthis.packets.server = packet;\n\t\tif (packet.endpoint) {\n\t\t\tthis.configureNetworking();\n\t\t} else if (this.state.status !== VoiceConnectionStatus.Destroyed) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\treason: VoiceConnectionDisconnectReason.EndpointRemoved,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Registers a `VOICE_STATE_UPDATE` packet to the voice connection. Most importantly, it stores the id of the\n\t * channel that the client is connected to.\n\t *\n\t * @param packet - The received `VOICE_STATE_UPDATE` packet\n\t */\n\tprivate addStatePacket(packet: GatewayVoiceStateUpdateDispatchData) {\n\t\tthis.packets.state = packet;\n\n\t\tif (packet.self_deaf !== undefined) this.joinConfig.selfDeaf = packet.self_deaf;\n\t\tif (packet.self_mute !== undefined) this.joinConfig.selfMute = packet.self_mute;\n\t\tif (packet.channel_id) this.joinConfig.channelId = packet.channel_id;\n\t\t/*\n\t\t\tthe channel_id being null doesn't necessarily mean it was intended for the client to leave the voice channel\n\t\t\tas it may have disconnected due to network failure. This will be gracefully handled once the voice websocket\n\t\t\tdies, and then it is up to the user to decide how they wish to handle this.\n\t\t*/\n\t}\n\n\t/**\n\t * Called when the networking state changes, and the new ws/udp packet/message handlers need to be rebound\n\t * to the new instances.\n\t *\n\t * @param newState - The new networking state\n\t * @param oldState - The old networking state, if there is one\n\t */\n\tprivate updateReceiveBindings(newState: NetworkingState, oldState?: NetworkingState) {\n\t\tconst oldWs = Reflect.get(oldState ?? {}, 'ws') as VoiceWebSocket | undefined;\n\t\tconst newWs = Reflect.get(newState, 'ws') as VoiceWebSocket | undefined;\n\t\tconst oldUdp = Reflect.get(oldState ?? {}, 'udp') as VoiceUDPSocket | undefined;\n\t\tconst newUdp = Reflect.get(newState, 'udp') as VoiceUDPSocket | undefined;\n\n\t\tif (oldWs !== newWs) {\n\t\t\toldWs?.off('packet', this.receiver.onWsPacket);\n\t\t\tnewWs?.on('packet', this.receiver.onWsPacket);\n\t\t}\n\n\t\tif (oldUdp !== newUdp) {\n\t\t\toldUdp?.off('message', this.receiver.onUdpMessage);\n\t\t\tnewUdp?.on('message', this.receiver.onUdpMessage);\n\t\t}\n\n\t\tthis.receiver.connectionData = Reflect.get(newState, 'connectionData') ?? {};\n\t}\n\n\t/**\n\t * Attempts to configure a networking instance for this voice connection using the received packets.\n\t * Both packets are required, and any existing networking instance will be destroyed.\n\t *\n\t * @remarks\n\t * This is called when the voice server of the connection changes, e.g. if the bot is moved into a\n\t * different channel in the same guild but has a different voice server. In this instance, the connection\n\t * needs to be re-established to the new voice server.\n\t *\n\t * The connection will transition to the Connecting state when this is called.\n\t */\n\tpublic configureNetworking() {\n\t\tconst { server, state } = this.packets;\n\t\tif (!server || !state || this.state.status === VoiceConnectionStatus.Destroyed || !server.endpoint) return;\n\n\t\tconst networking = new Networking(\n\t\t\t{\n\t\t\t\tendpoint: server.endpoint,\n\t\t\t\tserverId: server.guild_id,\n\t\t\t\ttoken: server.token,\n\t\t\t\tsessionId: state.session_id,\n\t\t\t\tuserId: state.user_id,\n\t\t\t},\n\t\t\tBoolean(this.debug),\n\t\t);\n\n\t\tnetworking.once('close', this.onNetworkingClose);\n\t\tnetworking.on('stateChange', this.onNetworkingStateChange);\n\t\tnetworking.on('error', this.onNetworkingError);\n\t\tnetworking.on('debug', this.onNetworkingDebug);\n\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\tstatus: VoiceConnectionStatus.Connecting,\n\t\t\tnetworking,\n\t\t};\n\t}\n\n\t/**\n\t * Called when the networking instance for this connection closes. If the close code is 4014 (do not reconnect),\n\t * the voice connection will transition to the Disconnected state which will store the close code. You can\n\t * decide whether or not to reconnect when this occurs by listening for the state change and calling reconnect().\n\t *\n\t * @remarks\n\t * If the close code was anything other than 4014, it is likely that the closing was not intended, and so the\n\t * VoiceConnection will signal to Discord that it would like to rejoin the channel. This automatically attempts\n\t * to re-establish the connection. This would be seen as a transition from the Ready state to the Signalling state.\n\t * @param code - The close code\n\t */\n\tprivate onNetworkingClose(code: number) {\n\t\tif (this.state.status === VoiceConnectionStatus.Destroyed) return;\n\t\t// If networking closes, try to connect to the voice channel again.\n\t\tif (code === 4_014) {\n\t\t\t// Disconnected - networking is already destroyed here\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\treason: VoiceConnectionDisconnectReason.WebSocketClose,\n\t\t\t\tcloseCode: code,\n\t\t\t};\n\t\t} else {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Signalling,\n\t\t\t};\n\t\t\tthis.rejoinAttempts++;\n\t\t\tif (!this.state.adapter.sendPayload(createJoinVoiceChannelPayload(this.joinConfig))) {\n\t\t\t\tthis.state = {\n\t\t\t\t\t...this.state,\n\t\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Called when the state of the networking instance changes. This is used to derive the state of the voice connection.\n\t *\n\t * @param oldState - The previous state\n\t * @param newState - The new state\n\t */\n\tprivate onNetworkingStateChange(oldState: NetworkingState, newState: NetworkingState) {\n\t\tthis.updateReceiveBindings(newState, oldState);\n\t\tif (oldState.code === newState.code) return;\n\t\tif (this.state.status !== VoiceConnectionStatus.Connecting && this.state.status !== VoiceConnectionStatus.Ready)\n\t\t\treturn;\n\n\t\tif (newState.code === NetworkingStatusCode.Ready) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Ready,\n\t\t\t};\n\t\t} else if (newState.code !== NetworkingStatusCode.Closed) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Connecting,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Propagates errors from the underlying network instance.\n\t *\n\t * @param error - The error to propagate\n\t */\n\tprivate onNetworkingError(error: Error) {\n\t\tthis.emit('error', error);\n\t}\n\n\t/**\n\t * Propagates debug messages from the underlying network instance.\n\t *\n\t * @param message - The debug message to propagate\n\t */\n\tprivate onNetworkingDebug(message: string) {\n\t\tthis.debug?.(`[NW] ${message}`);\n\t}\n\n\t/**\n\t * Prepares an audio packet for dispatch.\n\t *\n\t * @param buffer - The Opus packet to prepare\n\t */\n\tpublic prepareAudioPacket(buffer: Buffer) {\n\t\tconst state = this.state;\n\t\tif (state.status !== VoiceConnectionStatus.Ready) return;\n\t\treturn state.networking.prepareAudioPacket(buffer);\n\t}\n\n\t/**\n\t * Dispatches the previously prepared audio packet (if any)\n\t */\n\tpublic dispatchAudio() {\n\t\tconst state = this.state;\n\t\tif (state.status !== VoiceConnectionStatus.Ready) return;\n\t\treturn state.networking.dispatchAudio();\n\t}\n\n\t/**\n\t * Prepares an audio packet and dispatches it immediately.\n\t *\n\t * @param buffer - The Opus packet to play\n\t */\n\tpublic playOpusPacket(buffer: Buffer) {\n\t\tconst state = this.state;\n\t\tif (state.status !== VoiceConnectionStatus.Ready) return;\n\t\tstate.networking.prepareAudioPacket(buffer);\n\t\treturn state.networking.dispatchAudio();\n\t}\n\n\t/**\n\t * Destroys the VoiceConnection, preventing it from connecting to voice again.\n\t * This method should be called when you no longer require the VoiceConnection to\n\t * prevent memory leaks.\n\t *\n\t * @param adapterAvailable - Whether the adapter can be used\n\t */\n\tpublic destroy(adapterAvailable = true) {\n\t\tif (this.state.status === VoiceConnectionStatus.Destroyed) {\n\t\t\tthrow new Error('Cannot destroy VoiceConnection - it has already been destroyed');\n\t\t}\n\n\t\tif (getVoiceConnection(this.joinConfig.guildId, this.joinConfig.group) === this) {\n\t\t\tuntrackVoiceConnection(this);\n\t\t}\n\n\t\tif (adapterAvailable) {\n\t\t\tthis.state.adapter.sendPayload(createJoinVoiceChannelPayload({ ...this.joinConfig, channelId: null }));\n\t\t}\n\n\t\tthis.state = {\n\t\t\tstatus: VoiceConnectionStatus.Destroyed,\n\t\t};\n\t}\n\n\t/**\n\t * Disconnects the VoiceConnection, allowing the possibility of rejoining later on.\n\t *\n\t * @returns `true` if the connection was successfully disconnected\n\t */\n\tpublic disconnect() {\n\t\tif (\n\t\t\tthis.state.status === VoiceConnectionStatus.Destroyed ||\n\t\t\tthis.state.status === VoiceConnectionStatus.Signalling\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.joinConfig.channelId = null;\n\t\tif (!this.state.adapter.sendPayload(createJoinVoiceChannelPayload(this.joinConfig))) {\n\t\t\tthis.state = {\n\t\t\t\tadapter: this.state.adapter,\n\t\t\t\tsubscription: this.state.subscription,\n\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t\t};\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.state = {\n\t\t\tadapter: this.state.adapter,\n\t\t\treason: VoiceConnectionDisconnectReason.Manual,\n\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t};\n\t\treturn true;\n\t}\n\n\t/**\n\t * Attempts to rejoin (better explanation soon:tm:)\n\t *\n\t * @remarks\n\t * Calling this method successfully will automatically increment the `rejoinAttempts` counter,\n\t * which you can use to inform whether or not you'd like to keep attempting to reconnect your\n\t * voice connection.\n\t *\n\t * A state transition from Disconnected to Signalling will be observed when this is called.\n\t */\n\tpublic rejoin(joinConfig?: Omit) {\n\t\tif (this.state.status === VoiceConnectionStatus.Destroyed) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst notReady = this.state.status !== VoiceConnectionStatus.Ready;\n\n\t\tif (notReady) this.rejoinAttempts++;\n\t\tObject.assign(this.joinConfig, joinConfig);\n\t\tif (this.state.adapter.sendPayload(createJoinVoiceChannelPayload(this.joinConfig))) {\n\t\t\tif (notReady) {\n\t\t\t\tthis.state = {\n\t\t\t\t\t...this.state,\n\t\t\t\t\tstatus: VoiceConnectionStatus.Signalling,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tthis.state = {\n\t\t\tadapter: this.state.adapter,\n\t\t\tsubscription: this.state.subscription,\n\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t};\n\t\treturn false;\n\t}\n\n\t/**\n\t * Updates the speaking status of the voice connection. This is used when audio players are done playing audio,\n\t * and need to signal that the connection is no longer playing audio.\n\t *\n\t * @param enabled - Whether or not to show as speaking\n\t */\n\tpublic setSpeaking(enabled: boolean) {\n\t\tif (this.state.status !== VoiceConnectionStatus.Ready) return false;\n\t\t// eslint-disable-next-line @typescript-eslint/no-confusing-void-expression\n\t\treturn this.state.networking.setSpeaking(enabled);\n\t}\n\n\t/**\n\t * Subscribes to an audio player, allowing the player to play audio on this voice connection.\n\t *\n\t * @param player - The audio player to subscribe to\n\t * @returns The created subscription\n\t */\n\tpublic subscribe(player: AudioPlayer) {\n\t\tif (this.state.status === VoiceConnectionStatus.Destroyed) return;\n\n\t\t// eslint-disable-next-line @typescript-eslint/dot-notation\n\t\tconst subscription = player['subscribe'](this);\n\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\tsubscription,\n\t\t};\n\n\t\treturn subscription;\n\t}\n\n\t/**\n\t * The latest ping (in milliseconds) for the WebSocket connection and audio playback for this voice\n\t * connection, if this data is available.\n\t *\n\t * @remarks\n\t * For this data to be available, the VoiceConnection must be in the Ready state, and its underlying\n\t * WebSocket connection and UDP socket must have had at least one ping-pong exchange.\n\t */\n\tpublic get ping() {\n\t\tif (\n\t\t\tthis.state.status === VoiceConnectionStatus.Ready &&\n\t\t\tthis.state.networking.state.code === NetworkingStatusCode.Ready\n\t\t) {\n\t\t\treturn {\n\t\t\t\tws: this.state.networking.state.ws.ping,\n\t\t\t\tudp: this.state.networking.state.udp.ping,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tws: undefined,\n\t\t\tudp: undefined,\n\t\t};\n\t}\n\n\t/**\n\t * Called when a subscription of this voice connection to an audio player is removed.\n\t *\n\t * @param subscription - The removed subscription\n\t */\n\tprotected onSubscriptionRemoved(subscription: PlayerSubscription) {\n\t\tif (this.state.status !== VoiceConnectionStatus.Destroyed && this.state.subscription === subscription) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tsubscription: undefined,\n\t\t\t};\n\t\t}\n\t}\n}\n\n/**\n * Creates a new voice connection.\n *\n * @param joinConfig - The data required to establish the voice connection\n * @param options - The options to use when joining the voice channel\n */\nexport function createVoiceConnection(joinConfig: JoinConfig, options: CreateVoiceConnectionOptions) {\n\tconst payload = createJoinVoiceChannelPayload(joinConfig);\n\tconst existing = getVoiceConnection(joinConfig.guildId, joinConfig.group);\n\tif (existing && existing.state.status !== VoiceConnectionStatus.Destroyed) {\n\t\tif (existing.state.status === VoiceConnectionStatus.Disconnected) {\n\t\t\texisting.rejoin({\n\t\t\t\tchannelId: joinConfig.channelId,\n\t\t\t\tselfDeaf: joinConfig.selfDeaf,\n\t\t\t\tselfMute: joinConfig.selfMute,\n\t\t\t});\n\t\t} else if (!existing.state.adapter.sendPayload(payload)) {\n\t\t\texisting.state = {\n\t\t\t\t...existing.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t\t};\n\t\t}\n\n\t\treturn existing;\n\t}\n\n\tconst voiceConnection = new VoiceConnection(joinConfig, options);\n\ttrackVoiceConnection(voiceConnection);\n\tif (\n\t\tvoiceConnection.state.status !== VoiceConnectionStatus.Destroyed &&\n\t\t!voiceConnection.state.adapter.sendPayload(payload)\n\t) {\n\t\tvoiceConnection.state = {\n\t\t\t...voiceConnection.state,\n\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t};\n\t}\n\n\treturn voiceConnection;\n}\n","import { GatewayOpcodes } from 'discord-api-types/v10';\nimport type { VoiceConnection } from './VoiceConnection';\nimport type { AudioPlayer } from './audio/index';\n\nexport interface JoinConfig {\n\tchannelId: string | null;\n\tgroup: string;\n\tguildId: string;\n\tselfDeaf: boolean;\n\tselfMute: boolean;\n}\n\n/**\n * Sends a voice state update to the main websocket shard of a guild, to indicate joining/leaving/moving across\n * voice channels.\n *\n * @param config - The configuration to use when joining the voice channel\n */\nexport function createJoinVoiceChannelPayload(config: JoinConfig) {\n\treturn {\n\t\top: GatewayOpcodes.VoiceStateUpdate,\n\t\t// eslint-disable-next-line id-length\n\t\td: {\n\t\t\tguild_id: config.guildId,\n\t\t\tchannel_id: config.channelId,\n\t\t\tself_deaf: config.selfDeaf,\n\t\t\tself_mute: config.selfMute,\n\t\t},\n\t};\n}\n\n// Voice Connections\nconst groups = new Map>();\ngroups.set('default', new Map());\n\nfunction getOrCreateGroup(group: string) {\n\tconst existing = groups.get(group);\n\tif (existing) return existing;\n\tconst map = new Map();\n\tgroups.set(group, map);\n\treturn map;\n}\n\n/**\n * Retrieves the map of group names to maps of voice connections. By default, all voice connections\n * are created under the 'default' group.\n *\n * @returns The group map\n */\nexport function getGroups() {\n\treturn groups;\n}\n\n/**\n * Retrieves all the voice connections under the 'default' group.\n *\n * @param group - The group to look up\n * @returns The map of voice connections\n */\nexport function getVoiceConnections(group?: 'default'): Map;\n\n/**\n * Retrieves all the voice connections under the given group name.\n *\n * @param group - The group to look up\n * @returns The map of voice connections\n */\nexport function getVoiceConnections(group: string): Map | undefined;\n\n/**\n * Retrieves all the voice connections under the given group name. Defaults to the 'default' group.\n *\n * @param group - The group to look up\n * @returns The map of voice connections\n */\nexport function getVoiceConnections(group = 'default') {\n\treturn groups.get(group);\n}\n\n/**\n * Finds a voice connection with the given guild id and group. Defaults to the 'default' group.\n *\n * @param guildId - The guild id of the voice connection\n * @param group - the group that the voice connection was registered with\n * @returns The voice connection, if it exists\n */\nexport function getVoiceConnection(guildId: string, group = 'default') {\n\treturn getVoiceConnections(group)?.get(guildId);\n}\n\nexport function untrackVoiceConnection(voiceConnection: VoiceConnection) {\n\treturn getVoiceConnections(voiceConnection.joinConfig.group)?.delete(voiceConnection.joinConfig.guildId);\n}\n\nexport function trackVoiceConnection(voiceConnection: VoiceConnection) {\n\treturn getOrCreateGroup(voiceConnection.joinConfig.group).set(voiceConnection.joinConfig.guildId, voiceConnection);\n}\n\n// Audio Players\n\n// Each audio packet is 20ms long\nconst FRAME_LENGTH = 20;\n\nlet audioCycleInterval: NodeJS.Timeout | undefined;\nlet nextTime = -1;\n\n/**\n * A list of created audio players that are still active and haven't been destroyed.\n */\nconst audioPlayers: AudioPlayer[] = [];\n\n/**\n * Called roughly every 20 milliseconds. Dispatches audio from all players, and then gets the players to prepare\n * the next audio frame.\n */\nfunction audioCycleStep() {\n\tif (nextTime === -1) return;\n\n\tnextTime += FRAME_LENGTH;\n\tconst available = audioPlayers.filter((player) => player.checkPlayable());\n\n\tfor (const player of available) {\n\t\t// eslint-disable-next-line @typescript-eslint/dot-notation\n\t\tplayer['_stepDispatch']();\n\t}\n\n\tprepareNextAudioFrame(available);\n}\n\n/**\n * Recursively gets the players that have been passed as parameters to prepare audio frames that can be played\n * at the start of the next cycle.\n */\nfunction prepareNextAudioFrame(players: AudioPlayer[]) {\n\tconst nextPlayer = players.shift();\n\n\tif (!nextPlayer) {\n\t\tif (nextTime !== -1) {\n\t\t\taudioCycleInterval = setTimeout(() => audioCycleStep(), nextTime - Date.now());\n\t\t}\n\n\t\treturn;\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/dot-notation\n\tnextPlayer['_stepPrepare']();\n\n\t// setImmediate to avoid long audio player chains blocking other scheduled tasks\n\tsetImmediate(() => prepareNextAudioFrame(players));\n}\n\n/**\n * Checks whether or not the given audio player is being driven by the data store clock.\n *\n * @param target - The target to test for\n * @returns `true` if it is being tracked, `false` otherwise\n */\nexport function hasAudioPlayer(target: AudioPlayer) {\n\treturn audioPlayers.includes(target);\n}\n\n/**\n * Adds an audio player to the data store tracking list, if it isn't already there.\n *\n * @param player - The player to track\n */\nexport function addAudioPlayer(player: AudioPlayer) {\n\tif (hasAudioPlayer(player)) return player;\n\taudioPlayers.push(player);\n\tif (audioPlayers.length === 1) {\n\t\tnextTime = Date.now();\n\t\tsetImmediate(() => audioCycleStep());\n\t}\n\n\treturn player;\n}\n\n/**\n * Removes an audio player from the data store tracking list, if it is present there.\n */\nexport function deleteAudioPlayer(player: AudioPlayer) {\n\tconst index = audioPlayers.indexOf(player);\n\tif (index === -1) return;\n\taudioPlayers.splice(index, 1);\n\tif (audioPlayers.length === 0) {\n\t\tnextTime = -1;\n\t\tif (audioCycleInterval !== undefined) clearTimeout(audioCycleInterval);\n\t}\n}\n","/* eslint-disable jsdoc/check-param-names */\n/* eslint-disable id-length */\n/* eslint-disable @typescript-eslint/unbound-method */\nimport { Buffer } from 'node:buffer';\nimport { EventEmitter } from 'node:events';\nimport { VoiceOpcodes } from 'discord-api-types/voice/v4';\nimport type { CloseEvent } from 'ws';\nimport * as secretbox from '../util/Secretbox';\nimport { noop } from '../util/util';\nimport { VoiceUDPSocket } from './VoiceUDPSocket';\nimport { VoiceWebSocket } from './VoiceWebSocket';\n\n// The number of audio channels required by Discord\nconst CHANNELS = 2;\nconst TIMESTAMP_INC = (48_000 / 100) * CHANNELS;\nconst MAX_NONCE_SIZE = 2 ** 32 - 1;\n\nexport const SUPPORTED_ENCRYPTION_MODES = ['xsalsa20_poly1305_lite', 'xsalsa20_poly1305_suffix', 'xsalsa20_poly1305'];\n\n/**\n * The different statuses that a networking instance can hold. The order\n * of the states between OpeningWs and Ready is chronological (first the\n * instance enters OpeningWs, then it enters Identifying etc.)\n */\nexport enum NetworkingStatusCode {\n\tOpeningWs,\n\tIdentifying,\n\tUdpHandshaking,\n\tSelectingProtocol,\n\tReady,\n\tResuming,\n\tClosed,\n}\n\n/**\n * The initial Networking state. Instances will be in this state when a WebSocket connection to a Discord\n * voice gateway is being opened.\n */\nexport interface NetworkingOpeningWsState {\n\tcode: NetworkingStatusCode.OpeningWs;\n\tconnectionOptions: ConnectionOptions;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when it is attempting to authorize itself.\n */\nexport interface NetworkingIdentifyingState {\n\tcode: NetworkingStatusCode.Identifying;\n\tconnectionOptions: ConnectionOptions;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when opening a UDP connection to the IP and port provided\n * by Discord, as well as performing IP discovery.\n */\nexport interface NetworkingUdpHandshakingState {\n\tcode: NetworkingStatusCode.UdpHandshaking;\n\tconnectionData: Pick;\n\tconnectionOptions: ConnectionOptions;\n\tudp: VoiceUDPSocket;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when selecting an encryption protocol for audio packets.\n */\nexport interface NetworkingSelectingProtocolState {\n\tcode: NetworkingStatusCode.SelectingProtocol;\n\tconnectionData: Pick;\n\tconnectionOptions: ConnectionOptions;\n\tudp: VoiceUDPSocket;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when it has a fully established connection to a Discord\n * voice server.\n */\nexport interface NetworkingReadyState {\n\tcode: NetworkingStatusCode.Ready;\n\tconnectionData: ConnectionData;\n\tconnectionOptions: ConnectionOptions;\n\tpreparedPacket?: Buffer | undefined;\n\tudp: VoiceUDPSocket;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when its connection has been dropped unexpectedly, and it\n * is attempting to resume an existing session.\n */\nexport interface NetworkingResumingState {\n\tcode: NetworkingStatusCode.Resuming;\n\tconnectionData: ConnectionData;\n\tconnectionOptions: ConnectionOptions;\n\tpreparedPacket?: Buffer | undefined;\n\tudp: VoiceUDPSocket;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when it has been destroyed. It cannot be recovered from this\n * state.\n */\nexport interface NetworkingClosedState {\n\tcode: NetworkingStatusCode.Closed;\n}\n\n/**\n * The various states that a networking instance can be in.\n */\nexport type NetworkingState =\n\t| NetworkingClosedState\n\t| NetworkingIdentifyingState\n\t| NetworkingOpeningWsState\n\t| NetworkingReadyState\n\t| NetworkingResumingState\n\t| NetworkingSelectingProtocolState\n\t| NetworkingUdpHandshakingState;\n\n/**\n * Details required to connect to the Discord voice gateway. These details\n * are first received on the main bot gateway, in the form of VOICE_SERVER_UPDATE\n * and VOICE_STATE_UPDATE packets.\n */\ninterface ConnectionOptions {\n\tendpoint: string;\n\tserverId: string;\n\tsessionId: string;\n\ttoken: string;\n\tuserId: string;\n}\n\n/**\n * Information about the current connection, e.g. which encryption mode is to be used on\n * the connection, timing information for playback of streams.\n */\nexport interface ConnectionData {\n\tencryptionMode: string;\n\tnonce: number;\n\tnonceBuffer: Buffer;\n\tpacketsPlayed: number;\n\tsecretKey: Uint8Array;\n\tsequence: number;\n\tspeaking: boolean;\n\tssrc: number;\n\ttimestamp: number;\n}\n\n/**\n * An empty buffer that is reused in packet encryption by many different networking instances.\n */\nconst nonce = Buffer.alloc(24);\n\nexport interface Networking extends EventEmitter {\n\t/**\n\t * Debug event for Networking.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'debug', listener: (message: string) => void): this;\n\ton(event: 'error', listener: (error: Error) => void): this;\n\ton(event: 'stateChange', listener: (oldState: NetworkingState, newState: NetworkingState) => void): this;\n\ton(event: 'close', listener: (code: number) => void): this;\n}\n\n/**\n * Stringifies a NetworkingState.\n *\n * @param state - The state to stringify\n */\nfunction stringifyState(state: NetworkingState) {\n\treturn JSON.stringify({\n\t\t...state,\n\t\tws: Reflect.has(state, 'ws'),\n\t\tudp: Reflect.has(state, 'udp'),\n\t});\n}\n\n/**\n * Chooses an encryption mode from a list of given options. Chooses the most preferred option.\n *\n * @param options - The available encryption options\n */\nfunction chooseEncryptionMode(options: string[]): string {\n\tconst option = options.find((option) => SUPPORTED_ENCRYPTION_MODES.includes(option));\n\tif (!option) {\n\t\tthrow new Error(`No compatible encryption modes. Available include: ${options.join(', ')}`);\n\t}\n\n\treturn option;\n}\n\n/**\n * Returns a random number that is in the range of n bits.\n *\n * @param numberOfBits - The number of bits\n */\nfunction randomNBit(numberOfBits: number) {\n\treturn Math.floor(Math.random() * 2 ** numberOfBits);\n}\n\n/**\n * Manages the networking required to maintain a voice connection and dispatch audio packets\n */\nexport class Networking extends EventEmitter {\n\tprivate _state: NetworkingState;\n\n\t/**\n\t * The debug logger function, if debugging is enabled.\n\t */\n\tprivate readonly debug: ((message: string) => void) | null;\n\n\t/**\n\t * Creates a new Networking instance.\n\t */\n\tpublic constructor(options: ConnectionOptions, debug: boolean) {\n\t\tsuper();\n\n\t\tthis.onWsOpen = this.onWsOpen.bind(this);\n\t\tthis.onChildError = this.onChildError.bind(this);\n\t\tthis.onWsPacket = this.onWsPacket.bind(this);\n\t\tthis.onWsClose = this.onWsClose.bind(this);\n\t\tthis.onWsDebug = this.onWsDebug.bind(this);\n\t\tthis.onUdpDebug = this.onUdpDebug.bind(this);\n\t\tthis.onUdpClose = this.onUdpClose.bind(this);\n\n\t\tthis.debug = debug ? (message: string) => this.emit('debug', message) : null;\n\n\t\tthis._state = {\n\t\t\tcode: NetworkingStatusCode.OpeningWs,\n\t\t\tws: this.createWebSocket(options.endpoint),\n\t\t\tconnectionOptions: options,\n\t\t};\n\t}\n\n\t/**\n\t * Destroys the Networking instance, transitioning it into the Closed state.\n\t */\n\tpublic destroy() {\n\t\tthis.state = {\n\t\t\tcode: NetworkingStatusCode.Closed,\n\t\t};\n\t}\n\n\t/**\n\t * The current state of the networking instance.\n\t */\n\tpublic get state(): NetworkingState {\n\t\treturn this._state;\n\t}\n\n\t/**\n\t * Sets a new state for the networking instance, performing clean-up operations where necessary.\n\t */\n\tpublic set state(newState: NetworkingState) {\n\t\tconst oldWs = Reflect.get(this._state, 'ws') as VoiceWebSocket | undefined;\n\t\tconst newWs = Reflect.get(newState, 'ws') as VoiceWebSocket | undefined;\n\t\tif (oldWs && oldWs !== newWs) {\n\t\t\t// The old WebSocket is being freed - remove all handlers from it\n\t\t\toldWs.off('debug', this.onWsDebug);\n\t\t\toldWs.on('error', noop);\n\t\t\toldWs.off('error', this.onChildError);\n\t\t\toldWs.off('open', this.onWsOpen);\n\t\t\toldWs.off('packet', this.onWsPacket);\n\t\t\toldWs.off('close', this.onWsClose);\n\t\t\toldWs.destroy();\n\t\t}\n\n\t\tconst oldUdp = Reflect.get(this._state, 'udp') as VoiceUDPSocket | undefined;\n\t\tconst newUdp = Reflect.get(newState, 'udp') as VoiceUDPSocket | undefined;\n\n\t\tif (oldUdp && oldUdp !== newUdp) {\n\t\t\toldUdp.on('error', noop);\n\t\t\toldUdp.off('error', this.onChildError);\n\t\t\toldUdp.off('close', this.onUdpClose);\n\t\t\toldUdp.off('debug', this.onUdpDebug);\n\t\t\toldUdp.destroy();\n\t\t}\n\n\t\tconst oldState = this._state;\n\t\tthis._state = newState;\n\t\tthis.emit('stateChange', oldState, newState);\n\n\t\tthis.debug?.(`state change:\\nfrom ${stringifyState(oldState)}\\nto ${stringifyState(newState)}`);\n\t}\n\n\t/**\n\t * Creates a new WebSocket to a Discord Voice gateway.\n\t *\n\t * @param endpoint - The endpoint to connect to\n\t */\n\tprivate createWebSocket(endpoint: string) {\n\t\tconst ws = new VoiceWebSocket(`wss://${endpoint}?v=4`, Boolean(this.debug));\n\n\t\tws.on('error', this.onChildError);\n\t\tws.once('open', this.onWsOpen);\n\t\tws.on('packet', this.onWsPacket);\n\t\tws.once('close', this.onWsClose);\n\t\tws.on('debug', this.onWsDebug);\n\n\t\treturn ws;\n\t}\n\n\t/**\n\t * Propagates errors from the children VoiceWebSocket and VoiceUDPSocket.\n\t *\n\t * @param error - The error that was emitted by a child\n\t */\n\tprivate onChildError(error: Error) {\n\t\tthis.emit('error', error);\n\t}\n\n\t/**\n\t * Called when the WebSocket opens. Depending on the state that the instance is in,\n\t * it will either identify with a new session, or it will attempt to resume an existing session.\n\t */\n\tprivate onWsOpen() {\n\t\tif (this.state.code === NetworkingStatusCode.OpeningWs) {\n\t\t\tconst packet = {\n\t\t\t\top: VoiceOpcodes.Identify,\n\t\t\t\td: {\n\t\t\t\t\tserver_id: this.state.connectionOptions.serverId,\n\t\t\t\t\tuser_id: this.state.connectionOptions.userId,\n\t\t\t\t\tsession_id: this.state.connectionOptions.sessionId,\n\t\t\t\t\ttoken: this.state.connectionOptions.token,\n\t\t\t\t},\n\t\t\t};\n\t\t\tthis.state.ws.sendPacket(packet);\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Identifying,\n\t\t\t};\n\t\t} else if (this.state.code === NetworkingStatusCode.Resuming) {\n\t\t\tconst packet = {\n\t\t\t\top: VoiceOpcodes.Resume,\n\t\t\t\td: {\n\t\t\t\t\tserver_id: this.state.connectionOptions.serverId,\n\t\t\t\t\tsession_id: this.state.connectionOptions.sessionId,\n\t\t\t\t\ttoken: this.state.connectionOptions.token,\n\t\t\t\t},\n\t\t\t};\n\t\t\tthis.state.ws.sendPacket(packet);\n\t\t}\n\t}\n\n\t/**\n\t * Called when the WebSocket closes. Based on the reason for closing (given by the code parameter),\n\t * the instance will either attempt to resume, or enter the closed state and emit a 'close' event\n\t * with the close code, allowing the user to decide whether or not they would like to reconnect.\n\t *\n\t * @param code - The close code\n\t */\n\tprivate onWsClose({ code }: CloseEvent) {\n\t\tconst canResume = code === 4_015 || code < 4_000;\n\t\tif (canResume && this.state.code === NetworkingStatusCode.Ready) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Resuming,\n\t\t\t\tws: this.createWebSocket(this.state.connectionOptions.endpoint),\n\t\t\t};\n\t\t} else if (this.state.code !== NetworkingStatusCode.Closed) {\n\t\t\tthis.destroy();\n\t\t\tthis.emit('close', code);\n\t\t}\n\t}\n\n\t/**\n\t * Called when the UDP socket has closed itself if it has stopped receiving replies from Discord.\n\t */\n\tprivate onUdpClose() {\n\t\tif (this.state.code === NetworkingStatusCode.Ready) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Resuming,\n\t\t\t\tws: this.createWebSocket(this.state.connectionOptions.endpoint),\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Called when a packet is received on the connection's WebSocket.\n\t *\n\t * @param packet - The received packet\n\t */\n\tprivate onWsPacket(packet: any) {\n\t\tif (packet.op === VoiceOpcodes.Hello && this.state.code !== NetworkingStatusCode.Closed) {\n\t\t\tthis.state.ws.setHeartbeatInterval(packet.d.heartbeat_interval);\n\t\t} else if (packet.op === VoiceOpcodes.Ready && this.state.code === NetworkingStatusCode.Identifying) {\n\t\t\tconst { ip, port, ssrc, modes } = packet.d;\n\n\t\t\tconst udp = new VoiceUDPSocket({ ip, port });\n\t\t\tudp.on('error', this.onChildError);\n\t\t\tudp.on('debug', this.onUdpDebug);\n\t\t\tudp.once('close', this.onUdpClose);\n\t\t\tudp\n\t\t\t\t.performIPDiscovery(ssrc)\n\t\t\t\t// eslint-disable-next-line promise/prefer-await-to-then\n\t\t\t\t.then((localConfig) => {\n\t\t\t\t\tif (this.state.code !== NetworkingStatusCode.UdpHandshaking) return;\n\t\t\t\t\tthis.state.ws.sendPacket({\n\t\t\t\t\t\top: VoiceOpcodes.SelectProtocol,\n\t\t\t\t\t\td: {\n\t\t\t\t\t\t\tprotocol: 'udp',\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\taddress: localConfig.ip,\n\t\t\t\t\t\t\t\tport: localConfig.port,\n\t\t\t\t\t\t\t\tmode: chooseEncryptionMode(modes),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\tthis.state = {\n\t\t\t\t\t\t...this.state,\n\t\t\t\t\t\tcode: NetworkingStatusCode.SelectingProtocol,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t// eslint-disable-next-line promise/prefer-await-to-then, promise/prefer-await-to-callbacks\n\t\t\t\t.catch((error: Error) => this.emit('error', error));\n\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.UdpHandshaking,\n\t\t\t\tudp,\n\t\t\t\tconnectionData: {\n\t\t\t\t\tssrc,\n\t\t\t\t},\n\t\t\t};\n\t\t} else if (\n\t\t\tpacket.op === VoiceOpcodes.SessionDescription &&\n\t\t\tthis.state.code === NetworkingStatusCode.SelectingProtocol\n\t\t) {\n\t\t\tconst { mode: encryptionMode, secret_key: secretKey } = packet.d;\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Ready,\n\t\t\t\tconnectionData: {\n\t\t\t\t\t...this.state.connectionData,\n\t\t\t\t\tencryptionMode,\n\t\t\t\t\tsecretKey: new Uint8Array(secretKey),\n\t\t\t\t\tsequence: randomNBit(16),\n\t\t\t\t\ttimestamp: randomNBit(32),\n\t\t\t\t\tnonce: 0,\n\t\t\t\t\tnonceBuffer: Buffer.alloc(24),\n\t\t\t\t\tspeaking: false,\n\t\t\t\t\tpacketsPlayed: 0,\n\t\t\t\t},\n\t\t\t};\n\t\t} else if (packet.op === VoiceOpcodes.Resumed && this.state.code === NetworkingStatusCode.Resuming) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Ready,\n\t\t\t};\n\t\t\tthis.state.connectionData.speaking = false;\n\t\t}\n\t}\n\n\t/**\n\t * Propagates debug messages from the child WebSocket.\n\t *\n\t * @param message - The emitted debug message\n\t */\n\tprivate onWsDebug(message: string) {\n\t\tthis.debug?.(`[WS] ${message}`);\n\t}\n\n\t/**\n\t * Propagates debug messages from the child UDPSocket.\n\t *\n\t * @param message - The emitted debug message\n\t */\n\tprivate onUdpDebug(message: string) {\n\t\tthis.debug?.(`[UDP] ${message}`);\n\t}\n\n\t/**\n\t * Prepares an Opus packet for playback. This includes attaching metadata to it and encrypting it.\n\t * It will be stored within the instance, and can be played by dispatchAudio()\n\t *\n\t * @remarks\n\t * Calling this method while there is already a prepared audio packet that has not yet been dispatched\n\t * will overwrite the existing audio packet. This should be avoided.\n\t * @param opusPacket - The Opus packet to encrypt\n\t * @returns The audio packet that was prepared\n\t */\n\tpublic prepareAudioPacket(opusPacket: Buffer) {\n\t\tconst state = this.state;\n\t\tif (state.code !== NetworkingStatusCode.Ready) return;\n\t\tstate.preparedPacket = this.createAudioPacket(opusPacket, state.connectionData);\n\t\treturn state.preparedPacket;\n\t}\n\n\t/**\n\t * Dispatches the audio packet previously prepared by prepareAudioPacket(opusPacket). The audio packet\n\t * is consumed and cannot be dispatched again.\n\t */\n\tpublic dispatchAudio() {\n\t\tconst state = this.state;\n\t\tif (state.code !== NetworkingStatusCode.Ready) return false;\n\t\tif (state.preparedPacket !== undefined) {\n\t\t\tthis.playAudioPacket(state.preparedPacket);\n\t\t\tstate.preparedPacket = undefined;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Plays an audio packet, updating timing metadata used for playback.\n\t *\n\t * @param audioPacket - The audio packet to play\n\t */\n\tprivate playAudioPacket(audioPacket: Buffer) {\n\t\tconst state = this.state;\n\t\tif (state.code !== NetworkingStatusCode.Ready) return;\n\t\tconst { connectionData } = state;\n\t\tconnectionData.packetsPlayed++;\n\t\tconnectionData.sequence++;\n\t\tconnectionData.timestamp += TIMESTAMP_INC;\n\t\tif (connectionData.sequence >= 2 ** 16) connectionData.sequence = 0;\n\t\tif (connectionData.timestamp >= 2 ** 32) connectionData.timestamp = 0;\n\t\tthis.setSpeaking(true);\n\t\tstate.udp.send(audioPacket);\n\t}\n\n\t/**\n\t * Sends a packet to the voice gateway indicating that the client has start/stopped sending\n\t * audio.\n\t *\n\t * @param speaking - Whether or not the client should be shown as speaking\n\t */\n\tpublic setSpeaking(speaking: boolean) {\n\t\tconst state = this.state;\n\t\tif (state.code !== NetworkingStatusCode.Ready) return;\n\t\tif (state.connectionData.speaking === speaking) return;\n\t\tstate.connectionData.speaking = speaking;\n\t\tstate.ws.sendPacket({\n\t\t\top: VoiceOpcodes.Speaking,\n\t\t\td: {\n\t\t\t\tspeaking: speaking ? 1 : 0,\n\t\t\t\tdelay: 0,\n\t\t\t\tssrc: state.connectionData.ssrc,\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Creates a new audio packet from an Opus packet. This involves encrypting the packet,\n\t * then prepending a header that includes metadata.\n\t *\n\t * @param opusPacket - The Opus packet to prepare\n\t * @param connectionData - The current connection data of the instance\n\t */\n\tprivate createAudioPacket(opusPacket: Buffer, connectionData: ConnectionData) {\n\t\tconst packetBuffer = Buffer.alloc(12);\n\t\tpacketBuffer[0] = 0x80;\n\t\tpacketBuffer[1] = 0x78;\n\n\t\tconst { sequence, timestamp, ssrc } = connectionData;\n\n\t\tpacketBuffer.writeUIntBE(sequence, 2, 2);\n\t\tpacketBuffer.writeUIntBE(timestamp, 4, 4);\n\t\tpacketBuffer.writeUIntBE(ssrc, 8, 4);\n\n\t\tpacketBuffer.copy(nonce, 0, 0, 12);\n\t\treturn Buffer.concat([packetBuffer, ...this.encryptOpusPacket(opusPacket, connectionData)]);\n\t}\n\n\t/**\n\t * Encrypts an Opus packet using the format agreed upon by the instance and Discord.\n\t *\n\t * @param opusPacket - The Opus packet to encrypt\n\t * @param connectionData - The current connection data of the instance\n\t */\n\tprivate encryptOpusPacket(opusPacket: Buffer, connectionData: ConnectionData) {\n\t\tconst { secretKey, encryptionMode } = connectionData;\n\n\t\tif (encryptionMode === 'xsalsa20_poly1305_lite') {\n\t\t\tconnectionData.nonce++;\n\t\t\tif (connectionData.nonce > MAX_NONCE_SIZE) connectionData.nonce = 0;\n\t\t\tconnectionData.nonceBuffer.writeUInt32BE(connectionData.nonce, 0);\n\t\t\treturn [\n\t\t\t\tsecretbox.methods.close(opusPacket, connectionData.nonceBuffer, secretKey),\n\t\t\t\tconnectionData.nonceBuffer.slice(0, 4),\n\t\t\t];\n\t\t} else if (encryptionMode === 'xsalsa20_poly1305_suffix') {\n\t\t\tconst random = secretbox.methods.random(24, connectionData.nonceBuffer);\n\t\t\treturn [secretbox.methods.close(opusPacket, random, secretKey), random];\n\t\t}\n\n\t\treturn [secretbox.methods.close(opusPacket, nonce, secretKey)];\n\t}\n}\n","import { Buffer } from 'node:buffer';\n\ninterface Methods {\n\tclose(opusPacket: Buffer, nonce: Buffer, secretKey: Uint8Array): Buffer;\n\topen(buffer: Buffer, nonce: Buffer, secretKey: Uint8Array): Buffer | null;\n\trandom(bytes: number, nonce: Buffer): Buffer;\n}\n\nconst libs = {\n\t'sodium-native': (sodium: any): Methods => ({\n\t\topen: (buffer: Buffer, nonce: Buffer, secretKey: Uint8Array) => {\n\t\t\tif (buffer) {\n\t\t\t\tconst output = Buffer.allocUnsafe(buffer.length - sodium.crypto_box_MACBYTES);\n\t\t\t\tif (sodium.crypto_secretbox_open_easy(output, buffer, nonce, secretKey)) return output;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t},\n\t\tclose: (opusPacket: Buffer, nonce: Buffer, secretKey: Uint8Array) => {\n\t\t\tconst output = Buffer.allocUnsafe(opusPacket.length + sodium.crypto_box_MACBYTES);\n\t\t\tsodium.crypto_secretbox_easy(output, opusPacket, nonce, secretKey);\n\t\t\treturn output;\n\t\t},\n\t\trandom: (num: number, buffer: Buffer = Buffer.allocUnsafe(num)) => {\n\t\t\tsodium.randombytes_buf(buffer);\n\t\t\treturn buffer;\n\t\t},\n\t}),\n\tsodium: (sodium: any): Methods => ({\n\t\topen: sodium.api.crypto_secretbox_open_easy,\n\t\tclose: sodium.api.crypto_secretbox_easy,\n\t\trandom: (num: number, buffer: Buffer = Buffer.allocUnsafe(num)) => {\n\t\t\tsodium.api.randombytes_buf(buffer);\n\t\t\treturn buffer;\n\t\t},\n\t}),\n\t'libsodium-wrappers': (sodium: any): Methods => ({\n\t\topen: sodium.crypto_secretbox_open_easy,\n\t\tclose: sodium.crypto_secretbox_easy,\n\t\trandom: sodium.randombytes_buf,\n\t}),\n\ttweetnacl: (tweetnacl: any): Methods => ({\n\t\topen: tweetnacl.secretbox.open,\n\t\tclose: tweetnacl.secretbox,\n\t\trandom: tweetnacl.randomBytes,\n\t}),\n} as const;\n\nconst fallbackError = () => {\n\tthrow new Error(\n\t\t`Cannot play audio as no valid encryption package is installed.\n- Install sodium, libsodium-wrappers, or tweetnacl.\n- Use the generateDependencyReport() function for more information.\\n`,\n\t);\n};\n\nconst methods: Methods = {\n\topen: fallbackError,\n\tclose: fallbackError,\n\trandom: fallbackError,\n};\n\nvoid (async () => {\n\tfor (const libName of Object.keys(libs) as (keyof typeof libs)[]) {\n\t\ttry {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n\t\t\tconst lib = require(libName);\n\t\t\tif (libName === 'libsodium-wrappers' && lib.ready) await lib.ready;\n\t\t\tObject.assign(methods, libs[libName](lib));\n\t\t\tbreak;\n\t\t} catch {}\n\t}\n})();\n\nexport { methods };\n","export const noop = () => {};\n","import { Buffer } from 'node:buffer';\nimport { createSocket, type Socket } from 'node:dgram';\nimport { EventEmitter } from 'node:events';\nimport { isIPv4 } from 'node:net';\n\n/**\n * Stores an IP address and port. Used to store socket details for the local client as well as\n * for Discord.\n */\nexport interface SocketConfig {\n\tip: string;\n\tport: number;\n}\n\n/**\n * Parses the response from Discord to aid with local IP discovery.\n *\n * @param message - The received message\n */\nexport function parseLocalPacket(message: Buffer): SocketConfig {\n\tconst packet = Buffer.from(message);\n\n\tconst ip = packet.slice(8, packet.indexOf(0, 8)).toString('utf8');\n\n\tif (!isIPv4(ip)) {\n\t\tthrow new Error('Malformed IP address');\n\t}\n\n\tconst port = packet.readUInt16BE(packet.length - 2);\n\n\treturn { ip, port };\n}\n\n/**\n * The interval in milliseconds at which keep alive datagrams are sent.\n */\nconst KEEP_ALIVE_INTERVAL = 5e3;\n\n/**\n * The maximum value of the keep alive counter.\n */\nconst MAX_COUNTER_VALUE = 2 ** 32 - 1;\n\nexport interface VoiceUDPSocket extends EventEmitter {\n\ton(event: 'error', listener: (error: Error) => void): this;\n\ton(event: 'close', listener: () => void): this;\n\ton(event: 'debug', listener: (message: string) => void): this;\n\ton(event: 'message', listener: (message: Buffer) => void): this;\n}\n\n/**\n * Manages the UDP networking for a voice connection.\n */\nexport class VoiceUDPSocket extends EventEmitter {\n\t/**\n\t * The underlying network Socket for the VoiceUDPSocket.\n\t */\n\tprivate readonly socket: Socket;\n\n\t/**\n\t * The socket details for Discord (remote)\n\t */\n\tprivate readonly remote: SocketConfig;\n\n\t/**\n\t * The counter used in the keep alive mechanism.\n\t */\n\tprivate keepAliveCounter = 0;\n\n\t/**\n\t * The buffer used to write the keep alive counter into.\n\t */\n\tprivate readonly keepAliveBuffer: Buffer;\n\n\t/**\n\t * The Node.js interval for the keep-alive mechanism.\n\t */\n\tprivate readonly keepAliveInterval: NodeJS.Timeout;\n\n\t/**\n\t * The time taken to receive a response to keep alive messages.\n\t *\n\t * @deprecated This field is no longer updated as keep alive messages are no longer tracked.\n\t */\n\tpublic ping?: number;\n\n\t/**\n\t * Creates a new VoiceUDPSocket.\n\t *\n\t * @param remote - Details of the remote socket\n\t */\n\tpublic constructor(remote: SocketConfig) {\n\t\tsuper();\n\t\tthis.socket = createSocket('udp4');\n\t\tthis.socket.on('error', (error: Error) => this.emit('error', error));\n\t\tthis.socket.on('message', (buffer: Buffer) => this.onMessage(buffer));\n\t\tthis.socket.on('close', () => this.emit('close'));\n\t\tthis.remote = remote;\n\t\tthis.keepAliveBuffer = Buffer.alloc(8);\n\t\tthis.keepAliveInterval = setInterval(() => this.keepAlive(), KEEP_ALIVE_INTERVAL);\n\t\tsetImmediate(() => this.keepAlive());\n\t}\n\n\t/**\n\t * Called when a message is received on the UDP socket.\n\t *\n\t * @param buffer - The received buffer\n\t */\n\tprivate onMessage(buffer: Buffer): void {\n\t\t// Propagate the message\n\t\tthis.emit('message', buffer);\n\t}\n\n\t/**\n\t * Called at a regular interval to check whether we are still able to send datagrams to Discord.\n\t */\n\tprivate keepAlive() {\n\t\tthis.keepAliveBuffer.writeUInt32LE(this.keepAliveCounter, 0);\n\t\tthis.send(this.keepAliveBuffer);\n\t\tthis.keepAliveCounter++;\n\t\tif (this.keepAliveCounter > MAX_COUNTER_VALUE) {\n\t\t\tthis.keepAliveCounter = 0;\n\t\t}\n\t}\n\n\t/**\n\t * Sends a buffer to Discord.\n\t *\n\t * @param buffer - The buffer to send\n\t */\n\tpublic send(buffer: Buffer) {\n\t\tthis.socket.send(buffer, this.remote.port, this.remote.ip);\n\t}\n\n\t/**\n\t * Closes the socket, the instance will not be able to be reused.\n\t */\n\tpublic destroy() {\n\t\ttry {\n\t\t\tthis.socket.close();\n\t\t} catch {}\n\n\t\tclearInterval(this.keepAliveInterval);\n\t}\n\n\t/**\n\t * Performs IP discovery to discover the local address and port to be used for the voice connection.\n\t *\n\t * @param ssrc - The SSRC received from Discord\n\t */\n\tpublic async performIPDiscovery(ssrc: number): Promise {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst listener = (message: Buffer) => {\n\t\t\t\ttry {\n\t\t\t\t\tif (message.readUInt16BE(0) !== 2) return;\n\t\t\t\t\tconst packet = parseLocalPacket(message);\n\t\t\t\t\tthis.socket.off('message', listener);\n\t\t\t\t\tresolve(packet);\n\t\t\t\t} catch {}\n\t\t\t};\n\n\t\t\tthis.socket.on('message', listener);\n\t\t\tthis.socket.once('close', () => reject(new Error('Cannot perform IP discovery - socket closed')));\n\n\t\t\tconst discoveryBuffer = Buffer.alloc(74);\n\n\t\t\tdiscoveryBuffer.writeUInt16BE(1, 0);\n\t\t\tdiscoveryBuffer.writeUInt16BE(70, 2);\n\t\t\tdiscoveryBuffer.writeUInt32BE(ssrc, 4);\n\t\t\tthis.send(discoveryBuffer);\n\t\t});\n\t}\n}\n","import { EventEmitter } from 'node:events';\nimport { VoiceOpcodes } from 'discord-api-types/voice/v4';\nimport WebSocket, { type MessageEvent } from 'ws';\n\nexport interface VoiceWebSocket extends EventEmitter {\n\ton(event: 'error', listener: (error: Error) => void): this;\n\ton(event: 'open', listener: (event: WebSocket.Event) => void): this;\n\ton(event: 'close', listener: (event: WebSocket.CloseEvent) => void): this;\n\t/**\n\t * Debug event for VoiceWebSocket.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'debug', listener: (message: string) => void): this;\n\t/**\n\t * Packet event.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'packet', listener: (packet: any) => void): this;\n}\n\n/**\n * An extension of the WebSocket class to provide helper functionality when interacting\n * with the Discord Voice gateway.\n */\nexport class VoiceWebSocket extends EventEmitter {\n\t/**\n\t * The current heartbeat interval, if any.\n\t */\n\tprivate heartbeatInterval?: NodeJS.Timeout;\n\n\t/**\n\t * The time (milliseconds since UNIX epoch) that the last heartbeat acknowledgement packet was received.\n\t * This is set to 0 if an acknowledgement packet hasn't been received yet.\n\t */\n\tprivate lastHeartbeatAck: number;\n\n\t/**\n\t * The time (milliseconds since UNIX epoch) that the last heartbeat was sent. This is set to 0 if a heartbeat\n\t * hasn't been sent yet.\n\t */\n\tprivate lastHeartbeatSend: number;\n\n\t/**\n\t * The number of consecutively missed heartbeats.\n\t */\n\tprivate missedHeartbeats = 0;\n\n\t/**\n\t * The last recorded ping.\n\t */\n\tpublic ping?: number;\n\n\t/**\n\t * The debug logger function, if debugging is enabled.\n\t */\n\tprivate readonly debug: ((message: string) => void) | null;\n\n\t/**\n\t * The underlying WebSocket of this wrapper.\n\t */\n\tprivate readonly ws: WebSocket;\n\n\t/**\n\t * Creates a new VoiceWebSocket.\n\t *\n\t * @param address - The address to connect to\n\t */\n\tpublic constructor(address: string, debug: boolean) {\n\t\tsuper();\n\t\tthis.ws = new WebSocket(address);\n\t\tthis.ws.onmessage = (err) => this.onMessage(err);\n\t\tthis.ws.onopen = (err) => this.emit('open', err);\n\t\tthis.ws.onerror = (err: Error | WebSocket.ErrorEvent) => this.emit('error', err instanceof Error ? err : err.error);\n\t\tthis.ws.onclose = (err) => this.emit('close', err);\n\n\t\tthis.lastHeartbeatAck = 0;\n\t\tthis.lastHeartbeatSend = 0;\n\n\t\tthis.debug = debug ? (message: string) => this.emit('debug', message) : null;\n\t}\n\n\t/**\n\t * Destroys the VoiceWebSocket. The heartbeat interval is cleared, and the connection is closed.\n\t */\n\tpublic destroy() {\n\t\ttry {\n\t\t\tthis.debug?.('destroyed');\n\t\t\tthis.setHeartbeatInterval(-1);\n\t\t\tthis.ws.close(1_000);\n\t\t} catch (error) {\n\t\t\tconst err = error as Error;\n\t\t\tthis.emit('error', err);\n\t\t}\n\t}\n\n\t/**\n\t * Handles message events on the WebSocket. Attempts to JSON parse the messages and emit them\n\t * as packets.\n\t *\n\t * @param event - The message event\n\t */\n\tpublic onMessage(event: MessageEvent) {\n\t\tif (typeof event.data !== 'string') return;\n\n\t\tthis.debug?.(`<< ${event.data}`);\n\n\t\tlet packet: any;\n\t\ttry {\n\t\t\tpacket = JSON.parse(event.data);\n\t\t} catch (error) {\n\t\t\tconst err = error as Error;\n\t\t\tthis.emit('error', err);\n\t\t\treturn;\n\t\t}\n\n\t\tif (packet.op === VoiceOpcodes.HeartbeatAck) {\n\t\t\tthis.lastHeartbeatAck = Date.now();\n\t\t\tthis.missedHeartbeats = 0;\n\t\t\tthis.ping = this.lastHeartbeatAck - this.lastHeartbeatSend;\n\t\t}\n\n\t\tthis.emit('packet', packet);\n\t}\n\n\t/**\n\t * Sends a JSON-stringifiable packet over the WebSocket.\n\t *\n\t * @param packet - The packet to send\n\t */\n\tpublic sendPacket(packet: any) {\n\t\ttry {\n\t\t\tconst stringified = JSON.stringify(packet);\n\t\t\tthis.debug?.(`>> ${stringified}`);\n\t\t\tthis.ws.send(stringified);\n\t\t} catch (error) {\n\t\t\tconst err = error as Error;\n\t\t\tthis.emit('error', err);\n\t\t}\n\t}\n\n\t/**\n\t * Sends a heartbeat over the WebSocket.\n\t */\n\tprivate sendHeartbeat() {\n\t\tthis.lastHeartbeatSend = Date.now();\n\t\tthis.missedHeartbeats++;\n\t\tconst nonce = this.lastHeartbeatSend;\n\t\tthis.sendPacket({\n\t\t\top: VoiceOpcodes.Heartbeat,\n\t\t\t// eslint-disable-next-line id-length\n\t\t\td: nonce,\n\t\t});\n\t}\n\n\t/**\n\t * Sets/clears an interval to send heartbeats over the WebSocket.\n\t *\n\t * @param ms - The interval in milliseconds. If negative, the interval will be unset\n\t */\n\tpublic setHeartbeatInterval(ms: number) {\n\t\tif (this.heartbeatInterval !== undefined) clearInterval(this.heartbeatInterval);\n\t\tif (ms > 0) {\n\t\t\tthis.heartbeatInterval = setInterval(() => {\n\t\t\t\tif (this.lastHeartbeatSend !== 0 && this.missedHeartbeats >= 3) {\n\t\t\t\t\t// Missed too many heartbeats - disconnect\n\t\t\t\t\tthis.ws.close();\n\t\t\t\t\tthis.setHeartbeatInterval(-1);\n\t\t\t\t}\n\n\t\t\t\tthis.sendHeartbeat();\n\t\t\t}, ms);\n\t\t}\n\t}\n}\n","/* eslint-disable jsdoc/check-param-names */\n\nimport { Buffer } from 'node:buffer';\nimport { VoiceOpcodes } from 'discord-api-types/voice/v4';\nimport type { VoiceConnection } from '../VoiceConnection';\nimport type { ConnectionData } from '../networking/Networking';\nimport { methods } from '../util/Secretbox';\nimport {\n\tAudioReceiveStream,\n\tcreateDefaultAudioReceiveStreamOptions,\n\ttype AudioReceiveStreamOptions,\n} from './AudioReceiveStream';\nimport { SSRCMap } from './SSRCMap';\nimport { SpeakingMap } from './SpeakingMap';\n\n/**\n * Attaches to a VoiceConnection, allowing you to receive audio packets from other\n * users that are speaking.\n *\n * @beta\n */\nexport class VoiceReceiver {\n\t/**\n\t * The attached connection of this receiver.\n\t */\n\tpublic readonly voiceConnection;\n\n\t/**\n\t * Maps SSRCs to Discord user ids.\n\t */\n\tpublic readonly ssrcMap: SSRCMap;\n\n\t/**\n\t * The current audio subscriptions of this receiver.\n\t */\n\tpublic readonly subscriptions: Map;\n\n\t/**\n\t * The connection data of the receiver.\n\t *\n\t * @internal\n\t */\n\tpublic connectionData: Partial;\n\n\t/**\n\t * The speaking map of the receiver.\n\t */\n\tpublic readonly speaking: SpeakingMap;\n\n\tpublic constructor(voiceConnection: VoiceConnection) {\n\t\tthis.voiceConnection = voiceConnection;\n\t\tthis.ssrcMap = new SSRCMap();\n\t\tthis.speaking = new SpeakingMap();\n\t\tthis.subscriptions = new Map();\n\t\tthis.connectionData = {};\n\n\t\tthis.onWsPacket = this.onWsPacket.bind(this);\n\t\tthis.onUdpMessage = this.onUdpMessage.bind(this);\n\t}\n\n\t/**\n\t * Called when a packet is received on the attached connection's WebSocket.\n\t *\n\t * @param packet - The received packet\n\t * @internal\n\t */\n\tpublic onWsPacket(packet: any) {\n\t\tif (packet.op === VoiceOpcodes.ClientDisconnect && typeof packet.d?.user_id === 'string') {\n\t\t\tthis.ssrcMap.delete(packet.d.user_id);\n\t\t} else if (\n\t\t\tpacket.op === VoiceOpcodes.Speaking &&\n\t\t\ttypeof packet.d?.user_id === 'string' &&\n\t\t\ttypeof packet.d?.ssrc === 'number'\n\t\t) {\n\t\t\tthis.ssrcMap.update({ userId: packet.d.user_id, audioSSRC: packet.d.ssrc });\n\t\t} else if (\n\t\t\tpacket.op === VoiceOpcodes.ClientConnect &&\n\t\t\ttypeof packet.d?.user_id === 'string' &&\n\t\t\ttypeof packet.d?.audio_ssrc === 'number'\n\t\t) {\n\t\t\tthis.ssrcMap.update({\n\t\t\t\tuserId: packet.d.user_id,\n\t\t\t\taudioSSRC: packet.d.audio_ssrc,\n\t\t\t\tvideoSSRC: packet.d.video_ssrc === 0 ? undefined : packet.d.video_ssrc,\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate decrypt(buffer: Buffer, mode: string, nonce: Buffer, secretKey: Uint8Array) {\n\t\t// Choose correct nonce depending on encryption\n\t\tlet end;\n\t\tif (mode === 'xsalsa20_poly1305_lite') {\n\t\t\tbuffer.copy(nonce, 0, buffer.length - 4);\n\t\t\tend = buffer.length - 4;\n\t\t} else if (mode === 'xsalsa20_poly1305_suffix') {\n\t\t\tbuffer.copy(nonce, 0, buffer.length - 24);\n\t\t\tend = buffer.length - 24;\n\t\t} else {\n\t\t\tbuffer.copy(nonce, 0, 0, 12);\n\t\t}\n\n\t\t// Open packet\n\t\tconst decrypted = methods.open(buffer.slice(12, end), nonce, secretKey);\n\t\tif (!decrypted) return;\n\t\treturn Buffer.from(decrypted);\n\t}\n\n\t/**\n\t * Parses an audio packet, decrypting it to yield an Opus packet.\n\t *\n\t * @param buffer - The buffer to parse\n\t * @param mode - The encryption mode\n\t * @param nonce - The nonce buffer used by the connection for encryption\n\t * @param secretKey - The secret key used by the connection for encryption\n\t * @returns The parsed Opus packet\n\t */\n\tprivate parsePacket(buffer: Buffer, mode: string, nonce: Buffer, secretKey: Uint8Array) {\n\t\tlet packet = this.decrypt(buffer, mode, nonce, secretKey);\n\t\tif (!packet) return;\n\n\t\t// Strip RTP Header Extensions (one-byte only)\n\t\tif (packet[0] === 0xbe && packet[1] === 0xde) {\n\t\t\tconst headerExtensionLength = packet.readUInt16BE(2);\n\t\t\tpacket = packet.subarray(4 + 4 * headerExtensionLength);\n\t\t}\n\n\t\treturn packet;\n\t}\n\n\t/**\n\t * Called when the UDP socket of the attached connection receives a message.\n\t *\n\t * @param msg - The received message\n\t * @internal\n\t */\n\tpublic onUdpMessage(msg: Buffer) {\n\t\tif (msg.length <= 8) return;\n\t\tconst ssrc = msg.readUInt32BE(8);\n\n\t\tconst userData = this.ssrcMap.get(ssrc);\n\t\tif (!userData) return;\n\n\t\tthis.speaking.onPacket(userData.userId);\n\n\t\tconst stream = this.subscriptions.get(userData.userId);\n\t\tif (!stream) return;\n\n\t\tif (this.connectionData.encryptionMode && this.connectionData.nonceBuffer && this.connectionData.secretKey) {\n\t\t\tconst packet = this.parsePacket(\n\t\t\t\tmsg,\n\t\t\t\tthis.connectionData.encryptionMode,\n\t\t\t\tthis.connectionData.nonceBuffer,\n\t\t\t\tthis.connectionData.secretKey,\n\t\t\t);\n\t\t\tif (packet) {\n\t\t\t\tstream.push(packet);\n\t\t\t} else {\n\t\t\t\tstream.destroy(new Error('Failed to parse packet'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Creates a subscription for the given user id.\n\t *\n\t * @param target - The id of the user to subscribe to\n\t * @returns A readable stream of Opus packets received from the target\n\t */\n\tpublic subscribe(userId: string, options?: Partial) {\n\t\tconst existing = this.subscriptions.get(userId);\n\t\tif (existing) return existing;\n\n\t\tconst stream = new AudioReceiveStream({\n\t\t\t...createDefaultAudioReceiveStreamOptions(),\n\t\t\t...options,\n\t\t});\n\n\t\tstream.once('close', () => this.subscriptions.delete(userId));\n\t\tthis.subscriptions.set(userId, stream);\n\t\treturn stream;\n\t}\n}\n","import type { Buffer } from 'node:buffer';\nimport { Readable, type ReadableOptions } from 'node:stream';\nimport { SILENCE_FRAME } from '../audio/AudioPlayer';\n\n/**\n * The different behaviors an audio receive stream can have for deciding when to end.\n */\nexport enum EndBehaviorType {\n\t/**\n\t * The stream will only end when manually destroyed.\n\t */\n\tManual,\n\n\t/**\n\t * The stream will end after a given time period of silence/no audio packets.\n\t */\n\tAfterSilence,\n\n\t/**\n\t * The stream will end after a given time period of no audio packets.\n\t */\n\tAfterInactivity,\n}\n\nexport type EndBehavior =\n\t| {\n\t\t\tbehavior: EndBehaviorType.AfterInactivity | EndBehaviorType.AfterSilence;\n\t\t\tduration: number;\n\t }\n\t| {\n\t\t\tbehavior: EndBehaviorType.Manual;\n\t };\n\nexport interface AudioReceiveStreamOptions extends ReadableOptions {\n\tend: EndBehavior;\n}\n\nexport function createDefaultAudioReceiveStreamOptions(): AudioReceiveStreamOptions {\n\treturn {\n\t\tend: {\n\t\t\tbehavior: EndBehaviorType.Manual,\n\t\t},\n\t};\n}\n\n/**\n * A readable stream of Opus packets received from a specific entity\n * in a Discord voice connection.\n */\nexport class AudioReceiveStream extends Readable {\n\t/**\n\t * The end behavior of the receive stream.\n\t */\n\tpublic readonly end: EndBehavior;\n\n\tprivate endTimeout?: NodeJS.Timeout;\n\n\tpublic constructor({ end, ...options }: AudioReceiveStreamOptions) {\n\t\tsuper({\n\t\t\t...options,\n\t\t\tobjectMode: true,\n\t\t});\n\n\t\tthis.end = end;\n\t}\n\n\tpublic override push(buffer: Buffer | null) {\n\t\tif (\n\t\t\tbuffer &&\n\t\t\t(this.end.behavior === EndBehaviorType.AfterInactivity ||\n\t\t\t\t(this.end.behavior === EndBehaviorType.AfterSilence &&\n\t\t\t\t\t(buffer.compare(SILENCE_FRAME) !== 0 || this.endTimeout === undefined)))\n\t\t) {\n\t\t\tthis.renewEndTimeout(this.end);\n\t\t}\n\n\t\treturn super.push(buffer);\n\t}\n\n\tprivate renewEndTimeout(end: EndBehavior & { duration: number }) {\n\t\tif (this.endTimeout) {\n\t\t\tclearTimeout(this.endTimeout);\n\t\t}\n\n\t\tthis.endTimeout = setTimeout(() => this.push(null), end.duration);\n\t}\n\n\tpublic override _read() {}\n}\n","/* eslint-disable @typescript-eslint/prefer-ts-expect-error, @typescript-eslint/method-signature-style */\nimport { Buffer } from 'node:buffer';\nimport { EventEmitter } from 'node:events';\nimport { addAudioPlayer, deleteAudioPlayer } from '../DataStore';\nimport { VoiceConnectionStatus, type VoiceConnection } from '../VoiceConnection';\nimport { noop } from '../util/util';\nimport { AudioPlayerError } from './AudioPlayerError';\nimport type { AudioResource } from './AudioResource';\nimport { PlayerSubscription } from './PlayerSubscription';\n\n// The Opus \"silent\" frame\nexport const SILENCE_FRAME = Buffer.from([0xf8, 0xff, 0xfe]);\n\n/**\n * Describes the behavior of the player when an audio packet is played but there are no available\n * voice connections to play to.\n */\nexport enum NoSubscriberBehavior {\n\t/**\n\t * Pauses playing the stream until a voice connection becomes available.\n\t */\n\tPause = 'pause',\n\n\t/**\n\t * Continues to play through the resource regardless.\n\t */\n\tPlay = 'play',\n\n\t/**\n\t * The player stops and enters the Idle state.\n\t */\n\tStop = 'stop',\n}\n\nexport enum AudioPlayerStatus {\n\t/**\n\t * When the player has paused itself. Only possible with the \"pause\" no subscriber behavior.\n\t */\n\tAutoPaused = 'autopaused',\n\n\t/**\n\t * When the player is waiting for an audio resource to become readable before transitioning to Playing.\n\t */\n\tBuffering = 'buffering',\n\n\t/**\n\t * When there is currently no resource for the player to be playing.\n\t */\n\tIdle = 'idle',\n\n\t/**\n\t * When the player has been manually paused.\n\t */\n\tPaused = 'paused',\n\n\t/**\n\t * When the player is actively playing an audio resource.\n\t */\n\tPlaying = 'playing',\n}\n\n/**\n * Options that can be passed when creating an audio player, used to specify its behavior.\n */\nexport interface CreateAudioPlayerOptions {\n\tbehaviors?: {\n\t\tmaxMissedFrames?: number;\n\t\tnoSubscriber?: NoSubscriberBehavior;\n\t};\n\tdebug?: boolean;\n}\n\n/**\n * The state that an AudioPlayer is in when it has no resource to play. This is the starting state.\n */\nexport interface AudioPlayerIdleState {\n\tstatus: AudioPlayerStatus.Idle;\n}\n\n/**\n * The state that an AudioPlayer is in when it is waiting for a resource to become readable. Once this\n * happens, the AudioPlayer will enter the Playing state. If the resource ends/errors before this, then\n * it will re-enter the Idle state.\n */\nexport interface AudioPlayerBufferingState {\n\tonFailureCallback: () => void;\n\tonReadableCallback: () => void;\n\tonStreamError: (error: Error) => void;\n\t/**\n\t * The resource that the AudioPlayer is waiting for\n\t */\n\tresource: AudioResource;\n\tstatus: AudioPlayerStatus.Buffering;\n}\n\n/**\n * The state that an AudioPlayer is in when it is actively playing an AudioResource. When playback ends,\n * it will enter the Idle state.\n */\nexport interface AudioPlayerPlayingState {\n\t/**\n\t * The number of consecutive times that the audio resource has been unable to provide an Opus frame.\n\t */\n\tmissedFrames: number;\n\tonStreamError: (error: Error) => void;\n\n\t/**\n\t * The playback duration in milliseconds of the current audio resource. This includes filler silence packets\n\t * that have been played when the resource was buffering.\n\t */\n\tplaybackDuration: number;\n\n\t/**\n\t * The resource that is being played.\n\t */\n\tresource: AudioResource;\n\n\tstatus: AudioPlayerStatus.Playing;\n}\n\n/**\n * The state that an AudioPlayer is in when it has either been explicitly paused by the user, or done\n * automatically by the AudioPlayer itself if there are no available subscribers.\n */\nexport interface AudioPlayerPausedState {\n\tonStreamError: (error: Error) => void;\n\t/**\n\t * The playback duration in milliseconds of the current audio resource. This includes filler silence packets\n\t * that have been played when the resource was buffering.\n\t */\n\tplaybackDuration: number;\n\n\t/**\n\t * The current resource of the audio player.\n\t */\n\tresource: AudioResource;\n\n\t/**\n\t * How many silence packets still need to be played to avoid audio interpolation due to the stream suddenly pausing.\n\t */\n\tsilencePacketsRemaining: number;\n\n\tstatus: AudioPlayerStatus.AutoPaused | AudioPlayerStatus.Paused;\n}\n\n/**\n * The various states that the player can be in.\n */\nexport type AudioPlayerState =\n\t| AudioPlayerBufferingState\n\t| AudioPlayerIdleState\n\t| AudioPlayerPausedState\n\t| AudioPlayerPlayingState;\n\nexport interface AudioPlayer extends EventEmitter {\n\t/**\n\t * Emitted when there is an error emitted from the audio resource played by the audio player\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'error', listener: (error: AudioPlayerError) => void): this;\n\t/**\n\t * Emitted debugging information about the audio player\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'debug', listener: (message: string) => void): this;\n\t/**\n\t * Emitted when the state of the audio player changes\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'stateChange', listener: (oldState: AudioPlayerState, newState: AudioPlayerState) => void): this;\n\t/**\n\t * Emitted when the audio player is subscribed to a voice connection\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'subscribe' | 'unsubscribe', listener: (subscription: PlayerSubscription) => void): this;\n\t/**\n\t * Emitted when the status of state changes to a specific status\n\t *\n\t * @eventProperty\n\t */\n\ton(\n\t\tevent: Event,\n\t\tlistener: (oldState: AudioPlayerState, newState: AudioPlayerState & { status: Event }) => void,\n\t): this;\n}\n\n/**\n * Stringifies an AudioPlayerState instance.\n *\n * @param state - The state to stringify\n */\nfunction stringifyState(state: AudioPlayerState) {\n\treturn JSON.stringify({\n\t\t...state,\n\t\tresource: Reflect.has(state, 'resource'),\n\t\tstepTimeout: Reflect.has(state, 'stepTimeout'),\n\t});\n}\n\n/**\n * Used to play audio resources (i.e. tracks, streams) to voice connections.\n *\n * @remarks\n * Audio players are designed to be re-used - even if a resource has finished playing, the player itself\n * can still be used.\n *\n * The AudioPlayer drives the timing of playback, and therefore is unaffected by voice connections\n * becoming unavailable. Its behavior in these scenarios can be configured.\n */\nexport class AudioPlayer extends EventEmitter {\n\t/**\n\t * The state that the AudioPlayer is in.\n\t */\n\tprivate _state: AudioPlayerState;\n\n\t/**\n\t * A list of VoiceConnections that are registered to this AudioPlayer. The player will attempt to play audio\n\t * to the streams in this list.\n\t */\n\tprivate readonly subscribers: PlayerSubscription[] = [];\n\n\t/**\n\t * The behavior that the player should follow when it enters certain situations.\n\t */\n\tprivate readonly behaviors: {\n\t\tmaxMissedFrames: number;\n\t\tnoSubscriber: NoSubscriberBehavior;\n\t};\n\n\t/**\n\t * The debug logger function, if debugging is enabled.\n\t */\n\tprivate readonly debug: ((message: string) => void) | null;\n\n\t/**\n\t * Creates a new AudioPlayer.\n\t */\n\tpublic constructor(options: CreateAudioPlayerOptions = {}) {\n\t\tsuper();\n\t\tthis._state = { status: AudioPlayerStatus.Idle };\n\t\tthis.behaviors = {\n\t\t\tnoSubscriber: NoSubscriberBehavior.Pause,\n\t\t\tmaxMissedFrames: 5,\n\t\t\t...options.behaviors,\n\t\t};\n\t\tthis.debug = options.debug === false ? null : (message: string) => this.emit('debug', message);\n\t}\n\n\t/**\n\t * A list of subscribed voice connections that can currently receive audio to play.\n\t */\n\tpublic get playable() {\n\t\treturn this.subscribers\n\t\t\t.filter(({ connection }) => connection.state.status === VoiceConnectionStatus.Ready)\n\t\t\t.map(({ connection }) => connection);\n\t}\n\n\t/**\n\t * Subscribes a VoiceConnection to the audio player's play list. If the VoiceConnection is already subscribed,\n\t * then the existing subscription is used.\n\t *\n\t * @remarks\n\t * This method should not be directly called. Instead, use VoiceConnection#subscribe.\n\t * @param connection - The connection to subscribe\n\t * @returns The new subscription if the voice connection is not yet subscribed, otherwise the existing subscription\n\t */\n\t// @ts-ignore\n\tprivate subscribe(connection: VoiceConnection) {\n\t\tconst existingSubscription = this.subscribers.find((subscription) => subscription.connection === connection);\n\t\tif (!existingSubscription) {\n\t\t\tconst subscription = new PlayerSubscription(connection, this);\n\t\t\tthis.subscribers.push(subscription);\n\t\t\tsetImmediate(() => this.emit('subscribe', subscription));\n\t\t\treturn subscription;\n\t\t}\n\n\t\treturn existingSubscription;\n\t}\n\n\t/**\n\t * Unsubscribes a subscription - i.e. removes a voice connection from the play list of the audio player.\n\t *\n\t * @remarks\n\t * This method should not be directly called. Instead, use PlayerSubscription#unsubscribe.\n\t * @param subscription - The subscription to remove\n\t * @returns Whether or not the subscription existed on the player and was removed\n\t */\n\t// @ts-ignore\n\tprivate unsubscribe(subscription: PlayerSubscription) {\n\t\tconst index = this.subscribers.indexOf(subscription);\n\t\tconst exists = index !== -1;\n\t\tif (exists) {\n\t\t\tthis.subscribers.splice(index, 1);\n\t\t\tsubscription.connection.setSpeaking(false);\n\t\t\tthis.emit('unsubscribe', subscription);\n\t\t}\n\n\t\treturn exists;\n\t}\n\n\t/**\n\t * The state that the player is in.\n\t */\n\tpublic get state() {\n\t\treturn this._state;\n\t}\n\n\t/**\n\t * Sets a new state for the player, performing clean-up operations where necessary.\n\t */\n\tpublic set state(newState: AudioPlayerState) {\n\t\tconst oldState = this._state;\n\t\tconst newResource = Reflect.get(newState, 'resource') as AudioResource | undefined;\n\n\t\tif (oldState.status !== AudioPlayerStatus.Idle && oldState.resource !== newResource) {\n\t\t\toldState.resource.playStream.on('error', noop);\n\t\t\toldState.resource.playStream.off('error', oldState.onStreamError);\n\t\t\toldState.resource.audioPlayer = undefined;\n\t\t\toldState.resource.playStream.destroy();\n\t\t\toldState.resource.playStream.read(); // required to ensure buffered data is drained, prevents memory leak\n\t\t}\n\n\t\t// When leaving the Buffering state (or buffering a new resource), then remove the event listeners from it\n\t\tif (\n\t\t\toldState.status === AudioPlayerStatus.Buffering &&\n\t\t\t(newState.status !== AudioPlayerStatus.Buffering || newState.resource !== oldState.resource)\n\t\t) {\n\t\t\toldState.resource.playStream.off('end', oldState.onFailureCallback);\n\t\t\toldState.resource.playStream.off('close', oldState.onFailureCallback);\n\t\t\toldState.resource.playStream.off('finish', oldState.onFailureCallback);\n\t\t\toldState.resource.playStream.off('readable', oldState.onReadableCallback);\n\t\t}\n\n\t\t// transitioning into an idle should ensure that connections stop speaking\n\t\tif (newState.status === AudioPlayerStatus.Idle) {\n\t\t\tthis._signalStopSpeaking();\n\t\t\tdeleteAudioPlayer(this);\n\t\t}\n\n\t\t// attach to the global audio player timer\n\t\tif (newResource) {\n\t\t\taddAudioPlayer(this);\n\t\t}\n\n\t\t// playing -> playing state changes should still transition if a resource changed (seems like it would be useful!)\n\t\tconst didChangeResources =\n\t\t\toldState.status !== AudioPlayerStatus.Idle &&\n\t\t\tnewState.status === AudioPlayerStatus.Playing &&\n\t\t\toldState.resource !== newState.resource;\n\n\t\tthis._state = newState;\n\n\t\tthis.emit('stateChange', oldState, this._state);\n\t\tif (oldState.status !== newState.status || didChangeResources) {\n\t\t\tthis.emit(newState.status, oldState, this._state as any);\n\t\t}\n\n\t\tthis.debug?.(`state change:\\nfrom ${stringifyState(oldState)}\\nto ${stringifyState(newState)}`);\n\t}\n\n\t/**\n\t * Plays a new resource on the player. If the player is already playing a resource, the existing resource is destroyed\n\t * (it cannot be reused, even in another player) and is replaced with the new resource.\n\t *\n\t * @remarks\n\t * The player will transition to the Playing state once playback begins, and will return to the Idle state once\n\t * playback is ended.\n\t *\n\t * If the player was previously playing a resource and this method is called, the player will not transition to the\n\t * Idle state during the swap over.\n\t * @param resource - The resource to play\n\t * @throws Will throw if attempting to play an audio resource that has already ended, or is being played by another player\n\t */\n\tpublic play(resource: AudioResource) {\n\t\tif (resource.ended) {\n\t\t\tthrow new Error('Cannot play a resource that has already ended.');\n\t\t}\n\n\t\tif (resource.audioPlayer) {\n\t\t\tif (resource.audioPlayer === this) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthrow new Error('Resource is already being played by another audio player.');\n\t\t}\n\n\t\tresource.audioPlayer = this;\n\n\t\t// Attach error listeners to the stream that will propagate the error and then return to the Idle\n\t\t// state if the resource is still being used.\n\t\tconst onStreamError = (error: Error) => {\n\t\t\tif (this.state.status !== AudioPlayerStatus.Idle) {\n\t\t\t\tthis.emit('error', new AudioPlayerError(error, this.state.resource));\n\t\t\t}\n\n\t\t\tif (this.state.status !== AudioPlayerStatus.Idle && this.state.resource === resource) {\n\t\t\t\tthis.state = {\n\t\t\t\t\tstatus: AudioPlayerStatus.Idle,\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\n\t\tresource.playStream.once('error', onStreamError);\n\n\t\tif (resource.started) {\n\t\t\tthis.state = {\n\t\t\t\tstatus: AudioPlayerStatus.Playing,\n\t\t\t\tmissedFrames: 0,\n\t\t\t\tplaybackDuration: 0,\n\t\t\t\tresource,\n\t\t\t\tonStreamError,\n\t\t\t};\n\t\t} else {\n\t\t\tconst onReadableCallback = () => {\n\t\t\t\tif (this.state.status === AudioPlayerStatus.Buffering && this.state.resource === resource) {\n\t\t\t\t\tthis.state = {\n\t\t\t\t\t\tstatus: AudioPlayerStatus.Playing,\n\t\t\t\t\t\tmissedFrames: 0,\n\t\t\t\t\t\tplaybackDuration: 0,\n\t\t\t\t\t\tresource,\n\t\t\t\t\t\tonStreamError,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst onFailureCallback = () => {\n\t\t\t\tif (this.state.status === AudioPlayerStatus.Buffering && this.state.resource === resource) {\n\t\t\t\t\tthis.state = {\n\t\t\t\t\t\tstatus: AudioPlayerStatus.Idle,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tresource.playStream.once('readable', onReadableCallback);\n\n\t\t\tresource.playStream.once('end', onFailureCallback);\n\t\t\tresource.playStream.once('close', onFailureCallback);\n\t\t\tresource.playStream.once('finish', onFailureCallback);\n\n\t\t\tthis.state = {\n\t\t\t\tstatus: AudioPlayerStatus.Buffering,\n\t\t\t\tresource,\n\t\t\t\tonReadableCallback,\n\t\t\t\tonFailureCallback,\n\t\t\t\tonStreamError,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Pauses playback of the current resource, if any.\n\t *\n\t * @param interpolateSilence - If true, the player will play 5 packets of silence after pausing to prevent audio glitches\n\t * @returns `true` if the player was successfully paused, otherwise `false`\n\t */\n\tpublic pause(interpolateSilence = true) {\n\t\tif (this.state.status !== AudioPlayerStatus.Playing) return false;\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\tstatus: AudioPlayerStatus.Paused,\n\t\t\tsilencePacketsRemaining: interpolateSilence ? 5 : 0,\n\t\t};\n\t\treturn true;\n\t}\n\n\t/**\n\t * Unpauses playback of the current resource, if any.\n\t *\n\t * @returns `true` if the player was successfully unpaused, otherwise `false`\n\t */\n\tpublic unpause() {\n\t\tif (this.state.status !== AudioPlayerStatus.Paused) return false;\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\tstatus: AudioPlayerStatus.Playing,\n\t\t\tmissedFrames: 0,\n\t\t};\n\t\treturn true;\n\t}\n\n\t/**\n\t * Stops playback of the current resource and destroys the resource. The player will either transition to the Idle state,\n\t * or remain in its current state until the silence padding frames of the resource have been played.\n\t *\n\t * @param force - If true, will force the player to enter the Idle state even if the resource has silence padding frames\n\t * @returns `true` if the player will come to a stop, otherwise `false`\n\t */\n\tpublic stop(force = false) {\n\t\tif (this.state.status === AudioPlayerStatus.Idle) return false;\n\t\tif (force || this.state.resource.silencePaddingFrames === 0) {\n\t\t\tthis.state = {\n\t\t\t\tstatus: AudioPlayerStatus.Idle,\n\t\t\t};\n\t\t} else if (this.state.resource.silenceRemaining === -1) {\n\t\t\tthis.state.resource.silenceRemaining = this.state.resource.silencePaddingFrames;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks whether the underlying resource (if any) is playable (readable)\n\t *\n\t * @returns `true` if the resource is playable, otherwise `false`\n\t */\n\tpublic checkPlayable() {\n\t\tconst state = this._state;\n\t\tif (state.status === AudioPlayerStatus.Idle || state.status === AudioPlayerStatus.Buffering) return false;\n\n\t\t// If the stream has been destroyed or is no longer readable, then transition to the Idle state.\n\t\tif (!state.resource.readable) {\n\t\t\tthis.state = {\n\t\t\t\tstatus: AudioPlayerStatus.Idle,\n\t\t\t};\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Called roughly every 20ms by the global audio player timer. Dispatches any audio packets that are buffered\n\t * by the active connections of this audio player.\n\t */\n\t// @ts-ignore\n\tprivate _stepDispatch() {\n\t\tconst state = this._state;\n\n\t\t// Guard against the Idle state\n\t\tif (state.status === AudioPlayerStatus.Idle || state.status === AudioPlayerStatus.Buffering) return;\n\n\t\t// Dispatch any audio packets that were prepared in the previous cycle\n\t\tfor (const connection of this.playable) {\n\t\t\tconnection.dispatchAudio();\n\t\t}\n\t}\n\n\t/**\n\t * Called roughly every 20ms by the global audio player timer. Attempts to read an audio packet from the\n\t * underlying resource of the stream, and then has all the active connections of the audio player prepare it\n\t * (encrypt it, append header data) so that it is ready to play at the start of the next cycle.\n\t */\n\t// @ts-ignore\n\tprivate _stepPrepare() {\n\t\tconst state = this._state;\n\n\t\t// Guard against the Idle state\n\t\tif (state.status === AudioPlayerStatus.Idle || state.status === AudioPlayerStatus.Buffering) return;\n\n\t\t// List of connections that can receive the packet\n\t\tconst playable = this.playable;\n\n\t\t/* If the player was previously in the AutoPaused state, check to see whether there are newly available\n\t\t connections, allowing us to transition out of the AutoPaused state back into the Playing state */\n\t\tif (state.status === AudioPlayerStatus.AutoPaused && playable.length > 0) {\n\t\t\tthis.state = {\n\t\t\t\t...state,\n\t\t\t\tstatus: AudioPlayerStatus.Playing,\n\t\t\t\tmissedFrames: 0,\n\t\t\t};\n\t\t}\n\n\t\t/* If the player is (auto)paused, check to see whether silence packets should be played and\n\t\t set a timeout to begin the next cycle, ending the current cycle here. */\n\t\tif (state.status === AudioPlayerStatus.Paused || state.status === AudioPlayerStatus.AutoPaused) {\n\t\t\tif (state.silencePacketsRemaining > 0) {\n\t\t\t\tstate.silencePacketsRemaining--;\n\t\t\t\tthis._preparePacket(SILENCE_FRAME, playable, state);\n\t\t\t\tif (state.silencePacketsRemaining === 0) {\n\t\t\t\t\tthis._signalStopSpeaking();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are no available connections in this cycle, observe the configured \"no subscriber\" behavior.\n\t\tif (playable.length === 0) {\n\t\t\tif (this.behaviors.noSubscriber === NoSubscriberBehavior.Pause) {\n\t\t\t\tthis.state = {\n\t\t\t\t\t...state,\n\t\t\t\t\tstatus: AudioPlayerStatus.AutoPaused,\n\t\t\t\t\tsilencePacketsRemaining: 5,\n\t\t\t\t};\n\t\t\t\treturn;\n\t\t\t} else if (this.behaviors.noSubscriber === NoSubscriberBehavior.Stop) {\n\t\t\t\tthis.stop(true);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Attempt to read an Opus packet from the resource. If there isn't an available packet,\n\t\t * play a silence packet. If there are 5 consecutive cycles with failed reads, then the\n\t\t * playback will end.\n\t\t */\n\t\tconst packet: Buffer | null = state.resource.read();\n\n\t\tif (state.status === AudioPlayerStatus.Playing) {\n\t\t\tif (packet) {\n\t\t\t\tthis._preparePacket(packet, playable, state);\n\t\t\t\tstate.missedFrames = 0;\n\t\t\t} else {\n\t\t\t\tthis._preparePacket(SILENCE_FRAME, playable, state);\n\t\t\t\tstate.missedFrames++;\n\t\t\t\tif (state.missedFrames >= this.behaviors.maxMissedFrames) {\n\t\t\t\t\tthis.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Signals to all the subscribed connections that they should send a packet to Discord indicating\n\t * they are no longer speaking. Called once playback of a resource ends.\n\t */\n\tprivate _signalStopSpeaking() {\n\t\tfor (const { connection } of this.subscribers) {\n\t\t\tconnection.setSpeaking(false);\n\t\t}\n\t}\n\n\t/**\n\t * Instructs the given connections to each prepare this packet to be played at the start of the\n\t * next cycle.\n\t *\n\t * @param packet - The Opus packet to be prepared by each receiver\n\t * @param receivers - The connections that should play this packet\n\t */\n\tprivate _preparePacket(\n\t\tpacket: Buffer,\n\t\treceivers: VoiceConnection[],\n\t\tstate: AudioPlayerPausedState | AudioPlayerPlayingState,\n\t) {\n\t\tstate.playbackDuration += 20;\n\t\tfor (const connection of receivers) {\n\t\t\tconnection.prepareAudioPacket(packet);\n\t\t}\n\t}\n}\n\n/**\n * Creates a new AudioPlayer to be used.\n */\nexport function createAudioPlayer(options?: CreateAudioPlayerOptions) {\n\treturn new AudioPlayer(options);\n}\n","import type { AudioResource } from './AudioResource';\n\n/**\n * An error emitted by an AudioPlayer. Contains an attached resource to aid with\n * debugging and identifying where the error came from.\n */\nexport class AudioPlayerError extends Error {\n\t/**\n\t * The resource associated with the audio player at the time the error was thrown.\n\t */\n\tpublic readonly resource: AudioResource;\n\n\tpublic constructor(error: Error, resource: AudioResource) {\n\t\tsuper(error.message);\n\t\tthis.resource = resource;\n\t\tthis.name = error.name;\n\t\tthis.stack = error.stack!;\n\t}\n}\n","/* eslint-disable @typescript-eslint/dot-notation */\nimport type { VoiceConnection } from '../VoiceConnection';\nimport type { AudioPlayer } from './AudioPlayer';\n\n/**\n * Represents a subscription of a voice connection to an audio player, allowing\n * the audio player to play audio on the voice connection.\n */\nexport class PlayerSubscription {\n\t/**\n\t * The voice connection of this subscription.\n\t */\n\tpublic readonly connection: VoiceConnection;\n\n\t/**\n\t * The audio player of this subscription.\n\t */\n\tpublic readonly player: AudioPlayer;\n\n\tpublic constructor(connection: VoiceConnection, player: AudioPlayer) {\n\t\tthis.connection = connection;\n\t\tthis.player = player;\n\t}\n\n\t/**\n\t * Unsubscribes the connection from the audio player, meaning that the\n\t * audio player cannot stream audio to it until a new subscription is made.\n\t */\n\tpublic unsubscribe() {\n\t\tthis.connection['onSubscriptionRemoved'](this);\n\t\tthis.player['unsubscribe'](this);\n\t}\n}\n","import { EventEmitter } from 'node:events';\n\n/**\n * The known data for a user in a Discord voice connection.\n */\nexport interface VoiceUserData {\n\t/**\n\t * The SSRC of the user's audio stream.\n\t */\n\taudioSSRC: number;\n\n\t/**\n\t * The Discord user id of the user.\n\t */\n\tuserId: string;\n\n\t/**\n\t * The SSRC of the user's video stream (if one exists)\n\t * Cannot be 0. If undefined, the user has no video stream.\n\t */\n\tvideoSSRC?: number;\n}\n\nexport interface SSRCMap extends EventEmitter {\n\ton(event: 'create', listener: (newData: VoiceUserData) => void): this;\n\ton(event: 'update', listener: (oldData: VoiceUserData | undefined, newData: VoiceUserData) => void): this;\n\ton(event: 'delete', listener: (deletedData: VoiceUserData) => void): this;\n}\n\n/**\n * Maps audio SSRCs to data of users in voice connections.\n */\nexport class SSRCMap extends EventEmitter {\n\t/**\n\t * The underlying map.\n\t */\n\tprivate readonly map: Map;\n\n\tpublic constructor() {\n\t\tsuper();\n\t\tthis.map = new Map();\n\t}\n\n\t/**\n\t * Updates the map with new user data\n\t *\n\t * @param data - The data to update with\n\t */\n\tpublic update(data: VoiceUserData) {\n\t\tconst existing = this.map.get(data.audioSSRC);\n\n\t\tconst newValue = {\n\t\t\t...this.map.get(data.audioSSRC),\n\t\t\t...data,\n\t\t};\n\n\t\tthis.map.set(data.audioSSRC, newValue);\n\t\tif (!existing) this.emit('create', newValue);\n\t\tthis.emit('update', existing, newValue);\n\t}\n\n\t/**\n\t * Gets the stored voice data of a user.\n\t *\n\t * @param target - The target, either their user id or audio SSRC\n\t */\n\tpublic get(target: number | string) {\n\t\tif (typeof target === 'number') {\n\t\t\treturn this.map.get(target);\n\t\t}\n\n\t\tfor (const data of this.map.values()) {\n\t\t\tif (data.userId === target) {\n\t\t\t\treturn data;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Deletes the stored voice data about a user.\n\t *\n\t * @param target - The target of the delete operation, either their audio SSRC or user id\n\t * @returns The data that was deleted, if any\n\t */\n\tpublic delete(target: number | string) {\n\t\tif (typeof target === 'number') {\n\t\t\tconst existing = this.map.get(target);\n\t\t\tif (existing) {\n\t\t\t\tthis.map.delete(target);\n\t\t\t\tthis.emit('delete', existing);\n\t\t\t}\n\n\t\t\treturn existing;\n\t\t}\n\n\t\tfor (const [audioSSRC, data] of this.map.entries()) {\n\t\t\tif (data.userId === target) {\n\t\t\t\tthis.map.delete(audioSSRC);\n\t\t\t\tthis.emit('delete', data);\n\t\t\t\treturn data;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n","/* eslint-disable @typescript-eslint/unified-signatures */\nimport { EventEmitter } from 'node:events';\n\nexport interface SpeakingMap extends EventEmitter {\n\t/**\n\t * Emitted when a user starts speaking.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'start', listener: (userId: string) => void): this;\n\n\t/**\n\t * Emitted when a user ends speaking.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'end', listener: (userId: string) => void): this;\n}\n\n/**\n * Tracks the speaking states of users in a voice channel.\n */\nexport class SpeakingMap extends EventEmitter {\n\t/**\n\t * The delay after a packet is received from a user until they're marked as not speaking anymore.\n\t */\n\tpublic static readonly DELAY = 100;\n\n\t/**\n\t * The currently speaking users, mapped to the milliseconds since UNIX epoch at which they started speaking.\n\t */\n\tpublic readonly users: Map;\n\n\tprivate readonly speakingTimeouts: Map;\n\n\tpublic constructor() {\n\t\tsuper();\n\t\tthis.users = new Map();\n\t\tthis.speakingTimeouts = new Map();\n\t}\n\n\tpublic onPacket(userId: string) {\n\t\tconst timeout = this.speakingTimeouts.get(userId);\n\t\tif (timeout) {\n\t\t\tclearTimeout(timeout);\n\t\t} else {\n\t\t\tthis.users.set(userId, Date.now());\n\t\t\tthis.emit('start', userId);\n\t\t}\n\n\t\tthis.startTimeout(userId);\n\t}\n\n\tprivate startTimeout(userId: string) {\n\t\tthis.speakingTimeouts.set(\n\t\t\tuserId,\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.emit('end', userId);\n\t\t\t\tthis.speakingTimeouts.delete(userId);\n\t\t\t\tthis.users.delete(userId);\n\t\t\t}, SpeakingMap.DELAY),\n\t\t);\n\t}\n}\n","import type { JoinConfig } from './DataStore';\nimport { createVoiceConnection } from './VoiceConnection';\nimport type { DiscordGatewayAdapterCreator } from './util/adapter';\n\n/**\n * The options that can be given when creating a voice connection.\n */\nexport interface CreateVoiceConnectionOptions {\n\tadapterCreator: DiscordGatewayAdapterCreator;\n\n\t/**\n\t * If true, debug messages will be enabled for the voice connection and its\n\t * related components. Defaults to false.\n\t */\n\tdebug?: boolean | undefined;\n}\n\n/**\n * The options that can be given when joining a voice channel.\n */\nexport interface JoinVoiceChannelOptions {\n\t/**\n\t * The id of the Discord voice channel to join.\n\t */\n\tchannelId: string;\n\n\t/**\n\t * An optional group identifier for the voice connection.\n\t */\n\tgroup?: string;\n\n\t/**\n\t * The id of the guild that the voice channel belongs to.\n\t */\n\tguildId: string;\n\n\t/**\n\t * Whether to join the channel deafened (defaults to true)\n\t */\n\tselfDeaf?: boolean;\n\n\t/**\n\t * Whether to join the channel muted (defaults to true)\n\t */\n\tselfMute?: boolean;\n}\n\n/**\n * Creates a VoiceConnection to a Discord voice channel.\n *\n * @param options - the options for joining the voice channel\n */\nexport function joinVoiceChannel(options: CreateVoiceConnectionOptions & JoinVoiceChannelOptions) {\n\tconst joinConfig: JoinConfig = {\n\t\tselfDeaf: true,\n\t\tselfMute: false,\n\t\tgroup: 'default',\n\t\t...options,\n\t};\n\n\treturn createVoiceConnection(joinConfig, {\n\t\tadapterCreator: options.adapterCreator,\n\t\tdebug: options.debug,\n\t});\n}\n","import type { Buffer } from 'node:buffer';\nimport { pipeline, type Readable } from 'node:stream';\nimport prism from 'prism-media';\nimport { noop } from '../util/util';\nimport { SILENCE_FRAME, type AudioPlayer } from './AudioPlayer';\nimport { findPipeline, StreamType, TransformerType, type Edge } from './TransformerGraph';\n\n/**\n * Options that are set when creating a new audio resource.\n *\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport interface CreateAudioResourceOptions {\n\t/**\n\t * Whether or not inline volume should be enabled. If enabled, you will be able to change the volume\n\t * of the stream on-the-fly. However, this also increases the performance cost of playback. Defaults to `false`.\n\t */\n\tinlineVolume?: boolean;\n\n\t/**\n\t * The type of the input stream. Defaults to `StreamType.Arbitrary`.\n\t */\n\tinputType?: StreamType;\n\n\t/**\n\t * Optional metadata that can be attached to the resource (e.g. track title, random id).\n\t * This is useful for identification purposes when the resource is passed around in events.\n\t * See {@link AudioResource.metadata}\n\t */\n\tmetadata?: Metadata;\n\n\t/**\n\t * The number of silence frames to append to the end of the resource's audio stream, to prevent interpolation glitches.\n\t * Defaults to 5.\n\t */\n\tsilencePaddingFrames?: number;\n}\n\n/**\n * Represents an audio resource that can be played by an audio player.\n *\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport class AudioResource {\n\t/**\n\t * An object-mode Readable stream that emits Opus packets. This is what is played by audio players.\n\t */\n\tpublic readonly playStream: Readable;\n\n\t/**\n\t * The pipeline used to convert the input stream into a playable format. For example, this may\n\t * contain an FFmpeg component for arbitrary inputs, and it may contain a VolumeTransformer component\n\t * for resources with inline volume transformation enabled.\n\t */\n\tpublic readonly edges: readonly Edge[];\n\n\t/**\n\t * Optional metadata that can be used to identify the resource.\n\t */\n\tpublic metadata: Metadata;\n\n\t/**\n\t * If the resource was created with inline volume transformation enabled, then this will be a\n\t * prism-media VolumeTransformer. You can use this to alter the volume of the stream.\n\t */\n\tpublic readonly volume?: prism.VolumeTransformer;\n\n\t/**\n\t * If using an Opus encoder to create this audio resource, then this will be a prism-media opus.Encoder.\n\t * You can use this to control settings such as bitrate, FEC, PLP.\n\t */\n\tpublic readonly encoder?: prism.opus.Encoder;\n\n\t/**\n\t * The audio player that the resource is subscribed to, if any.\n\t */\n\tpublic audioPlayer?: AudioPlayer | undefined;\n\n\t/**\n\t * The playback duration of this audio resource, given in milliseconds.\n\t */\n\tpublic playbackDuration = 0;\n\n\t/**\n\t * Whether or not the stream for this resource has started (data has become readable)\n\t */\n\tpublic started = false;\n\n\t/**\n\t * The number of silence frames to append to the end of the resource's audio stream, to prevent interpolation glitches.\n\t */\n\tpublic readonly silencePaddingFrames: number;\n\n\t/**\n\t * The number of remaining silence frames to play. If -1, the frames have not yet started playing.\n\t */\n\tpublic silenceRemaining = -1;\n\n\tpublic constructor(\n\t\tedges: readonly Edge[],\n\t\tstreams: readonly Readable[],\n\t\tmetadata: Metadata,\n\t\tsilencePaddingFrames: number,\n\t) {\n\t\tthis.edges = edges;\n\t\tthis.playStream = streams.length > 1 ? (pipeline(streams, noop) as any as Readable) : streams[0]!;\n\t\tthis.metadata = metadata;\n\t\tthis.silencePaddingFrames = silencePaddingFrames;\n\n\t\tfor (const stream of streams) {\n\t\t\tif (stream instanceof prism.VolumeTransformer) {\n\t\t\t\tthis.volume = stream;\n\t\t\t} else if (stream instanceof prism.opus.Encoder) {\n\t\t\t\tthis.encoder = stream;\n\t\t\t}\n\t\t}\n\n\t\tthis.playStream.once('readable', () => (this.started = true));\n\t}\n\n\t/**\n\t * Whether this resource is readable. If the underlying resource is no longer readable, this will still return true\n\t * while there are silence padding frames left to play.\n\t */\n\tpublic get readable() {\n\t\tif (this.silenceRemaining === 0) return false;\n\t\tconst real = this.playStream.readable;\n\t\tif (!real) {\n\t\t\tif (this.silenceRemaining === -1) this.silenceRemaining = this.silencePaddingFrames;\n\t\t\treturn this.silenceRemaining !== 0;\n\t\t}\n\n\t\treturn real;\n\t}\n\n\t/**\n\t * Whether this resource has ended or not.\n\t */\n\tpublic get ended() {\n\t\treturn this.playStream.readableEnded || this.playStream.destroyed || this.silenceRemaining === 0;\n\t}\n\n\t/**\n\t * Attempts to read an Opus packet from the audio resource. If a packet is available, the playbackDuration\n\t * is incremented.\n\t *\n\t * @remarks\n\t * It is advisable to check that the playStream is readable before calling this method. While no runtime\n\t * errors will be thrown, you should check that the resource is still available before attempting to\n\t * read from it.\n\t * @internal\n\t */\n\tpublic read(): Buffer | null {\n\t\tif (this.silenceRemaining === 0) {\n\t\t\treturn null;\n\t\t} else if (this.silenceRemaining > 0) {\n\t\t\tthis.silenceRemaining--;\n\t\t\treturn SILENCE_FRAME;\n\t\t}\n\n\t\tconst packet = this.playStream.read() as Buffer | null;\n\t\tif (packet) {\n\t\t\tthis.playbackDuration += 20;\n\t\t}\n\n\t\treturn packet;\n\t}\n}\n\n/**\n * Ensures that a path contains at least one volume transforming component.\n *\n * @param path - The path to validate constraints on\n */\nexport const VOLUME_CONSTRAINT = (path: Edge[]) => path.some((edge) => edge.type === TransformerType.InlineVolume);\n\nexport const NO_CONSTRAINT = () => true;\n\n/**\n * Tries to infer the type of a stream to aid with transcoder pipelining.\n *\n * @param stream - The stream to infer the type of\n */\nexport function inferStreamType(stream: Readable): {\n\thasVolume: boolean;\n\tstreamType: StreamType;\n} {\n\tif (stream instanceof prism.opus.Encoder) {\n\t\treturn { streamType: StreamType.Opus, hasVolume: false };\n\t} else if (stream instanceof prism.opus.Decoder) {\n\t\treturn { streamType: StreamType.Raw, hasVolume: false };\n\t} else if (stream instanceof prism.VolumeTransformer) {\n\t\treturn { streamType: StreamType.Raw, hasVolume: true };\n\t} else if (stream instanceof prism.opus.OggDemuxer) {\n\t\treturn { streamType: StreamType.Opus, hasVolume: false };\n\t} else if (stream instanceof prism.opus.WebmDemuxer) {\n\t\treturn { streamType: StreamType.Opus, hasVolume: false };\n\t}\n\n\treturn { streamType: StreamType.Arbitrary, hasVolume: false };\n}\n\n/**\n * Creates an audio resource that can be played by audio players.\n *\n * @remarks\n * If the input is given as a string, then the inputType option will be overridden and FFmpeg will be used.\n *\n * If the input is not in the correct format, then a pipeline of transcoders and transformers will be created\n * to ensure that the resultant stream is in the correct format for playback. This could involve using FFmpeg,\n * Opus transcoders, and Ogg/WebM demuxers.\n * @param input - The resource to play\n * @param options - Configurable options for creating the resource\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport function createAudioResource(\n\tinput: Readable | string,\n\toptions: CreateAudioResourceOptions &\n\t\tPick<\n\t\t\tMetadata extends null | undefined\n\t\t\t\t? CreateAudioResourceOptions\n\t\t\t\t: Required>,\n\t\t\t'metadata'\n\t\t>,\n): AudioResource;\n\n/**\n * Creates an audio resource that can be played by audio players.\n *\n * @remarks\n * If the input is given as a string, then the inputType option will be overridden and FFmpeg will be used.\n *\n * If the input is not in the correct format, then a pipeline of transcoders and transformers will be created\n * to ensure that the resultant stream is in the correct format for playback. This could involve using FFmpeg,\n * Opus transcoders, and Ogg/WebM demuxers.\n * @param input - The resource to play\n * @param options - Configurable options for creating the resource\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport function createAudioResource(\n\tinput: Readable | string,\n\toptions?: Omit, 'metadata'>,\n): AudioResource;\n\n/**\n * Creates an audio resource that can be played by audio players.\n *\n * @remarks\n * If the input is given as a string, then the inputType option will be overridden and FFmpeg will be used.\n *\n * If the input is not in the correct format, then a pipeline of transcoders and transformers will be created\n * to ensure that the resultant stream is in the correct format for playback. This could involve using FFmpeg,\n * Opus transcoders, and Ogg/WebM demuxers.\n * @param input - The resource to play\n * @param options - Configurable options for creating the resource\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport function createAudioResource(\n\tinput: Readable | string,\n\toptions: CreateAudioResourceOptions = {},\n): AudioResource {\n\tlet inputType = options.inputType;\n\tlet needsInlineVolume = Boolean(options.inlineVolume);\n\n\t// string inputs can only be used with FFmpeg\n\tif (typeof input === 'string') {\n\t\tinputType = StreamType.Arbitrary;\n\t} else if (inputType === undefined) {\n\t\tconst analysis = inferStreamType(input);\n\t\tinputType = analysis.streamType;\n\t\tneedsInlineVolume = needsInlineVolume && !analysis.hasVolume;\n\t}\n\n\tconst transformerPipeline = findPipeline(inputType, needsInlineVolume ? VOLUME_CONSTRAINT : NO_CONSTRAINT);\n\n\tif (transformerPipeline.length === 0) {\n\t\tif (typeof input === 'string') throw new Error(`Invalid pipeline constructed for string resource '${input}'`);\n\t\t// No adjustments required\n\t\treturn new AudioResource(\n\t\t\t[],\n\t\t\t[input],\n\t\t\t(options.metadata ?? null) as Metadata,\n\t\t\toptions.silencePaddingFrames ?? 5,\n\t\t);\n\t}\n\n\tconst streams = transformerPipeline.map((edge) => edge.transformer(input));\n\tif (typeof input !== 'string') streams.unshift(input);\n\n\treturn new AudioResource(\n\t\ttransformerPipeline,\n\t\tstreams,\n\t\t(options.metadata ?? null) as Metadata,\n\t\toptions.silencePaddingFrames ?? 5,\n\t);\n}\n","import type { Readable } from 'node:stream';\nimport prism from 'prism-media';\n\n/**\n * This module creates a Transformer Graph to figure out what the most efficient way\n * of transforming the input stream into something playable would be.\n */\n\nconst FFMPEG_PCM_ARGUMENTS = ['-analyzeduration', '0', '-loglevel', '0', '-f', 's16le', '-ar', '48000', '-ac', '2'];\nconst FFMPEG_OPUS_ARGUMENTS = [\n\t'-analyzeduration',\n\t'0',\n\t'-loglevel',\n\t'0',\n\t'-acodec',\n\t'libopus',\n\t'-f',\n\t'opus',\n\t'-ar',\n\t'48000',\n\t'-ac',\n\t'2',\n];\n\n/**\n * The different types of stream that can exist within the pipeline.\n */\nexport enum StreamType {\n\t/**\n\t * The type of the stream at this point is unknown.\n\t */\n\tArbitrary = 'arbitrary',\n\t/**\n\t * The stream at this point is Opus audio encoded in an Ogg wrapper.\n\t */\n\tOggOpus = 'ogg/opus',\n\t/**\n\t * The stream at this point is Opus audio, and the stream is in object-mode. This is ready to play.\n\t */\n\tOpus = 'opus',\n\t/**\n\t * The stream at this point is s16le PCM.\n\t */\n\tRaw = 'raw',\n\t/**\n\t * The stream at this point is Opus audio encoded in a WebM wrapper.\n\t */\n\tWebmOpus = 'webm/opus',\n}\n\n/**\n * The different types of transformers that can exist within the pipeline.\n */\nexport enum TransformerType {\n\tFFmpegOgg = 'ffmpeg ogg',\n\tFFmpegPCM = 'ffmpeg pcm',\n\tInlineVolume = 'volume transformer',\n\tOggOpusDemuxer = 'ogg/opus demuxer',\n\tOpusDecoder = 'opus decoder',\n\tOpusEncoder = 'opus encoder',\n\tWebmOpusDemuxer = 'webm/opus demuxer',\n}\n\n/**\n * Represents a pathway from one stream type to another using a transformer.\n */\nexport interface Edge {\n\tcost: number;\n\tfrom: Node;\n\tto: Node;\n\ttransformer(input: Readable | string): Readable;\n\ttype: TransformerType;\n}\n\n/**\n * Represents a type of stream within the graph, e.g. an Opus stream, or a stream of raw audio.\n */\nexport class Node {\n\t/**\n\t * The outbound edges from this node.\n\t */\n\tpublic readonly edges: Edge[] = [];\n\n\t/**\n\t * The type of stream for this node.\n\t */\n\tpublic readonly type: StreamType;\n\n\tpublic constructor(type: StreamType) {\n\t\tthis.type = type;\n\t}\n\n\t/**\n\t * Creates an outbound edge from this node.\n\t *\n\t * @param edge - The edge to create\n\t */\n\tpublic addEdge(edge: Omit) {\n\t\tthis.edges.push({ ...edge, from: this });\n\t}\n}\n\n// Create a node for each stream type\nlet NODES: Map | null = null;\n\n/**\n * Gets a node from its stream type.\n *\n * @param type - The stream type of the target node\n */\nexport function getNode(type: StreamType) {\n\tconst node = (NODES ??= initializeNodes()).get(type);\n\tif (!node) throw new Error(`Node type '${type}' does not exist!`);\n\treturn node;\n}\n\n// Try to enable FFmpeg Ogg optimizations\nfunction canEnableFFmpegOptimizations(): boolean {\n\ttry {\n\t\treturn prism.FFmpeg.getInfo().output.includes('--enable-libopus');\n\t} catch {}\n\n\treturn false;\n}\n\nfunction initializeNodes(): Map {\n\tconst nodes = new Map();\n\tfor (const streamType of Object.values(StreamType)) {\n\t\tnodes.set(streamType, new Node(streamType));\n\t}\n\n\tnodes.get(StreamType.Raw)!.addEdge({\n\t\ttype: TransformerType.OpusEncoder,\n\t\tto: nodes.get(StreamType.Opus)!,\n\t\tcost: 1.5,\n\t\ttransformer: () => new prism.opus.Encoder({ rate: 48_000, channels: 2, frameSize: 960 }),\n\t});\n\n\tnodes.get(StreamType.Opus)!.addEdge({\n\t\ttype: TransformerType.OpusDecoder,\n\t\tto: nodes.get(StreamType.Raw)!,\n\t\tcost: 1.5,\n\t\ttransformer: () => new prism.opus.Decoder({ rate: 48_000, channels: 2, frameSize: 960 }),\n\t});\n\n\tnodes.get(StreamType.OggOpus)!.addEdge({\n\t\ttype: TransformerType.OggOpusDemuxer,\n\t\tto: nodes.get(StreamType.Opus)!,\n\t\tcost: 1,\n\t\ttransformer: () => new prism.opus.OggDemuxer(),\n\t});\n\n\tnodes.get(StreamType.WebmOpus)!.addEdge({\n\t\ttype: TransformerType.WebmOpusDemuxer,\n\t\tto: nodes.get(StreamType.Opus)!,\n\t\tcost: 1,\n\t\ttransformer: () => new prism.opus.WebmDemuxer(),\n\t});\n\n\tconst FFMPEG_PCM_EDGE: Omit = {\n\t\ttype: TransformerType.FFmpegPCM,\n\t\tto: nodes.get(StreamType.Raw)!,\n\t\tcost: 2,\n\t\ttransformer: (input) =>\n\t\t\tnew prism.FFmpeg({\n\t\t\t\targs: ['-i', typeof input === 'string' ? input : '-', ...FFMPEG_PCM_ARGUMENTS],\n\t\t\t}),\n\t};\n\n\tnodes.get(StreamType.Arbitrary)!.addEdge(FFMPEG_PCM_EDGE);\n\tnodes.get(StreamType.OggOpus)!.addEdge(FFMPEG_PCM_EDGE);\n\tnodes.get(StreamType.WebmOpus)!.addEdge(FFMPEG_PCM_EDGE);\n\n\tnodes.get(StreamType.Raw)!.addEdge({\n\t\ttype: TransformerType.InlineVolume,\n\t\tto: nodes.get(StreamType.Raw)!,\n\t\tcost: 0.5,\n\t\ttransformer: () => new prism.VolumeTransformer({ type: 's16le' }),\n\t});\n\n\tif (canEnableFFmpegOptimizations()) {\n\t\tconst FFMPEG_OGG_EDGE: Omit = {\n\t\t\ttype: TransformerType.FFmpegOgg,\n\t\t\tto: nodes.get(StreamType.OggOpus)!,\n\t\t\tcost: 2,\n\t\t\ttransformer: (input) =>\n\t\t\t\tnew prism.FFmpeg({\n\t\t\t\t\targs: ['-i', typeof input === 'string' ? input : '-', ...FFMPEG_OPUS_ARGUMENTS],\n\t\t\t\t}),\n\t\t};\n\t\tnodes.get(StreamType.Arbitrary)!.addEdge(FFMPEG_OGG_EDGE);\n\t\t// Include Ogg and WebM as well in case they have different sampling rates or are mono instead of stereo\n\t\t// at the moment, this will not do anything. However, if/when detection for correct Opus headers is\n\t\t// implemented, this will help inform the voice engine that it is able to transcode the audio.\n\t\tnodes.get(StreamType.OggOpus)!.addEdge(FFMPEG_OGG_EDGE);\n\t\tnodes.get(StreamType.WebmOpus)!.addEdge(FFMPEG_OGG_EDGE);\n\t}\n\n\treturn nodes;\n}\n\n/**\n * Represents a step in the path from node A to node B.\n */\ninterface Step {\n\t/**\n\t * The cost of the steps after this step.\n\t */\n\tcost: number;\n\n\t/**\n\t * The edge associated with this step.\n\t */\n\tedge?: Edge;\n\n\t/**\n\t * The next step.\n\t */\n\tnext?: Step;\n}\n\n/**\n * Finds the shortest cost path from node A to node B.\n *\n * @param from - The start node\n * @param constraints - Extra validation for a potential solution. Takes a path, returns true if the path is valid\n * @param goal - The target node\n * @param path - The running path\n * @param depth - The number of remaining recursions\n */\nfunction findPath(\n\tfrom: Node,\n\tconstraints: (path: Edge[]) => boolean,\n\tgoal = getNode(StreamType.Opus),\n\tpath: Edge[] = [],\n\tdepth = 5,\n): Step {\n\tif (from === goal && constraints(path)) {\n\t\treturn { cost: 0 };\n\t} else if (depth === 0) {\n\t\treturn { cost: Number.POSITIVE_INFINITY };\n\t}\n\n\tlet currentBest: Step | undefined;\n\tfor (const edge of from.edges) {\n\t\tif (currentBest && edge.cost > currentBest.cost) continue;\n\t\tconst next = findPath(edge.to, constraints, goal, [...path, edge], depth - 1);\n\t\tconst cost = edge.cost + next.cost;\n\t\tif (!currentBest || cost < currentBest.cost) {\n\t\t\tcurrentBest = { cost, edge, next };\n\t\t}\n\t}\n\n\treturn currentBest ?? { cost: Number.POSITIVE_INFINITY };\n}\n\n/**\n * Takes the solution from findPath and assembles it into a list of edges.\n *\n * @param step - The first step of the path\n */\nfunction constructPipeline(step: Step) {\n\tconst edges = [];\n\tlet current: Step | undefined = step;\n\twhile (current?.edge) {\n\t\tedges.push(current.edge);\n\t\tcurrent = current.next;\n\t}\n\n\treturn edges;\n}\n\n/**\n * Finds the lowest-cost pipeline to convert the input stream type into an Opus stream.\n *\n * @param from - The stream type to start from\n * @param constraint - Extra constraints that may be imposed on potential solution\n */\nexport function findPipeline(from: StreamType, constraint: (path: Edge[]) => boolean) {\n\treturn constructPipeline(findPath(getNode(from), constraint));\n}\n","/* eslint-disable @typescript-eslint/no-var-requires */\n/* eslint-disable @typescript-eslint/no-require-imports */\nimport { resolve, dirname } from 'node:path';\nimport prism from 'prism-media';\n\n/**\n * Tries to find the package.json file for a given module.\n *\n * @param dir - The directory to look in\n * @param packageName - The name of the package to look for\n * @param depth - The maximum recursion depth\n */\nfunction findPackageJSON(\n\tdir: string,\n\tpackageName: string,\n\tdepth: number,\n): { name: string; version: string } | undefined {\n\tif (depth === 0) return undefined;\n\tconst attemptedPath = resolve(dir, './package.json');\n\ttry {\n\t\tconst pkg = require(attemptedPath);\n\t\tif (pkg.name !== packageName) throw new Error('package.json does not match');\n\t\treturn pkg;\n\t} catch {\n\t\treturn findPackageJSON(resolve(dir, '..'), packageName, depth - 1);\n\t}\n}\n\n/**\n * Tries to find the version of a dependency.\n *\n * @param name - The package to find the version of\n */\nfunction version(name: string): string {\n\ttry {\n\t\tif (name === '@discordjs/voice') {\n\t\t\treturn '0.17.0';\n\t\t}\n\n\t\tconst pkg = findPackageJSON(dirname(require.resolve(name)), name, 3);\n\t\treturn pkg?.version ?? 'not found';\n\t} catch {\n\t\treturn 'not found';\n\t}\n}\n\n/**\n * Generates a report of the dependencies used by the \\@discordjs/voice module.\n * Useful for debugging.\n */\nexport function generateDependencyReport() {\n\tconst report = [];\n\tconst addVersion = (name: string) => report.push(`- ${name}: ${version(name)}`);\n\t// general\n\treport.push('Core Dependencies');\n\taddVersion('@discordjs/voice');\n\taddVersion('prism-media');\n\treport.push('');\n\n\t// opus\n\treport.push('Opus Libraries');\n\taddVersion('@discordjs/opus');\n\taddVersion('opusscript');\n\treport.push('');\n\n\t// encryption\n\treport.push('Encryption Libraries');\n\taddVersion('sodium-native');\n\taddVersion('sodium');\n\taddVersion('libsodium-wrappers');\n\taddVersion('tweetnacl');\n\treport.push('');\n\n\t// ffmpeg\n\treport.push('FFmpeg');\n\ttry {\n\t\tconst info = prism.FFmpeg.getInfo();\n\t\treport.push(`- version: ${info.version}`);\n\t\treport.push(`- libopus: ${info.output.includes('--enable-libopus') ? 'yes' : 'no'}`);\n\t} catch {\n\t\treport.push('- not found');\n\t}\n\n\treturn ['-'.repeat(50), ...report, '-'.repeat(50)].join('\\n');\n}\n","import { type EventEmitter, once } from 'node:events';\nimport type { VoiceConnection, VoiceConnectionStatus } from '../VoiceConnection';\nimport type { AudioPlayer, AudioPlayerStatus } from '../audio/AudioPlayer';\nimport { abortAfter } from './abortAfter';\n\n/**\n * Allows a voice connection a specified amount of time to enter a given state, otherwise rejects with an error.\n *\n * @param target - The voice connection that we want to observe the state change for\n * @param status - The status that the voice connection should be in\n * @param timeoutOrSignal - The maximum time we are allowing for this to occur, or a signal that will abort the operation\n */\nexport function entersState(\n\ttarget: VoiceConnection,\n\tstatus: VoiceConnectionStatus,\n\ttimeoutOrSignal: AbortSignal | number,\n): Promise;\n\n/**\n * Allows an audio player a specified amount of time to enter a given state, otherwise rejects with an error.\n *\n * @param target - The audio player that we want to observe the state change for\n * @param status - The status that the audio player should be in\n * @param timeoutOrSignal - The maximum time we are allowing for this to occur, or a signal that will abort the operation\n */\nexport function entersState(\n\ttarget: AudioPlayer,\n\tstatus: AudioPlayerStatus,\n\ttimeoutOrSignal: AbortSignal | number,\n): Promise;\n\n/**\n * Allows a target a specified amount of time to enter a given state, otherwise rejects with an error.\n *\n * @param target - The object that we want to observe the state change for\n * @param status - The status that the target should be in\n * @param timeoutOrSignal - The maximum time we are allowing for this to occur, or a signal that will abort the operation\n */\nexport async function entersState(\n\ttarget: Target,\n\tstatus: AudioPlayerStatus | VoiceConnectionStatus,\n\ttimeoutOrSignal: AbortSignal | number,\n) {\n\tif (target.state.status !== status) {\n\t\tconst [ac, signal] =\n\t\t\ttypeof timeoutOrSignal === 'number' ? abortAfter(timeoutOrSignal) : [undefined, timeoutOrSignal];\n\t\ttry {\n\t\t\tawait once(target as EventEmitter, status, { signal });\n\t\t} finally {\n\t\t\tac?.abort();\n\t\t}\n\t}\n\n\treturn target;\n}\n","/**\n * Creates an abort controller that aborts after the given time.\n *\n * @param delay - The time in milliseconds to wait before aborting\n */\nexport function abortAfter(delay: number): [AbortController, AbortSignal] {\n\tconst ac = new AbortController();\n\tconst timeout = setTimeout(() => ac.abort(), delay);\n\t// @ts-expect-error: No type for timeout\n\tac.signal.addEventListener('abort', () => clearTimeout(timeout));\n\treturn [ac, ac.signal];\n}\n","import { Buffer } from 'node:buffer';\nimport process from 'node:process';\nimport { Readable } from 'node:stream';\nimport prism from 'prism-media';\nimport { StreamType } from '..';\nimport { noop } from './util';\n\n/**\n * Takes an Opus Head, and verifies whether the associated Opus audio is suitable to play in a Discord voice channel.\n *\n * @param opusHead - The Opus Head to validate\n * @returns `true` if suitable to play in a Discord voice channel, otherwise `false`\n */\nexport function validateDiscordOpusHead(opusHead: Buffer): boolean {\n\tconst channels = opusHead.readUInt8(9);\n\tconst sampleRate = opusHead.readUInt32LE(12);\n\treturn channels === 2 && sampleRate === 48_000;\n}\n\n/**\n * The resulting information after probing an audio stream\n */\nexport interface ProbeInfo {\n\t/**\n\t * The readable audio stream to use. You should use this rather than the input stream, as the probing\n\t * function can sometimes read the input stream to its end and cause the stream to close.\n\t */\n\tstream: Readable;\n\n\t/**\n\t * The recommended stream type for this audio stream.\n\t */\n\ttype: StreamType;\n}\n\n/**\n * Attempt to probe a readable stream to figure out whether it can be demuxed using an Ogg or WebM Opus demuxer.\n *\n * @param stream - The readable stream to probe\n * @param probeSize - The number of bytes to attempt to read before giving up on the probe\n * @param validator - The Opus Head validator function\n * @experimental\n */\nexport async function demuxProbe(\n\tstream: Readable,\n\tprobeSize = 1_024,\n\tvalidator = validateDiscordOpusHead,\n): Promise {\n\treturn new Promise((resolve, reject) => {\n\t\t// Preconditions\n\t\tif (stream.readableObjectMode) {\n\t\t\treject(new Error('Cannot probe a readable stream in object mode'));\n\t\t\treturn;\n\t\t}\n\n\t\tif (stream.readableEnded) {\n\t\t\treject(new Error('Cannot probe a stream that has ended'));\n\t\t\treturn;\n\t\t}\n\n\t\tlet readBuffer = Buffer.alloc(0);\n\n\t\tlet resolved: StreamType | undefined;\n\n\t\tconst finish = (type: StreamType) => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\t\tstream.off('data', onData);\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\t\tstream.off('close', onClose);\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\t\tstream.off('end', onClose);\n\t\t\tstream.pause();\n\t\t\tresolved = type;\n\t\t\tif (stream.readableEnded) {\n\t\t\t\tresolve({\n\t\t\t\t\tstream: Readable.from(readBuffer),\n\t\t\t\t\ttype,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (readBuffer.length > 0) {\n\t\t\t\t\tstream.push(readBuffer);\n\t\t\t\t}\n\n\t\t\t\tresolve({\n\t\t\t\t\tstream,\n\t\t\t\t\ttype,\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tconst foundHead = (type: StreamType) => (head: Buffer) => {\n\t\t\tif (validator(head)) {\n\t\t\t\tfinish(type);\n\t\t\t}\n\t\t};\n\n\t\tconst webm = new prism.opus.WebmDemuxer();\n\t\twebm.once('error', noop);\n\t\twebm.on('head', foundHead(StreamType.WebmOpus));\n\n\t\tconst ogg = new prism.opus.OggDemuxer();\n\t\togg.once('error', noop);\n\t\togg.on('head', foundHead(StreamType.OggOpus));\n\n\t\tconst onClose = () => {\n\t\t\tif (!resolved) {\n\t\t\t\tfinish(StreamType.Arbitrary);\n\t\t\t}\n\t\t};\n\n\t\tconst onData = (buffer: Buffer) => {\n\t\t\treadBuffer = Buffer.concat([readBuffer, buffer]);\n\n\t\t\twebm.write(buffer);\n\t\t\togg.write(buffer);\n\n\t\t\tif (readBuffer.length >= probeSize) {\n\t\t\t\tstream.off('data', onData);\n\t\t\t\tstream.pause();\n\t\t\t\tprocess.nextTick(onClose);\n\t\t\t}\n\t\t};\n\n\t\tstream.once('error', reject);\n\t\tstream.on('data', onData);\n\t\tstream.once('close', onClose);\n\t\tstream.once('end', onClose);\n\t});\n}\n","export * from './joinVoiceChannel';\nexport * from './audio/index';\nexport * from './util/index';\nexport * from './receive/index';\n\nexport {\n\tVoiceConnection,\n\ttype VoiceConnectionState,\n\tVoiceConnectionStatus,\n\ttype VoiceConnectionConnectingState,\n\ttype VoiceConnectionDestroyedState,\n\ttype VoiceConnectionDisconnectedState,\n\ttype VoiceConnectionDisconnectedBaseState,\n\ttype VoiceConnectionDisconnectedOtherState,\n\ttype VoiceConnectionDisconnectedWebSocketState,\n\tVoiceConnectionDisconnectReason,\n\ttype VoiceConnectionReadyState,\n\ttype VoiceConnectionSignallingState,\n} from './VoiceConnection';\n\nexport { type JoinConfig, getVoiceConnection, getVoiceConnections, getGroups } from './DataStore';\n\n/**\n * The {@link https://github.com/discordjs/discord.js/blob/main/packages/voice#readme | @discordjs/voice} version\n * that you are currently using.\n */\n// This needs to explicitly be `string` so it is not typed as a \"const string\" that gets injected by esbuild\nexport const version = '0.17.0' as string;\n"],"mappings":";;;;;;;;;;;AAEA,SAAS,gBAAAA,qBAAoB;;;ACF7B,SAAS,sBAAsB;AAkBxB,SAAS,8BAA8B,QAAoB;AACjE,SAAO;AAAA,IACN,IAAI,eAAe;AAAA;AAAA,IAEnB,GAAG;AAAA,MACF,UAAU,OAAO;AAAA,MACjB,YAAY,OAAO;AAAA,MACnB,WAAW,OAAO;AAAA,MAClB,WAAW,OAAO;AAAA,IACnB;AAAA,EACD;AACD;AAXgB;AAchB,IAAM,SAAS,oBAAI,IAA0C;AAC7D,OAAO,IAAI,WAAW,oBAAI,IAAI,CAAC;AAE/B,SAAS,iBAAiB,OAAe;AACxC,QAAM,WAAW,OAAO,IAAI,KAAK;AACjC,MAAI;AAAU,WAAO;AACrB,QAAM,MAAM,oBAAI,IAA6B;AAC7C,SAAO,IAAI,OAAO,GAAG;AACrB,SAAO;AACR;AANS;AAcF,SAAS,YAAY;AAC3B,SAAO;AACR;AAFgB;AA0BT,SAAS,oBAAoB,QAAQ,WAAW;AACtD,SAAO,O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AW;AACnC,eAAO,IAAI,QAAQ,MAAM;AACzB,eAAO,MAAM;AACb,gBAAQ,SAAS,OAAO;AAAA,MACzB;AAAA,IACD,GAXe;AAaf,WAAO,KAAK,SAAS,MAAM;AAC3B,WAAO,GAAG,QAAQ,MAAM;AACxB,WAAO,KAAK,SAAS,OAAO;AAC5B,WAAO,KAAK,OAAO,OAAO;AAAA,EAC3B,CAAC;AACF;AArFsB;;;AChBf,IAAMG,WAAU;","names":["EventEmitter","Buffer","EventEmitter","VoiceOpcodes","Buffer","nonce","Buffer","Buffer","Buffer","resolve","EventEmitter","EventEmitter","nonce","Buffer","option","EventEmitter","VoiceOpcodes","Buffer","VoiceOpcodes","Buffer","EventEmitter","Buffer","NoSubscriberBehavior","AudioPlayerStatus","stringifyState","EventEmitter","EndBehaviorType","EventEmitter","EventEmitter","EventEmitter","EventEmitter","VoiceOpcodes","nonce","Buffer","VoiceConnectionStatus","VoiceConnectionDisconnectReason","EventEmitter","prism","StreamType","prism","prism","prism","Buffer","Readable","prism","resolve","Buffer","Readable","prism","version"]} \ No newline at end of file +{"version":3,"sources":["../src/VoiceConnection.ts","../src/DataStore.ts","../src/networking/Networking.ts","../src/util/Secretbox.ts","../src/util/util.ts","../src/networking/DAVESession.ts","../src/audio/AudioPlayer.ts","../src/audio/AudioPlayerError.ts","../src/audio/PlayerSubscription.ts","../src/networking/VoiceUDPSocket.ts","../src/networking/VoiceWebSocket.ts","../src/receive/VoiceReceiver.ts","../src/receive/AudioReceiveStream.ts","../src/receive/SSRCMap.ts","../src/receive/SpeakingMap.ts","../src/joinVoiceChannel.ts","../src/audio/AudioResource.ts","../src/audio/TransformerGraph.ts","../src/util/generateDependencyReport.ts","../src/util/entersState.ts","../src/util/abortAfter.ts","../src/util/demuxProbe.ts","../src/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/unbound-method */\nimport type { Buffer } from 'node:buffer';\nimport { EventEmitter } from 'node:events';\nimport type { GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData } from 'discord-api-types/v10';\nimport type { JoinConfig } from './DataStore';\nimport {\n\tgetVoiceConnection,\n\tcreateJoinVoiceChannelPayload,\n\ttrackVoiceConnection,\n\tuntrackVoiceConnection,\n} from './DataStore';\nimport type { AudioPlayer } from './audio/AudioPlayer';\nimport type { PlayerSubscription } from './audio/PlayerSubscription';\nimport type { VoiceWebSocket, VoiceUDPSocket } from './networking';\nimport { Networking, NetworkingStatusCode, type NetworkingState } from './networking/Networking';\nimport { VoiceReceiver } from './receive/index';\nimport type { DiscordGatewayAdapterImplementerMethods } from './util/adapter';\nimport { noop } from './util/util';\nimport type { CreateVoiceConnectionOptions } from './index';\n\n/**\n * The various status codes a voice connection can hold at any one time.\n */\nexport enum VoiceConnectionStatus {\n\t/**\n\t * The `VOICE_SERVER_UPDATE` and `VOICE_STATE_UPDATE` packets have been received, now attempting to establish a voice connection.\n\t */\n\tConnecting = 'connecting',\n\n\t/**\n\t * The voice connection has been destroyed and untracked, it cannot be reused.\n\t */\n\tDestroyed = 'destroyed',\n\n\t/**\n\t * The voice connection has either been severed or not established.\n\t */\n\tDisconnected = 'disconnected',\n\n\t/**\n\t * A voice connection has been established, and is ready to be used.\n\t */\n\tReady = 'ready',\n\n\t/**\n\t * Sending a packet to the main Discord gateway to indicate we want to change our voice state.\n\t */\n\tSignalling = 'signalling',\n}\n\n/**\n * The state that a VoiceConnection will be in when it is waiting to receive a VOICE_SERVER_UPDATE and\n * VOICE_STATE_UPDATE packet from Discord, provided by the adapter.\n */\nexport interface VoiceConnectionSignallingState {\n\tadapter: DiscordGatewayAdapterImplementerMethods;\n\tstatus: VoiceConnectionStatus.Signalling;\n\tsubscription?: PlayerSubscription | undefined;\n}\n\n/**\n * The reasons a voice connection can be in the disconnected state.\n */\nexport enum VoiceConnectionDisconnectReason {\n\t/**\n\t * When the WebSocket connection has been closed.\n\t */\n\tWebSocketClose,\n\n\t/**\n\t * When the adapter was unable to send a message requested by the VoiceConnection.\n\t */\n\tAdapterUnavailable,\n\n\t/**\n\t * When a VOICE_SERVER_UPDATE packet is received with a null endpoint, causing the connection to be severed.\n\t */\n\tEndpointRemoved,\n\n\t/**\n\t * When a manual disconnect was requested.\n\t */\n\tManual,\n}\n\n/**\n * The state that a VoiceConnection will be in when it is not connected to a Discord voice server nor is\n * it attempting to connect. You can manually attempt to reconnect using VoiceConnection#reconnect.\n */\nexport interface VoiceConnectionDisconnectedBaseState {\n\tadapter: DiscordGatewayAdapterImplementerMethods;\n\tstatus: VoiceConnectionStatus.Disconnected;\n\tsubscription?: PlayerSubscription | undefined;\n}\n\n/**\n * The state that a VoiceConnection will be in when it is not connected to a Discord voice server nor is\n * it attempting to connect. You can manually attempt to reconnect using VoiceConnection#reconnect.\n */\nexport interface VoiceConnectionDisconnectedOtherState extends VoiceConnectionDisconnectedBaseState {\n\treason: Exclude;\n}\n\n/**\n * The state that a VoiceConnection will be in when its WebSocket connection was closed.\n * You can manually attempt to reconnect using VoiceConnection#reconnect.\n */\nexport interface VoiceConnectionDisconnectedWebSocketState extends VoiceConnectionDisconnectedBaseState {\n\t/**\n\t * The close code of the WebSocket connection to the Discord voice server.\n\t */\n\tcloseCode: number;\n\n\treason: VoiceConnectionDisconnectReason.WebSocketClose;\n}\n\n/**\n * The states that a VoiceConnection can be in when it is not connected to a Discord voice server nor is\n * it attempting to connect. You can manually attempt to connect using VoiceConnection#reconnect.\n */\nexport type VoiceConnectionDisconnectedState =\n\t| VoiceConnectionDisconnectedOtherState\n\t| VoiceConnectionDisconnectedWebSocketState;\n\n/**\n * The state that a VoiceConnection will be in when it is establishing a connection to a Discord\n * voice server.\n */\nexport interface VoiceConnectionConnectingState {\n\tadapter: DiscordGatewayAdapterImplementerMethods;\n\tnetworking: Networking;\n\tstatus: VoiceConnectionStatus.Connecting;\n\tsubscription?: PlayerSubscription | undefined;\n}\n\n/**\n * The state that a VoiceConnection will be in when it has an active connection to a Discord\n * voice server.\n */\nexport interface VoiceConnectionReadyState {\n\tadapter: DiscordGatewayAdapterImplementerMethods;\n\tnetworking: Networking;\n\tstatus: VoiceConnectionStatus.Ready;\n\tsubscription?: PlayerSubscription | undefined;\n}\n\n/**\n * The state that a VoiceConnection will be in when it has been permanently been destroyed by the\n * user and untracked by the library. It cannot be reconnected, instead, a new VoiceConnection\n * needs to be established.\n */\nexport interface VoiceConnectionDestroyedState {\n\tstatus: VoiceConnectionStatus.Destroyed;\n}\n\n/**\n * The various states that a voice connection can be in.\n */\nexport type VoiceConnectionState =\n\t| VoiceConnectionConnectingState\n\t| VoiceConnectionDestroyedState\n\t| VoiceConnectionDisconnectedState\n\t| VoiceConnectionReadyState\n\t| VoiceConnectionSignallingState;\n\nexport interface VoiceConnection extends EventEmitter {\n\t/**\n\t * Emitted when there is an error emitted from the voice connection\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'error', listener: (error: Error) => void): this;\n\t/**\n\t * Emitted debugging information about the voice connection\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'debug', listener: (message: string) => void): this;\n\t/**\n\t * Emitted when the state of the voice connection changes\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'stateChange', listener: (oldState: VoiceConnectionState, newState: VoiceConnectionState) => void): this;\n\t/**\n\t * Emitted when the end-to-end encrypted session has transitioned\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'transitioned', listener: (transitionId: number) => void): this;\n\t/**\n\t * Emitted when the state of the voice connection changes to a specific status\n\t *\n\t * @eventProperty\n\t */\n\ton(\n\t\tevent: Event,\n\t\tlistener: (oldState: VoiceConnectionState, newState: VoiceConnectionState & { status: Event }) => void,\n\t): this;\n}\n\n/**\n * A connection to the voice server of a Guild, can be used to play audio in voice channels.\n */\nexport class VoiceConnection extends EventEmitter {\n\t/**\n\t * The number of consecutive rejoin attempts. Initially 0, and increments for each rejoin.\n\t * When a connection is successfully established, it resets to 0.\n\t */\n\tpublic rejoinAttempts: number;\n\n\t/**\n\t * The state of the voice connection.\n\t */\n\tprivate _state: VoiceConnectionState;\n\n\t/**\n\t * A configuration storing all the data needed to reconnect to a Guild's voice server.\n\t *\n\t * @internal\n\t */\n\tpublic readonly joinConfig: JoinConfig;\n\n\t/**\n\t * The two packets needed to successfully establish a voice connection. They are received\n\t * from the main Discord gateway after signalling to change the voice state.\n\t */\n\tprivate readonly packets: {\n\t\tserver: GatewayVoiceServerUpdateDispatchData | undefined;\n\t\tstate: GatewayVoiceStateUpdateDispatchData | undefined;\n\t};\n\n\t/**\n\t * The receiver of this voice connection. You should join the voice channel with `selfDeaf` set\n\t * to false for this feature to work properly.\n\t */\n\tpublic readonly receiver: VoiceReceiver;\n\n\t/**\n\t * The debug logger function, if debugging is enabled.\n\t */\n\tprivate readonly debug: ((message: string) => void) | null;\n\n\t/**\n\t * The options used to create this voice connection.\n\t */\n\tprivate readonly options: CreateVoiceConnectionOptions;\n\n\t/**\n\t * Creates a new voice connection.\n\t *\n\t * @param joinConfig - The data required to establish the voice connection\n\t * @param options - The options used to create this voice connection\n\t */\n\tpublic constructor(joinConfig: JoinConfig, options: CreateVoiceConnectionOptions) {\n\t\tsuper();\n\n\t\tthis.debug = options.debug ? (message: string) => this.emit('debug', message) : null;\n\t\tthis.rejoinAttempts = 0;\n\n\t\tthis.receiver = new VoiceReceiver(this);\n\n\t\tthis.onNetworkingClose = this.onNetworkingClose.bind(this);\n\t\tthis.onNetworkingStateChange = this.onNetworkingStateChange.bind(this);\n\t\tthis.onNetworkingError = this.onNetworkingError.bind(this);\n\t\tthis.onNetworkingDebug = this.onNetworkingDebug.bind(this);\n\t\tthis.onNetworkingTransitioned = this.onNetworkingTransitioned.bind(this);\n\n\t\tconst adapter = options.adapterCreator({\n\t\t\tonVoiceServerUpdate: (data) => this.addServerPacket(data),\n\t\t\tonVoiceStateUpdate: (data) => this.addStatePacket(data),\n\t\t\tdestroy: () => this.destroy(false),\n\t\t});\n\n\t\tthis._state = { status: VoiceConnectionStatus.Signalling, adapter };\n\n\t\tthis.packets = {\n\t\t\tserver: undefined,\n\t\t\tstate: undefined,\n\t\t};\n\n\t\tthis.joinConfig = joinConfig;\n\t\tthis.options = options;\n\t}\n\n\t/**\n\t * The current state of the voice connection.\n\t *\n\t * @remarks\n\t * The setter will perform clean-up operations where necessary.\n\t */\n\tpublic get state() {\n\t\treturn this._state;\n\t}\n\n\tpublic set state(newState: VoiceConnectionState) {\n\t\tconst oldState = this._state;\n\t\tconst oldNetworking = Reflect.get(oldState, 'networking') as Networking | undefined;\n\t\tconst newNetworking = Reflect.get(newState, 'networking') as Networking | undefined;\n\n\t\tconst oldSubscription = Reflect.get(oldState, 'subscription') as PlayerSubscription | undefined;\n\t\tconst newSubscription = Reflect.get(newState, 'subscription') as PlayerSubscription | undefined;\n\n\t\tif (oldNetworking !== newNetworking) {\n\t\t\tif (oldNetworking) {\n\t\t\t\toldNetworking.on('error', noop);\n\t\t\t\toldNetworking.off('debug', this.onNetworkingDebug);\n\t\t\t\toldNetworking.off('error', this.onNetworkingError);\n\t\t\t\toldNetworking.off('close', this.onNetworkingClose);\n\t\t\t\toldNetworking.off('stateChange', this.onNetworkingStateChange);\n\t\t\t\toldNetworking.off('transitioned', this.onNetworkingTransitioned);\n\t\t\t\toldNetworking.destroy();\n\t\t\t}\n\n\t\t\tif (newNetworking) this.updateReceiveBindings(newNetworking.state, oldNetworking?.state);\n\t\t}\n\n\t\tif (newState.status === VoiceConnectionStatus.Ready) {\n\t\t\tthis.rejoinAttempts = 0;\n\t\t} else if (newState.status === VoiceConnectionStatus.Destroyed) {\n\t\t\tfor (const stream of this.receiver.subscriptions.values()) {\n\t\t\t\tif (!stream.destroyed) stream.destroy();\n\t\t\t}\n\t\t}\n\n\t\t// If destroyed, the adapter can also be destroyed so it can be cleaned up by the user\n\t\tif (oldState.status !== VoiceConnectionStatus.Destroyed && newState.status === VoiceConnectionStatus.Destroyed) {\n\t\t\toldState.adapter.destroy();\n\t\t}\n\n\t\tthis._state = newState;\n\n\t\tif (oldSubscription && oldSubscription !== newSubscription) {\n\t\t\toldSubscription.unsubscribe();\n\t\t}\n\n\t\tthis.emit('stateChange', oldState, newState);\n\t\tif (oldState.status !== newState.status) {\n\t\t\tthis.emit(newState.status, oldState, newState as any);\n\t\t}\n\t}\n\n\t/**\n\t * Registers a `VOICE_SERVER_UPDATE` packet to the voice connection. This will cause it to reconnect using the\n\t * new data provided in the packet.\n\t *\n\t * @param packet - The received `VOICE_SERVER_UPDATE` packet\n\t */\n\tprivate addServerPacket(packet: GatewayVoiceServerUpdateDispatchData) {\n\t\tthis.packets.server = packet;\n\t\tif (packet.endpoint) {\n\t\t\tthis.configureNetworking();\n\t\t} else if (this.state.status !== VoiceConnectionStatus.Destroyed) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\treason: VoiceConnectionDisconnectReason.EndpointRemoved,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Registers a `VOICE_STATE_UPDATE` packet to the voice connection. Most importantly, it stores the id of the\n\t * channel that the client is connected to.\n\t *\n\t * @param packet - The received `VOICE_STATE_UPDATE` packet\n\t */\n\tprivate addStatePacket(packet: GatewayVoiceStateUpdateDispatchData) {\n\t\tthis.packets.state = packet;\n\n\t\tif (packet.self_deaf !== undefined) this.joinConfig.selfDeaf = packet.self_deaf;\n\t\tif (packet.self_mute !== undefined) this.joinConfig.selfMute = packet.self_mute;\n\t\tif (packet.channel_id) this.joinConfig.channelId = packet.channel_id;\n\t\t/*\n\t\t\tthe channel_id being null doesn't necessarily mean it was intended for the client to leave the voice channel\n\t\t\tas it may have disconnected due to network failure. This will be gracefully handled once the voice websocket\n\t\t\tdies, and then it is up to the user to decide how they wish to handle this.\n\t\t*/\n\t}\n\n\t/**\n\t * Called when the networking state changes, and the new ws/udp packet/message handlers need to be rebound\n\t * to the new instances.\n\t *\n\t * @param newState - The new networking state\n\t * @param oldState - The old networking state, if there is one\n\t */\n\tprivate updateReceiveBindings(newState: NetworkingState, oldState?: NetworkingState) {\n\t\tconst oldWs = Reflect.get(oldState ?? {}, 'ws') as VoiceWebSocket | undefined;\n\t\tconst newWs = Reflect.get(newState, 'ws') as VoiceWebSocket | undefined;\n\t\tconst oldUdp = Reflect.get(oldState ?? {}, 'udp') as VoiceUDPSocket | undefined;\n\t\tconst newUdp = Reflect.get(newState, 'udp') as VoiceUDPSocket | undefined;\n\n\t\tif (oldWs !== newWs) {\n\t\t\toldWs?.off('packet', this.receiver.onWsPacket);\n\t\t\tnewWs?.on('packet', this.receiver.onWsPacket);\n\t\t}\n\n\t\tif (oldUdp !== newUdp) {\n\t\t\toldUdp?.off('message', this.receiver.onUdpMessage);\n\t\t\tnewUdp?.on('message', this.receiver.onUdpMessage);\n\t\t}\n\n\t\tthis.receiver.connectionData = Reflect.get(newState, 'connectionData') ?? {};\n\t}\n\n\t/**\n\t * Attempts to configure a networking instance for this voice connection using the received packets.\n\t * Both packets are required, and any existing networking instance will be destroyed.\n\t *\n\t * @remarks\n\t * This is called when the voice server of the connection changes, e.g. if the bot is moved into a\n\t * different channel in the same guild but has a different voice server. In this instance, the connection\n\t * needs to be re-established to the new voice server.\n\t *\n\t * The connection will transition to the Connecting state when this is called.\n\t */\n\tpublic configureNetworking() {\n\t\tconst { server, state } = this.packets;\n\t\tif (!server || !state || this.state.status === VoiceConnectionStatus.Destroyed || !server.endpoint) return;\n\n\t\tconst networking = new Networking(\n\t\t\t{\n\t\t\t\tendpoint: server.endpoint,\n\t\t\t\tserverId: server.guild_id,\n\t\t\t\ttoken: server.token,\n\t\t\t\tsessionId: state.session_id,\n\t\t\t\tuserId: state.user_id,\n\t\t\t\tchannelId: state.channel_id!,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdebug: Boolean(this.debug),\n\t\t\t\tdaveEncryption: this.options.daveEncryption ?? true,\n\t\t\t\tdecryptionFailureTolerance: this.options.decryptionFailureTolerance,\n\t\t\t},\n\t\t);\n\n\t\tnetworking.once('close', this.onNetworkingClose);\n\t\tnetworking.on('stateChange', this.onNetworkingStateChange);\n\t\tnetworking.on('error', this.onNetworkingError);\n\t\tnetworking.on('debug', this.onNetworkingDebug);\n\t\tnetworking.on('transitioned', this.onNetworkingTransitioned);\n\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\tstatus: VoiceConnectionStatus.Connecting,\n\t\t\tnetworking,\n\t\t};\n\t}\n\n\t/**\n\t * Called when the networking instance for this connection closes. If the close code is 4014 (do not reconnect),\n\t * the voice connection will transition to the Disconnected state which will store the close code. You can\n\t * decide whether or not to reconnect when this occurs by listening for the state change and calling reconnect().\n\t *\n\t * @remarks\n\t * If the close code was anything other than 4014, it is likely that the closing was not intended, and so the\n\t * VoiceConnection will signal to Discord that it would like to rejoin the channel. This automatically attempts\n\t * to re-establish the connection. This would be seen as a transition from the Ready state to the Signalling state.\n\t * @param code - The close code\n\t */\n\tprivate onNetworkingClose(code: number) {\n\t\tif (this.state.status === VoiceConnectionStatus.Destroyed) return;\n\t\t// If networking closes, try to connect to the voice channel again.\n\t\tif (code === 4_014) {\n\t\t\t// Disconnected - networking is already destroyed here\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\treason: VoiceConnectionDisconnectReason.WebSocketClose,\n\t\t\t\tcloseCode: code,\n\t\t\t};\n\t\t} else {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Signalling,\n\t\t\t};\n\t\t\tthis.rejoinAttempts++;\n\t\t\tif (!this.state.adapter.sendPayload(createJoinVoiceChannelPayload(this.joinConfig))) {\n\t\t\t\tthis.state = {\n\t\t\t\t\t...this.state,\n\t\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Called when the state of the networking instance changes. This is used to derive the state of the voice connection.\n\t *\n\t * @param oldState - The previous state\n\t * @param newState - The new state\n\t */\n\tprivate onNetworkingStateChange(oldState: NetworkingState, newState: NetworkingState) {\n\t\tthis.updateReceiveBindings(newState, oldState);\n\t\tif (oldState.code === newState.code) return;\n\t\tif (this.state.status !== VoiceConnectionStatus.Connecting && this.state.status !== VoiceConnectionStatus.Ready)\n\t\t\treturn;\n\n\t\tif (newState.code === NetworkingStatusCode.Ready) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Ready,\n\t\t\t};\n\t\t} else if (newState.code !== NetworkingStatusCode.Closed) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Connecting,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Propagates errors from the underlying network instance.\n\t *\n\t * @param error - The error to propagate\n\t */\n\tprivate onNetworkingError(error: Error) {\n\t\tthis.emit('error', error);\n\t}\n\n\t/**\n\t * Propagates debug messages from the underlying network instance.\n\t *\n\t * @param message - The debug message to propagate\n\t */\n\tprivate onNetworkingDebug(message: string) {\n\t\tthis.debug?.(`[NW] ${message}`);\n\t}\n\n\t/**\n\t * Propagates transitions from the underlying network instance.\n\t *\n\t * @param transitionId - The transition id\n\t */\n\tprivate onNetworkingTransitioned(transitionId: number) {\n\t\tthis.emit('transitioned', transitionId);\n\t}\n\n\t/**\n\t * Prepares an audio packet for dispatch.\n\t *\n\t * @param buffer - The Opus packet to prepare\n\t */\n\tpublic prepareAudioPacket(buffer: Buffer) {\n\t\tconst state = this.state;\n\t\tif (state.status !== VoiceConnectionStatus.Ready) return;\n\t\treturn state.networking.prepareAudioPacket(buffer);\n\t}\n\n\t/**\n\t * Dispatches the previously prepared audio packet (if any)\n\t */\n\tpublic dispatchAudio() {\n\t\tconst state = this.state;\n\t\tif (state.status !== VoiceConnectionStatus.Ready) return;\n\t\treturn state.networking.dispatchAudio();\n\t}\n\n\t/**\n\t * Prepares an audio packet and dispatches it immediately.\n\t *\n\t * @param buffer - The Opus packet to play\n\t */\n\tpublic playOpusPacket(buffer: Buffer) {\n\t\tconst state = this.state;\n\t\tif (state.status !== VoiceConnectionStatus.Ready) return;\n\t\tstate.networking.prepareAudioPacket(buffer);\n\t\treturn state.networking.dispatchAudio();\n\t}\n\n\t/**\n\t * Destroys the VoiceConnection, preventing it from connecting to voice again.\n\t * This method should be called when you no longer require the VoiceConnection to\n\t * prevent memory leaks.\n\t *\n\t * @param adapterAvailable - Whether the adapter can be used\n\t */\n\tpublic destroy(adapterAvailable = true) {\n\t\tif (this.state.status === VoiceConnectionStatus.Destroyed) {\n\t\t\tthrow new Error('Cannot destroy VoiceConnection - it has already been destroyed');\n\t\t}\n\n\t\tif (getVoiceConnection(this.joinConfig.guildId, this.joinConfig.group) === this) {\n\t\t\tuntrackVoiceConnection(this);\n\t\t}\n\n\t\tif (adapterAvailable) {\n\t\t\tthis.state.adapter.sendPayload(createJoinVoiceChannelPayload({ ...this.joinConfig, channelId: null }));\n\t\t}\n\n\t\tthis.state = {\n\t\t\tstatus: VoiceConnectionStatus.Destroyed,\n\t\t};\n\t}\n\n\t/**\n\t * Disconnects the VoiceConnection, allowing the possibility of rejoining later on.\n\t *\n\t * @returns `true` if the connection was successfully disconnected\n\t */\n\tpublic disconnect() {\n\t\tif (\n\t\t\tthis.state.status === VoiceConnectionStatus.Destroyed ||\n\t\t\tthis.state.status === VoiceConnectionStatus.Signalling\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.joinConfig.channelId = null;\n\t\tif (!this.state.adapter.sendPayload(createJoinVoiceChannelPayload(this.joinConfig))) {\n\t\t\tthis.state = {\n\t\t\t\tadapter: this.state.adapter,\n\t\t\t\tsubscription: this.state.subscription,\n\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t\t};\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.state = {\n\t\t\tadapter: this.state.adapter,\n\t\t\treason: VoiceConnectionDisconnectReason.Manual,\n\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t};\n\t\treturn true;\n\t}\n\n\t/**\n\t * Attempts to rejoin (better explanation soon:tm:)\n\t *\n\t * @remarks\n\t * Calling this method successfully will automatically increment the `rejoinAttempts` counter,\n\t * which you can use to inform whether or not you'd like to keep attempting to reconnect your\n\t * voice connection.\n\t *\n\t * A state transition from Disconnected to Signalling will be observed when this is called.\n\t */\n\tpublic rejoin(joinConfig?: Omit) {\n\t\tif (this.state.status === VoiceConnectionStatus.Destroyed) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst notReady = this.state.status !== VoiceConnectionStatus.Ready;\n\n\t\tif (notReady) this.rejoinAttempts++;\n\t\tObject.assign(this.joinConfig, joinConfig);\n\t\tif (this.state.adapter.sendPayload(createJoinVoiceChannelPayload(this.joinConfig))) {\n\t\t\tif (notReady) {\n\t\t\t\tthis.state = {\n\t\t\t\t\t...this.state,\n\t\t\t\t\tstatus: VoiceConnectionStatus.Signalling,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tthis.state = {\n\t\t\tadapter: this.state.adapter,\n\t\t\tsubscription: this.state.subscription,\n\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t};\n\t\treturn false;\n\t}\n\n\t/**\n\t * Updates the speaking status of the voice connection. This is used when audio players are done playing audio,\n\t * and need to signal that the connection is no longer playing audio.\n\t *\n\t * @param enabled - Whether or not to show as speaking\n\t */\n\tpublic setSpeaking(enabled: boolean) {\n\t\tif (this.state.status !== VoiceConnectionStatus.Ready) return false;\n\t\t// eslint-disable-next-line @typescript-eslint/no-confusing-void-expression\n\t\treturn this.state.networking.setSpeaking(enabled);\n\t}\n\n\t/**\n\t * Subscribes to an audio player, allowing the player to play audio on this voice connection.\n\t *\n\t * @param player - The audio player to subscribe to\n\t * @returns The created subscription\n\t */\n\tpublic subscribe(player: AudioPlayer) {\n\t\tif (this.state.status === VoiceConnectionStatus.Destroyed) return;\n\n\t\t// eslint-disable-next-line @typescript-eslint/dot-notation\n\t\tconst subscription = player['subscribe'](this);\n\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\tsubscription,\n\t\t};\n\n\t\treturn subscription;\n\t}\n\n\t/**\n\t * The latest ping (in milliseconds) for the WebSocket connection and audio playback for this voice\n\t * connection, if this data is available.\n\t *\n\t * @remarks\n\t * For this data to be available, the VoiceConnection must be in the Ready state, and its underlying\n\t * WebSocket connection and UDP socket must have had at least one ping-pong exchange.\n\t */\n\tpublic get ping() {\n\t\tif (\n\t\t\tthis.state.status === VoiceConnectionStatus.Ready &&\n\t\t\tthis.state.networking.state.code === NetworkingStatusCode.Ready\n\t\t) {\n\t\t\treturn {\n\t\t\t\tws: this.state.networking.state.ws.ping,\n\t\t\t\tudp: this.state.networking.state.udp.ping,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tws: undefined,\n\t\t\tudp: undefined,\n\t\t};\n\t}\n\n\t/**\n\t * The current voice privacy code of the encrypted session.\n\t *\n\t * @remarks\n\t * For this data to be available, the VoiceConnection must be in the Ready state,\n\t * and the connection would have to be end-to-end encrypted.\n\t */\n\tpublic get voicePrivacyCode() {\n\t\tif (\n\t\t\tthis.state.status === VoiceConnectionStatus.Ready &&\n\t\t\tthis.state.networking.state.code === NetworkingStatusCode.Ready\n\t\t) {\n\t\t\treturn this.state.networking.state.dave?.voicePrivacyCode ?? undefined;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Gets the verification code for a user in the session.\n\t *\n\t * @throws Will throw if end-to-end encryption is not on or if the user id provided is not in the session.\n\t */\n\tpublic async getVerificationCode(userId: string): Promise {\n\t\tif (\n\t\t\tthis.state.status === VoiceConnectionStatus.Ready &&\n\t\t\tthis.state.networking.state.code === NetworkingStatusCode.Ready &&\n\t\t\tthis.state.networking.state.dave\n\t\t) {\n\t\t\treturn this.state.networking.state.dave.getVerificationCode(userId);\n\t\t}\n\n\t\tthrow new Error('Session not available');\n\t}\n\n\t/**\n\t * Called when a subscription of this voice connection to an audio player is removed.\n\t *\n\t * @param subscription - The removed subscription\n\t */\n\tprotected onSubscriptionRemoved(subscription: PlayerSubscription) {\n\t\tif (this.state.status !== VoiceConnectionStatus.Destroyed && this.state.subscription === subscription) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tsubscription: undefined,\n\t\t\t};\n\t\t}\n\t}\n}\n\n/**\n * Creates a new voice connection.\n *\n * @param joinConfig - The data required to establish the voice connection\n * @param options - The options to use when joining the voice channel\n */\nexport function createVoiceConnection(joinConfig: JoinConfig, options: CreateVoiceConnectionOptions) {\n\tconst payload = createJoinVoiceChannelPayload(joinConfig);\n\tconst existing = getVoiceConnection(joinConfig.guildId, joinConfig.group);\n\tif (existing && existing.state.status !== VoiceConnectionStatus.Destroyed) {\n\t\tif (existing.state.status === VoiceConnectionStatus.Disconnected) {\n\t\t\texisting.rejoin({\n\t\t\t\tchannelId: joinConfig.channelId,\n\t\t\t\tselfDeaf: joinConfig.selfDeaf,\n\t\t\t\tselfMute: joinConfig.selfMute,\n\t\t\t});\n\t\t} else if (!existing.state.adapter.sendPayload(payload)) {\n\t\t\texisting.state = {\n\t\t\t\t...existing.state,\n\t\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t\t};\n\t\t}\n\n\t\treturn existing;\n\t}\n\n\tconst voiceConnection = new VoiceConnection(joinConfig, options);\n\ttrackVoiceConnection(voiceConnection);\n\tif (\n\t\tvoiceConnection.state.status !== VoiceConnectionStatus.Destroyed &&\n\t\t!voiceConnection.state.adapter.sendPayload(payload)\n\t) {\n\t\tvoiceConnection.state = {\n\t\t\t...voiceConnection.state,\n\t\t\tstatus: VoiceConnectionStatus.Disconnected,\n\t\t\treason: VoiceConnectionDisconnectReason.AdapterUnavailable,\n\t\t};\n\t}\n\n\treturn voiceConnection;\n}\n","import { GatewayOpcodes } from 'discord-api-types/v10';\nimport type { VoiceConnection } from './VoiceConnection';\nimport type { AudioPlayer } from './audio/index';\n\nexport interface JoinConfig {\n\tchannelId: string | null;\n\tgroup: string;\n\tguildId: string;\n\tselfDeaf: boolean;\n\tselfMute: boolean;\n}\n\n/**\n * Sends a voice state update to the main websocket shard of a guild, to indicate joining/leaving/moving across\n * voice channels.\n *\n * @param config - The configuration to use when joining the voice channel\n */\nexport function createJoinVoiceChannelPayload(config: JoinConfig) {\n\treturn {\n\t\top: GatewayOpcodes.VoiceStateUpdate,\n\t\t// eslint-disable-next-line id-length\n\t\td: {\n\t\t\tguild_id: config.guildId,\n\t\t\tchannel_id: config.channelId,\n\t\t\tself_deaf: config.selfDeaf,\n\t\t\tself_mute: config.selfMute,\n\t\t},\n\t};\n}\n\n// Voice Connections\nconst groups = new Map>();\ngroups.set('default', new Map());\n\nfunction getOrCreateGroup(group: string) {\n\tconst existing = groups.get(group);\n\tif (existing) return existing;\n\tconst map = new Map();\n\tgroups.set(group, map);\n\treturn map;\n}\n\n/**\n * Retrieves the map of group names to maps of voice connections. By default, all voice connections\n * are created under the 'default' group.\n *\n * @returns The group map\n */\nexport function getGroups() {\n\treturn groups;\n}\n\n/**\n * Retrieves all the voice connections under the 'default' group.\n *\n * @param group - The group to look up\n * @returns The map of voice connections\n */\nexport function getVoiceConnections(group?: 'default'): Map;\n\n/**\n * Retrieves all the voice connections under the given group name.\n *\n * @param group - The group to look up\n * @returns The map of voice connections\n */\nexport function getVoiceConnections(group: string): Map | undefined;\n\n/**\n * Retrieves all the voice connections under the given group name. Defaults to the 'default' group.\n *\n * @param group - The group to look up\n * @returns The map of voice connections\n */\nexport function getVoiceConnections(group = 'default') {\n\treturn groups.get(group);\n}\n\n/**\n * Finds a voice connection with the given guild id and group. Defaults to the 'default' group.\n *\n * @param guildId - The guild id of the voice connection\n * @param group - the group that the voice connection was registered with\n * @returns The voice connection, if it exists\n */\nexport function getVoiceConnection(guildId: string, group = 'default') {\n\treturn getVoiceConnections(group)?.get(guildId);\n}\n\nexport function untrackVoiceConnection(voiceConnection: VoiceConnection) {\n\treturn getVoiceConnections(voiceConnection.joinConfig.group)?.delete(voiceConnection.joinConfig.guildId);\n}\n\nexport function trackVoiceConnection(voiceConnection: VoiceConnection) {\n\treturn getOrCreateGroup(voiceConnection.joinConfig.group).set(voiceConnection.joinConfig.guildId, voiceConnection);\n}\n\n// Audio Players\n\n// Each audio packet is 20ms long\nconst FRAME_LENGTH = 20;\n\nlet audioCycleInterval: NodeJS.Timeout | undefined;\nlet nextTime = -1;\n\n/**\n * A list of created audio players that are still active and haven't been destroyed.\n */\nconst audioPlayers: AudioPlayer[] = [];\n\n/**\n * Called roughly every 20 milliseconds. Dispatches audio from all players, and then gets the players to prepare\n * the next audio frame.\n */\nfunction audioCycleStep() {\n\tif (nextTime === -1) return;\n\n\tnextTime += FRAME_LENGTH;\n\tconst available = audioPlayers.filter((player) => player.checkPlayable());\n\n\tfor (const player of available) {\n\t\t// eslint-disable-next-line @typescript-eslint/dot-notation\n\t\tplayer['_stepDispatch']();\n\t}\n\n\tprepareNextAudioFrame(available);\n}\n\n/**\n * Recursively gets the players that have been passed as parameters to prepare audio frames that can be played\n * at the start of the next cycle.\n */\nfunction prepareNextAudioFrame(players: AudioPlayer[]) {\n\tconst nextPlayer = players.shift();\n\n\tif (!nextPlayer) {\n\t\tif (nextTime !== -1) {\n\t\t\taudioCycleInterval = setTimeout(() => audioCycleStep(), nextTime - Date.now());\n\t\t}\n\n\t\treturn;\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/dot-notation\n\tnextPlayer['_stepPrepare']();\n\n\t// setImmediate to avoid long audio player chains blocking other scheduled tasks\n\tsetImmediate(() => prepareNextAudioFrame(players));\n}\n\n/**\n * Checks whether or not the given audio player is being driven by the data store clock.\n *\n * @param target - The target to test for\n * @returns `true` if it is being tracked, `false` otherwise\n */\nexport function hasAudioPlayer(target: AudioPlayer) {\n\treturn audioPlayers.includes(target);\n}\n\n/**\n * Adds an audio player to the data store tracking list, if it isn't already there.\n *\n * @param player - The player to track\n */\nexport function addAudioPlayer(player: AudioPlayer) {\n\tif (hasAudioPlayer(player)) return player;\n\taudioPlayers.push(player);\n\tif (audioPlayers.length === 1) {\n\t\tnextTime = Date.now();\n\t\tsetImmediate(() => audioCycleStep());\n\t}\n\n\treturn player;\n}\n\n/**\n * Removes an audio player from the data store tracking list, if it is present there.\n */\nexport function deleteAudioPlayer(player: AudioPlayer) {\n\tconst index = audioPlayers.indexOf(player);\n\tif (index === -1) return;\n\taudioPlayers.splice(index, 1);\n\tif (audioPlayers.length === 0) {\n\t\tnextTime = -1;\n\t\tif (audioCycleInterval !== undefined) clearTimeout(audioCycleInterval);\n\t}\n}\n","/* eslint-disable jsdoc/check-param-names */\n/* eslint-disable id-length */\n/* eslint-disable @typescript-eslint/unbound-method */\nimport { Buffer } from 'node:buffer';\nimport crypto from 'node:crypto';\nimport { EventEmitter } from 'node:events';\nimport type { VoiceReceivePayload, VoiceSpeakingFlags } from 'discord-api-types/voice/v8';\nimport { VoiceEncryptionMode, VoiceOpcodes } from 'discord-api-types/voice/v8';\nimport type { CloseEvent } from 'ws';\nimport * as secretbox from '../util/Secretbox';\nimport { noop } from '../util/util';\nimport { DAVESession, getMaxProtocolVersion } from './DAVESession';\nimport { VoiceUDPSocket } from './VoiceUDPSocket';\nimport type { BinaryWebSocketMessage } from './VoiceWebSocket';\nimport { VoiceWebSocket } from './VoiceWebSocket';\n\n// The number of audio channels required by Discord\nconst CHANNELS = 2;\nconst TIMESTAMP_INC = (48_000 / 100) * CHANNELS;\nconst MAX_NONCE_SIZE = 2 ** 32 - 1;\n\nexport const SUPPORTED_ENCRYPTION_MODES: VoiceEncryptionMode[] = [VoiceEncryptionMode.AeadXChaCha20Poly1305RtpSize];\n\n// Just in case there's some system that doesn't come with aes-256-gcm, conditionally add it as supported\nif (crypto.getCiphers().includes('aes-256-gcm')) {\n\tSUPPORTED_ENCRYPTION_MODES.unshift(VoiceEncryptionMode.AeadAes256GcmRtpSize);\n}\n\n/**\n * The different statuses that a networking instance can hold. The order\n * of the states between OpeningWs and Ready is chronological (first the\n * instance enters OpeningWs, then it enters Identifying etc.)\n */\nexport enum NetworkingStatusCode {\n\tOpeningWs,\n\tIdentifying,\n\tUdpHandshaking,\n\tSelectingProtocol,\n\tReady,\n\tResuming,\n\tClosed,\n}\n\n/**\n * The initial Networking state. Instances will be in this state when a WebSocket connection to a Discord\n * voice gateway is being opened.\n */\nexport interface NetworkingOpeningWsState {\n\tcode: NetworkingStatusCode.OpeningWs;\n\tconnectionOptions: ConnectionOptions;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when it is attempting to authorize itself.\n */\nexport interface NetworkingIdentifyingState {\n\tcode: NetworkingStatusCode.Identifying;\n\tconnectionOptions: ConnectionOptions;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when opening a UDP connection to the IP and port provided\n * by Discord, as well as performing IP discovery.\n */\nexport interface NetworkingUdpHandshakingState {\n\tcode: NetworkingStatusCode.UdpHandshaking;\n\tconnectionData: Pick;\n\tconnectionOptions: ConnectionOptions;\n\tudp: VoiceUDPSocket;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when selecting an encryption protocol for audio packets.\n */\nexport interface NetworkingSelectingProtocolState {\n\tcode: NetworkingStatusCode.SelectingProtocol;\n\tconnectionData: Pick;\n\tconnectionOptions: ConnectionOptions;\n\tudp: VoiceUDPSocket;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when it has a fully established connection to a Discord\n * voice server.\n */\nexport interface NetworkingReadyState {\n\tcode: NetworkingStatusCode.Ready;\n\tconnectionData: ConnectionData;\n\tconnectionOptions: ConnectionOptions;\n\tdave?: DAVESession | undefined;\n\tpreparedPacket?: Buffer | undefined;\n\tudp: VoiceUDPSocket;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when its connection has been dropped unexpectedly, and it\n * is attempting to resume an existing session.\n */\nexport interface NetworkingResumingState {\n\tcode: NetworkingStatusCode.Resuming;\n\tconnectionData: ConnectionData;\n\tconnectionOptions: ConnectionOptions;\n\tdave?: DAVESession | undefined;\n\tpreparedPacket?: Buffer | undefined;\n\tudp: VoiceUDPSocket;\n\tws: VoiceWebSocket;\n}\n\n/**\n * The state that a Networking instance will be in when it has been destroyed. It cannot be recovered from this\n * state.\n */\nexport interface NetworkingClosedState {\n\tcode: NetworkingStatusCode.Closed;\n}\n\n/**\n * The various states that a networking instance can be in.\n */\nexport type NetworkingState =\n\t| NetworkingClosedState\n\t| NetworkingIdentifyingState\n\t| NetworkingOpeningWsState\n\t| NetworkingReadyState\n\t| NetworkingResumingState\n\t| NetworkingSelectingProtocolState\n\t| NetworkingUdpHandshakingState;\n\n/**\n * Details required to connect to the Discord voice gateway. These details\n * are first received on the main bot gateway, in the form of VOICE_SERVER_UPDATE\n * and VOICE_STATE_UPDATE packets.\n */\nexport interface ConnectionOptions {\n\tchannelId: string;\n\tendpoint: string;\n\tserverId: string;\n\tsessionId: string;\n\ttoken: string;\n\tuserId: string;\n}\n\n/**\n * Information about the current connection, e.g. which encryption mode is to be used on\n * the connection, timing information for playback of streams.\n */\nexport interface ConnectionData {\n\tconnectedClients: Set;\n\tencryptionMode: string;\n\tnonce: number;\n\tnonceBuffer: Buffer;\n\tpacketsPlayed: number;\n\tsecretKey: Uint8Array;\n\tsequence: number;\n\tspeaking: boolean;\n\tssrc: number;\n\ttimestamp: number;\n}\n\n/**\n * Options for networking that dictate behavior.\n */\nexport interface NetworkingOptions {\n\tdaveEncryption?: boolean | undefined;\n\tdebug?: boolean | undefined;\n\tdecryptionFailureTolerance?: number | undefined;\n}\n\n/**\n * An empty buffer that is reused in packet encryption by many different networking instances.\n */\nconst nonce = Buffer.alloc(24);\n\nexport interface Networking extends EventEmitter {\n\t/**\n\t * Debug event for Networking.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'debug', listener: (message: string) => void): this;\n\ton(event: 'error', listener: (error: Error) => void): this;\n\ton(event: 'stateChange', listener: (oldState: NetworkingState, newState: NetworkingState) => void): this;\n\ton(event: 'close', listener: (code: number) => void): this;\n\ton(event: 'transitioned', listener: (transitionId: number) => void): this;\n}\n\n/**\n * Stringifies a NetworkingState.\n *\n * @param state - The state to stringify\n */\nfunction stringifyState(state: NetworkingState) {\n\treturn JSON.stringify({\n\t\t...state,\n\t\tws: Reflect.has(state, 'ws'),\n\t\tudp: Reflect.has(state, 'udp'),\n\t});\n}\n\n/**\n * Chooses an encryption mode from a list of given options. Chooses the most preferred option.\n *\n * @param options - The available encryption options\n */\nfunction chooseEncryptionMode(options: VoiceEncryptionMode[]): VoiceEncryptionMode {\n\tconst option = options.find((option) => SUPPORTED_ENCRYPTION_MODES.includes(option));\n\tif (!option) {\n\t\t// This should only ever happen if the gateway does not give us any encryption modes we support.\n\t\tthrow new Error(`No compatible encryption modes. Available include: ${options.join(', ')}`);\n\t}\n\n\treturn option;\n}\n\n/**\n * Returns a random number that is in the range of n bits.\n *\n * @param numberOfBits - The number of bits\n */\nfunction randomNBit(numberOfBits: number) {\n\treturn Math.floor(Math.random() * 2 ** numberOfBits);\n}\n\n/**\n * Manages the networking required to maintain a voice connection and dispatch audio packets\n */\nexport class Networking extends EventEmitter {\n\tprivate _state: NetworkingState;\n\n\t/**\n\t * The debug logger function, if debugging is enabled.\n\t */\n\tprivate readonly debug: ((message: string) => void) | null;\n\n\t/**\n\t * The options used to create this Networking instance.\n\t */\n\tprivate readonly options: NetworkingOptions;\n\n\t/**\n\t * Creates a new Networking instance.\n\t */\n\tpublic constructor(connectionOptions: ConnectionOptions, options: NetworkingOptions) {\n\t\tsuper();\n\n\t\tthis.onWsOpen = this.onWsOpen.bind(this);\n\t\tthis.onChildError = this.onChildError.bind(this);\n\t\tthis.onWsPacket = this.onWsPacket.bind(this);\n\t\tthis.onWsBinary = this.onWsBinary.bind(this);\n\t\tthis.onWsClose = this.onWsClose.bind(this);\n\t\tthis.onWsDebug = this.onWsDebug.bind(this);\n\t\tthis.onUdpDebug = this.onUdpDebug.bind(this);\n\t\tthis.onUdpClose = this.onUdpClose.bind(this);\n\t\tthis.onDaveDebug = this.onDaveDebug.bind(this);\n\t\tthis.onDaveKeyPackage = this.onDaveKeyPackage.bind(this);\n\t\tthis.onDaveInvalidateTransition = this.onDaveInvalidateTransition.bind(this);\n\n\t\tthis.debug = options?.debug ? (message: string) => this.emit('debug', message) : null;\n\n\t\tthis._state = {\n\t\t\tcode: NetworkingStatusCode.OpeningWs,\n\t\t\tws: this.createWebSocket(connectionOptions.endpoint),\n\t\t\tconnectionOptions,\n\t\t};\n\t\tthis.options = options;\n\t}\n\n\t/**\n\t * Destroys the Networking instance, transitioning it into the Closed state.\n\t */\n\tpublic destroy() {\n\t\tthis.state = {\n\t\t\tcode: NetworkingStatusCode.Closed,\n\t\t};\n\t}\n\n\t/**\n\t * The current state of the networking instance.\n\t *\n\t * @remarks\n\t * The setter will perform clean-up operations where necessary.\n\t */\n\tpublic get state(): NetworkingState {\n\t\treturn this._state;\n\t}\n\n\tpublic set state(newState: NetworkingState) {\n\t\tconst oldWs = Reflect.get(this._state, 'ws') as VoiceWebSocket | undefined;\n\t\tconst newWs = Reflect.get(newState, 'ws') as VoiceWebSocket | undefined;\n\t\tif (oldWs && oldWs !== newWs) {\n\t\t\t// The old WebSocket is being freed - remove all handlers from it\n\t\t\toldWs.off('debug', this.onWsDebug);\n\t\t\toldWs.on('error', noop);\n\t\t\toldWs.off('error', this.onChildError);\n\t\t\toldWs.off('open', this.onWsOpen);\n\t\t\toldWs.off('packet', this.onWsPacket);\n\t\t\toldWs.off('binary', this.onWsBinary);\n\t\t\toldWs.off('close', this.onWsClose);\n\t\t\toldWs.destroy();\n\t\t}\n\n\t\tconst oldUdp = Reflect.get(this._state, 'udp') as VoiceUDPSocket | undefined;\n\t\tconst newUdp = Reflect.get(newState, 'udp') as VoiceUDPSocket | undefined;\n\n\t\tif (oldUdp && oldUdp !== newUdp) {\n\t\t\toldUdp.on('error', noop);\n\t\t\toldUdp.off('error', this.onChildError);\n\t\t\toldUdp.off('close', this.onUdpClose);\n\t\t\toldUdp.off('debug', this.onUdpDebug);\n\t\t\toldUdp.destroy();\n\t\t}\n\n\t\tconst oldDave = Reflect.get(this._state, 'dave') as DAVESession | undefined;\n\t\tconst newDave = Reflect.get(newState, 'dave') as DAVESession | undefined;\n\n\t\tif (oldDave && oldDave !== newDave) {\n\t\t\toldDave.off('error', this.onChildError);\n\t\t\toldDave.off('debug', this.onDaveDebug);\n\t\t\toldDave.off('keyPackage', this.onDaveKeyPackage);\n\t\t\toldDave.off('invalidateTransition', this.onDaveInvalidateTransition);\n\t\t\toldDave.destroy();\n\t\t}\n\n\t\tconst oldState = this._state;\n\t\tthis._state = newState;\n\t\tthis.emit('stateChange', oldState, newState);\n\n\t\tthis.debug?.(`state change:\\nfrom ${stringifyState(oldState)}\\nto ${stringifyState(newState)}`);\n\t}\n\n\t/**\n\t * Creates a new WebSocket to a Discord Voice gateway.\n\t *\n\t * @param endpoint - The endpoint to connect to\n\t * @param lastSequence - The last sequence to set for this WebSocket\n\t */\n\tprivate createWebSocket(endpoint: string, lastSequence?: number) {\n\t\tconst ws = new VoiceWebSocket(`wss://${endpoint}?v=8`, Boolean(this.debug));\n\n\t\tif (lastSequence !== undefined) {\n\t\t\tws.sequence = lastSequence;\n\t\t}\n\n\t\tws.on('error', this.onChildError);\n\t\tws.once('open', this.onWsOpen);\n\t\tws.on('packet', this.onWsPacket);\n\t\tws.on('binary', this.onWsBinary);\n\t\tws.once('close', this.onWsClose);\n\t\tws.on('debug', this.onWsDebug);\n\n\t\treturn ws;\n\t}\n\n\t/**\n\t * Creates a new DAVE session for this voice connection if we can create one.\n\t *\n\t * @param protocolVersion - The protocol version to use\n\t */\n\tprivate createDaveSession(protocolVersion: number) {\n\t\tif (\n\t\t\tgetMaxProtocolVersion() === null ||\n\t\t\tthis.options.daveEncryption === false ||\n\t\t\t(this.state.code !== NetworkingStatusCode.SelectingProtocol &&\n\t\t\t\tthis.state.code !== NetworkingStatusCode.Ready &&\n\t\t\t\tthis.state.code !== NetworkingStatusCode.Resuming)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst session = new DAVESession(\n\t\t\tprotocolVersion,\n\t\t\tthis.state.connectionOptions.userId,\n\t\t\tthis.state.connectionOptions.channelId,\n\t\t\t{\n\t\t\t\tdecryptionFailureTolerance: this.options.decryptionFailureTolerance,\n\t\t\t},\n\t\t);\n\n\t\tsession.on('error', this.onChildError);\n\t\tsession.on('debug', this.onDaveDebug);\n\t\tsession.on('keyPackage', this.onDaveKeyPackage);\n\t\tsession.on('invalidateTransition', this.onDaveInvalidateTransition);\n\t\tsession.reinit();\n\n\t\treturn session;\n\t}\n\n\t/**\n\t * Propagates errors from the children VoiceWebSocket, VoiceUDPSocket and DAVESession.\n\t *\n\t * @param error - The error that was emitted by a child\n\t */\n\tprivate onChildError(error: Error) {\n\t\tthis.emit('error', error);\n\t}\n\n\t/**\n\t * Called when the WebSocket opens. Depending on the state that the instance is in,\n\t * it will either identify with a new session, or it will attempt to resume an existing session.\n\t */\n\tprivate onWsOpen() {\n\t\tif (this.state.code === NetworkingStatusCode.OpeningWs) {\n\t\t\tthis.state.ws.sendPacket({\n\t\t\t\top: VoiceOpcodes.Identify,\n\t\t\t\td: {\n\t\t\t\t\tserver_id: this.state.connectionOptions.serverId,\n\t\t\t\t\tuser_id: this.state.connectionOptions.userId,\n\t\t\t\t\tsession_id: this.state.connectionOptions.sessionId,\n\t\t\t\t\ttoken: this.state.connectionOptions.token,\n\t\t\t\t\tmax_dave_protocol_version: this.options.daveEncryption === false ? 0 : (getMaxProtocolVersion() ?? 0),\n\t\t\t\t},\n\t\t\t});\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Identifying,\n\t\t\t};\n\t\t} else if (this.state.code === NetworkingStatusCode.Resuming) {\n\t\t\tthis.state.ws.sendPacket({\n\t\t\t\top: VoiceOpcodes.Resume,\n\t\t\t\td: {\n\t\t\t\t\tserver_id: this.state.connectionOptions.serverId,\n\t\t\t\t\tsession_id: this.state.connectionOptions.sessionId,\n\t\t\t\t\ttoken: this.state.connectionOptions.token,\n\t\t\t\t\tseq_ack: this.state.ws.sequence,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Called when the WebSocket closes. Based on the reason for closing (given by the code parameter),\n\t * the instance will either attempt to resume, or enter the closed state and emit a 'close' event\n\t * with the close code, allowing the user to decide whether or not they would like to reconnect.\n\t *\n\t * @param code - The close code\n\t */\n\tprivate onWsClose({ code }: CloseEvent) {\n\t\tconst canResume = code === 4_015 || code < 4_000;\n\t\tif (canResume && this.state.code === NetworkingStatusCode.Ready) {\n\t\t\tconst lastSequence = this.state.ws.sequence;\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Resuming,\n\t\t\t\tws: this.createWebSocket(this.state.connectionOptions.endpoint, lastSequence),\n\t\t\t};\n\t\t} else if (this.state.code !== NetworkingStatusCode.Closed) {\n\t\t\tthis.destroy();\n\t\t\tthis.emit('close', code);\n\t\t}\n\t}\n\n\t/**\n\t * Called when the UDP socket has closed itself if it has stopped receiving replies from Discord.\n\t */\n\tprivate onUdpClose() {\n\t\tif (this.state.code === NetworkingStatusCode.Ready) {\n\t\t\tconst lastSequence = this.state.ws.sequence;\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Resuming,\n\t\t\t\tws: this.createWebSocket(this.state.connectionOptions.endpoint, lastSequence),\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Called when a packet is received on the connection's WebSocket.\n\t *\n\t * @param packet - The received packet\n\t */\n\tprivate onWsPacket(packet: VoiceReceivePayload) {\n\t\tif (packet.op === VoiceOpcodes.Hello && this.state.code !== NetworkingStatusCode.Closed) {\n\t\t\tthis.state.ws.setHeartbeatInterval(packet.d.heartbeat_interval);\n\t\t} else if (packet.op === VoiceOpcodes.Ready && this.state.code === NetworkingStatusCode.Identifying) {\n\t\t\tconst { ip, port, ssrc, modes } = packet.d;\n\n\t\t\tconst udp = new VoiceUDPSocket({ ip, port });\n\t\t\tudp.on('error', this.onChildError);\n\t\t\tudp.on('debug', this.onUdpDebug);\n\t\t\tudp.once('close', this.onUdpClose);\n\t\t\tudp\n\t\t\t\t.performIPDiscovery(ssrc)\n\t\t\t\t// eslint-disable-next-line promise/prefer-await-to-then\n\t\t\t\t.then((localConfig) => {\n\t\t\t\t\tif (this.state.code !== NetworkingStatusCode.UdpHandshaking) return;\n\t\t\t\t\tthis.state.ws.sendPacket({\n\t\t\t\t\t\top: VoiceOpcodes.SelectProtocol,\n\t\t\t\t\t\td: {\n\t\t\t\t\t\t\tprotocol: 'udp',\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\taddress: localConfig.ip,\n\t\t\t\t\t\t\t\tport: localConfig.port,\n\t\t\t\t\t\t\t\tmode: chooseEncryptionMode(modes),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\tthis.state = {\n\t\t\t\t\t\t...this.state,\n\t\t\t\t\t\tcode: NetworkingStatusCode.SelectingProtocol,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t// eslint-disable-next-line promise/prefer-await-to-then, promise/prefer-await-to-callbacks\n\t\t\t\t.catch((error: Error) => this.emit('error', error));\n\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.UdpHandshaking,\n\t\t\t\tudp,\n\t\t\t\tconnectionData: {\n\t\t\t\t\tssrc,\n\t\t\t\t\tconnectedClients: new Set(),\n\t\t\t\t},\n\t\t\t};\n\t\t} else if (\n\t\t\tpacket.op === VoiceOpcodes.SessionDescription &&\n\t\t\tthis.state.code === NetworkingStatusCode.SelectingProtocol\n\t\t) {\n\t\t\tconst { mode: encryptionMode, secret_key: secretKey, dave_protocol_version: daveProtocolVersion } = packet.d;\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Ready,\n\t\t\t\tdave: this.createDaveSession(daveProtocolVersion),\n\t\t\t\tconnectionData: {\n\t\t\t\t\t...this.state.connectionData,\n\t\t\t\t\tencryptionMode,\n\t\t\t\t\tsecretKey: new Uint8Array(secretKey),\n\t\t\t\t\tsequence: randomNBit(16),\n\t\t\t\t\ttimestamp: randomNBit(32),\n\t\t\t\t\tnonce: 0,\n\t\t\t\t\tnonceBuffer: encryptionMode === 'aead_aes256_gcm_rtpsize' ? Buffer.alloc(12) : Buffer.alloc(24),\n\t\t\t\t\tspeaking: false,\n\t\t\t\t\tpacketsPlayed: 0,\n\t\t\t\t},\n\t\t\t};\n\t\t} else if (packet.op === VoiceOpcodes.Resumed && this.state.code === NetworkingStatusCode.Resuming) {\n\t\t\tthis.state = {\n\t\t\t\t...this.state,\n\t\t\t\tcode: NetworkingStatusCode.Ready,\n\t\t\t};\n\t\t\tthis.state.connectionData.speaking = false;\n\t\t} else if (\n\t\t\t(packet.op === VoiceOpcodes.ClientsConnect || packet.op === VoiceOpcodes.ClientDisconnect) &&\n\t\t\t(this.state.code === NetworkingStatusCode.Ready ||\n\t\t\t\tthis.state.code === NetworkingStatusCode.UdpHandshaking ||\n\t\t\t\tthis.state.code === NetworkingStatusCode.SelectingProtocol ||\n\t\t\t\tthis.state.code === NetworkingStatusCode.Resuming)\n\t\t) {\n\t\t\tconst { connectionData } = this.state;\n\t\t\tif (packet.op === VoiceOpcodes.ClientsConnect)\n\t\t\t\tfor (const id of packet.d.user_ids) connectionData.connectedClients.add(id);\n\t\t\telse {\n\t\t\t\tconnectionData.connectedClients.delete(packet.d.user_id);\n\t\t\t}\n\t\t} else if (\n\t\t\t(this.state.code === NetworkingStatusCode.Ready || this.state.code === NetworkingStatusCode.Resuming) &&\n\t\t\tthis.state.dave\n\t\t) {\n\t\t\tif (packet.op === VoiceOpcodes.DavePrepareTransition) {\n\t\t\t\tconst sendReady = this.state.dave.prepareTransition(packet.d);\n\t\t\t\tif (sendReady)\n\t\t\t\t\tthis.state.ws.sendPacket({\n\t\t\t\t\t\top: VoiceOpcodes.DaveTransitionReady,\n\t\t\t\t\t\td: { transition_id: packet.d.transition_id },\n\t\t\t\t\t});\n\t\t\t\tif (packet.d.transition_id === 0) {\n\t\t\t\t\tthis.emit('transitioned', 0);\n\t\t\t\t}\n\t\t\t} else if (packet.op === VoiceOpcodes.DaveExecuteTransition) {\n\t\t\t\tconst transitioned = this.state.dave.executeTransition(packet.d.transition_id);\n\t\t\t\tif (transitioned) this.emit('transitioned', packet.d.transition_id);\n\t\t\t} else if (packet.op === VoiceOpcodes.DavePrepareEpoch) this.state.dave.prepareEpoch(packet.d);\n\t\t}\n\t}\n\n\t/**\n\t * Called when a binary message is received on the connection's WebSocket.\n\t *\n\t * @param message - The received message\n\t */\n\tprivate onWsBinary(message: BinaryWebSocketMessage) {\n\t\tif (this.state.code === NetworkingStatusCode.Ready && this.state.dave) {\n\t\t\tif (message.op === VoiceOpcodes.DaveMlsExternalSender) {\n\t\t\t\tthis.state.dave.setExternalSender(message.payload);\n\t\t\t} else if (message.op === VoiceOpcodes.DaveMlsProposals) {\n\t\t\t\tconst payload = this.state.dave.processProposals(message.payload, this.state.connectionData.connectedClients);\n\t\t\t\tif (payload) this.state.ws.sendBinaryMessage(VoiceOpcodes.DaveMlsCommitWelcome, payload);\n\t\t\t} else if (message.op === VoiceOpcodes.DaveMlsAnnounceCommitTransition) {\n\t\t\t\tconst { transitionId, success } = this.state.dave.processCommit(message.payload);\n\t\t\t\tif (success) {\n\t\t\t\t\tif (transitionId === 0) this.emit('transitioned', transitionId);\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.state.ws.sendPacket({\n\t\t\t\t\t\t\top: VoiceOpcodes.DaveTransitionReady,\n\t\t\t\t\t\t\td: { transition_id: transitionId },\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else if (message.op === VoiceOpcodes.DaveMlsWelcome) {\n\t\t\t\tconst { transitionId, success } = this.state.dave.processWelcome(message.payload);\n\t\t\t\tif (success) {\n\t\t\t\t\tif (transitionId === 0) this.emit('transitioned', transitionId);\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.state.ws.sendPacket({\n\t\t\t\t\t\t\top: VoiceOpcodes.DaveTransitionReady,\n\t\t\t\t\t\t\td: { transition_id: transitionId },\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Called when a new key package is ready to be sent to the voice server.\n\t *\n\t * @param keyPackage - The new key package\n\t */\n\tprivate onDaveKeyPackage(keyPackage: Buffer) {\n\t\tif (this.state.code === NetworkingStatusCode.SelectingProtocol || this.state.code === NetworkingStatusCode.Ready)\n\t\t\tthis.state.ws.sendBinaryMessage(VoiceOpcodes.DaveMlsKeyPackage, keyPackage);\n\t}\n\n\t/**\n\t * Called when the DAVE session wants to invalidate their transition and re-initialize.\n\t *\n\t * @param transitionId - The transition to invalidate\n\t */\n\tprivate onDaveInvalidateTransition(transitionId: number) {\n\t\tif (this.state.code === NetworkingStatusCode.SelectingProtocol || this.state.code === NetworkingStatusCode.Ready)\n\t\t\tthis.state.ws.sendPacket({\n\t\t\t\top: VoiceOpcodes.DaveMlsInvalidCommitWelcome,\n\t\t\t\td: { transition_id: transitionId },\n\t\t\t});\n\t}\n\n\t/**\n\t * Propagates debug messages from the child WebSocket.\n\t *\n\t * @param message - The emitted debug message\n\t */\n\tprivate onWsDebug(message: string) {\n\t\tthis.debug?.(`[WS] ${message}`);\n\t}\n\n\t/**\n\t * Propagates debug messages from the child UDPSocket.\n\t *\n\t * @param message - The emitted debug message\n\t */\n\tprivate onUdpDebug(message: string) {\n\t\tthis.debug?.(`[UDP] ${message}`);\n\t}\n\n\t/**\n\t * Propagates debug messages from the child DAVESession.\n\t *\n\t * @param message - The emitted debug message\n\t */\n\tprivate onDaveDebug(message: string) {\n\t\tthis.debug?.(`[DAVE] ${message}`);\n\t}\n\n\t/**\n\t * Prepares an Opus packet for playback. This includes attaching metadata to it and encrypting it.\n\t * It will be stored within the instance, and can be played by dispatchAudio()\n\t *\n\t * @remarks\n\t * Calling this method while there is already a prepared audio packet that has not yet been dispatched\n\t * will overwrite the existing audio packet. This should be avoided.\n\t * @param opusPacket - The Opus packet to encrypt\n\t * @returns The audio packet that was prepared\n\t */\n\tpublic prepareAudioPacket(opusPacket: Buffer) {\n\t\tconst state = this.state;\n\t\tif (state.code !== NetworkingStatusCode.Ready) return;\n\t\tstate.preparedPacket = this.createAudioPacket(opusPacket, state.connectionData, state.dave);\n\t\treturn state.preparedPacket;\n\t}\n\n\t/**\n\t * Dispatches the audio packet previously prepared by prepareAudioPacket(opusPacket). The audio packet\n\t * is consumed and cannot be dispatched again.\n\t */\n\tpublic dispatchAudio() {\n\t\tconst state = this.state;\n\t\tif (state.code !== NetworkingStatusCode.Ready) return false;\n\t\tif (state.preparedPacket !== undefined) {\n\t\t\tthis.playAudioPacket(state.preparedPacket);\n\t\t\tstate.preparedPacket = undefined;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Plays an audio packet, updating timing metadata used for playback.\n\t *\n\t * @param audioPacket - The audio packet to play\n\t */\n\tprivate playAudioPacket(audioPacket: Buffer) {\n\t\tconst state = this.state;\n\t\tif (state.code !== NetworkingStatusCode.Ready) return;\n\t\tconst { connectionData } = state;\n\t\tconnectionData.packetsPlayed++;\n\t\tconnectionData.sequence++;\n\t\tconnectionData.timestamp += TIMESTAMP_INC;\n\t\tif (connectionData.sequence >= 2 ** 16) connectionData.sequence = 0;\n\t\tif (connectionData.timestamp >= 2 ** 32) connectionData.timestamp = 0;\n\t\tthis.setSpeaking(true);\n\t\tstate.udp.send(audioPacket);\n\t}\n\n\t/**\n\t * Sends a packet to the voice gateway indicating that the client has start/stopped sending\n\t * audio.\n\t *\n\t * @param speaking - Whether or not the client should be shown as speaking\n\t */\n\tpublic setSpeaking(speaking: boolean) {\n\t\tconst state = this.state;\n\t\tif (state.code !== NetworkingStatusCode.Ready) return;\n\t\tif (state.connectionData.speaking === speaking) return;\n\t\tstate.connectionData.speaking = speaking;\n\t\tstate.ws.sendPacket({\n\t\t\top: VoiceOpcodes.Speaking,\n\t\t\td: {\n\t\t\t\tspeaking: (speaking ? 1 : 0) as VoiceSpeakingFlags,\n\t\t\t\tdelay: 0,\n\t\t\t\tssrc: state.connectionData.ssrc,\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Creates a new audio packet from an Opus packet. This involves encrypting the packet,\n\t * then prepending a header that includes metadata.\n\t *\n\t * @param opusPacket - The Opus packet to prepare\n\t * @param connectionData - The current connection data of the instance\n\t * @param daveSession - The DAVE session to use for encryption\n\t */\n\tprivate createAudioPacket(opusPacket: Buffer, connectionData: ConnectionData, daveSession?: DAVESession) {\n\t\tconst rtpHeader = Buffer.alloc(12);\n\t\trtpHeader[0] = 0x80;\n\t\trtpHeader[1] = 0x78;\n\n\t\tconst { sequence, timestamp, ssrc } = connectionData;\n\n\t\trtpHeader.writeUIntBE(sequence, 2, 2);\n\t\trtpHeader.writeUIntBE(timestamp, 4, 4);\n\t\trtpHeader.writeUIntBE(ssrc, 8, 4);\n\n\t\trtpHeader.copy(nonce, 0, 0, 12);\n\t\treturn Buffer.concat([rtpHeader, ...this.encryptOpusPacket(opusPacket, connectionData, rtpHeader, daveSession)]);\n\t}\n\n\t/**\n\t * Encrypts an Opus packet using the format agreed upon by the instance and Discord.\n\t *\n\t * @param opusPacket - The Opus packet to encrypt\n\t * @param connectionData - The current connection data of the instance\n\t * @param daveSession - The DAVE session to use for encryption\n\t */\n\tprivate encryptOpusPacket(\n\t\topusPacket: Buffer,\n\t\tconnectionData: ConnectionData,\n\t\tadditionalData: Buffer,\n\t\tdaveSession?: DAVESession,\n\t) {\n\t\tconst { secretKey, encryptionMode } = connectionData;\n\n\t\tconst packet = daveSession?.encrypt(opusPacket) ?? opusPacket;\n\n\t\t// Both supported encryption methods want the nonce to be an incremental integer\n\t\tconnectionData.nonce++;\n\t\tif (connectionData.nonce > MAX_NONCE_SIZE) connectionData.nonce = 0;\n\t\tconnectionData.nonceBuffer.writeUInt32BE(connectionData.nonce, 0);\n\n\t\t// 4 extra bytes of padding on the end of the encrypted packet\n\t\tconst noncePadding = connectionData.nonceBuffer.subarray(0, 4);\n\n\t\tlet encrypted;\n\t\tswitch (encryptionMode) {\n\t\t\tcase 'aead_aes256_gcm_rtpsize': {\n\t\t\t\tconst cipher = crypto.createCipheriv('aes-256-gcm', secretKey, connectionData.nonceBuffer);\n\t\t\t\tcipher.setAAD(additionalData);\n\n\t\t\t\tencrypted = Buffer.concat([cipher.update(packet), cipher.final(), cipher.getAuthTag()]);\n\n\t\t\t\treturn [encrypted, noncePadding];\n\t\t\t}\n\n\t\t\tcase 'aead_xchacha20_poly1305_rtpsize': {\n\t\t\t\tencrypted = secretbox.methods.crypto_aead_xchacha20poly1305_ietf_encrypt(\n\t\t\t\t\tpacket,\n\t\t\t\t\tadditionalData,\n\t\t\t\t\tconnectionData.nonceBuffer,\n\t\t\t\t\tsecretKey,\n\t\t\t\t);\n\n\t\t\t\treturn [encrypted, noncePadding];\n\t\t\t}\n\n\t\t\tdefault: {\n\t\t\t\t// This should never happen. Our encryption mode is chosen from a list given to us by the gateway and checked with the ones we support.\n\t\t\t\tthrow new RangeError(`Unsupported encryption method: ${encryptionMode}`);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Buffer } from 'node:buffer';\n\ninterface Methods {\n\tcrypto_aead_xchacha20poly1305_ietf_decrypt(\n\t\tcipherText: Buffer,\n\t\tadditionalData: Buffer,\n\t\tnonce: Buffer,\n\t\tkey: ArrayBufferLike,\n\t): Buffer;\n\tcrypto_aead_xchacha20poly1305_ietf_encrypt(\n\t\tplaintext: Buffer,\n\t\tadditionalData: Buffer,\n\t\tnonce: Buffer,\n\t\tkey: ArrayBufferLike,\n\t): Buffer;\n}\n\nconst libs = {\n\t'sodium-native': (sodium: any): Methods => ({\n\t\tcrypto_aead_xchacha20poly1305_ietf_decrypt: (\n\t\t\tcipherText: Buffer,\n\t\t\tadditionalData: Buffer,\n\t\t\tnonce: Buffer,\n\t\t\tkey: ArrayBufferLike,\n\t\t) => {\n\t\t\tconst message = Buffer.alloc(cipherText.length - sodium.crypto_aead_xchacha20poly1305_ietf_ABYTES);\n\t\t\tsodium.crypto_aead_xchacha20poly1305_ietf_decrypt(message, null, cipherText, additionalData, nonce, key);\n\t\t\treturn message;\n\t\t},\n\t\tcrypto_aead_xchacha20poly1305_ietf_encrypt: (\n\t\t\tplaintext: Buffer,\n\t\t\tadditionalData: Buffer,\n\t\t\tnonce: Buffer,\n\t\t\tkey: ArrayBufferLike,\n\t\t) => {\n\t\t\tconst cipherText = Buffer.alloc(plaintext.length + sodium.crypto_aead_xchacha20poly1305_ietf_ABYTES);\n\t\t\tsodium.crypto_aead_xchacha20poly1305_ietf_encrypt(cipherText, plaintext, additionalData, null, nonce, key);\n\t\t\treturn cipherText;\n\t\t},\n\t}),\n\tsodium: (sodium: any): Methods => ({\n\t\tcrypto_aead_xchacha20poly1305_ietf_decrypt: (\n\t\t\tcipherText: Buffer,\n\t\t\tadditionalData: Buffer,\n\t\t\tnonce: Buffer,\n\t\t\tkey: ArrayBufferLike,\n\t\t) => sodium.api.crypto_aead_xchacha20poly1305_ietf_decrypt(cipherText, additionalData, null, nonce, key),\n\t\tcrypto_aead_xchacha20poly1305_ietf_encrypt: (\n\t\t\tplaintext: Buffer,\n\t\t\tadditionalData: Buffer,\n\t\t\tnonce: Buffer,\n\t\t\tkey: ArrayBufferLike,\n\t\t) => sodium.api.crypto_aead_xchacha20poly1305_ietf_encrypt(plaintext, additionalData, null, nonce, key),\n\t}),\n\t'libsodium-wrappers': (sodium: any): Methods => ({\n\t\tcrypto_aead_xchacha20poly1305_ietf_decrypt: (\n\t\t\tcipherText: Buffer,\n\t\t\tadditionalData: Buffer,\n\t\t\tnonce: Buffer,\n\t\t\tkey: ArrayBufferLike,\n\t\t) => sodium.crypto_aead_xchacha20poly1305_ietf_decrypt(null, cipherText, additionalData, nonce, key),\n\t\tcrypto_aead_xchacha20poly1305_ietf_encrypt: (\n\t\t\tplaintext: Buffer,\n\t\t\tadditionalData: Buffer,\n\t\t\tnonce: Buffer,\n\t\t\tkey: ArrayBufferLike,\n\t\t) => sodium.crypto_aead_xchacha20poly1305_ietf_encrypt(plaintext, additionalData, null, nonce, key),\n\t}),\n\t'@stablelib/xchacha20poly1305': (stablelib: any): Methods => ({\n\t\tcrypto_aead_xchacha20poly1305_ietf_decrypt(plaintext, additionalData, nonce, key) {\n\t\t\tconst crypto = new stablelib.XChaCha20Poly1305(key);\n\t\t\treturn crypto.open(nonce, plaintext, additionalData);\n\t\t},\n\t\tcrypto_aead_xchacha20poly1305_ietf_encrypt(cipherText, additionalData, nonce, key) {\n\t\t\tconst crypto = new stablelib.XChaCha20Poly1305(key);\n\t\t\treturn crypto.seal(nonce, cipherText, additionalData);\n\t\t},\n\t}),\n\t'@noble/ciphers/chacha': (noble: any): Methods => ({\n\t\tcrypto_aead_xchacha20poly1305_ietf_decrypt(cipherText, additionalData, nonce, key) {\n\t\t\tconst chacha = noble.xchacha20poly1305(key, nonce, additionalData);\n\t\t\treturn chacha.decrypt(cipherText);\n\t\t},\n\t\tcrypto_aead_xchacha20poly1305_ietf_encrypt(plaintext, additionalData, nonce, key) {\n\t\t\tconst chacha = noble.xchacha20poly1305(key, nonce, additionalData);\n\t\t\treturn chacha.encrypt(plaintext);\n\t\t},\n\t}),\n} as const;\n\nconst fallbackError = () => {\n\tthrow new Error(\n\t\t`Cannot play audio as no valid encryption package is installed.\n- Install one of:\n - sodium\n - libsodium-wrappers\n - @stablelib/xchacha20poly1305\n - @noble/ciphers.\n- Use the generateDependencyReport() function for more information.\\n`,\n\t);\n};\n\nconst methods: Methods = {\n\tcrypto_aead_xchacha20poly1305_ietf_encrypt: fallbackError,\n\tcrypto_aead_xchacha20poly1305_ietf_decrypt: fallbackError,\n};\n\n// eslint-disable-next-line no-async-promise-executor\nexport const secretboxLoadPromise = new Promise(async (resolve) => {\n\tfor (const libName of Object.keys(libs) as (keyof typeof libs)[]) {\n\t\ttry {\n\t\t\tconst lib = await import(libName);\n\n\t\t\tif (libName === 'libsodium-wrappers' && lib.ready) {\n\t\t\t\tawait lib.ready;\n\t\t\t}\n\n\t\t\tObject.assign(methods, libs[libName](lib));\n\n\t\t\tbreak;\n\t\t} catch {}\n\t}\n\n\tresolve();\n});\n\nexport { methods };\n","export const noop = () => {};\n","import { Buffer } from 'node:buffer';\nimport { EventEmitter } from 'node:events';\nimport type { VoiceDavePrepareEpochData, VoiceDavePrepareTransitionData } from 'discord-api-types/voice/v8';\nimport { SILENCE_FRAME } from '../audio/AudioPlayer';\n\ninterface SessionMethods {\n\tcanPassthrough(userId: string): boolean;\n\tdecrypt(userId: string, mediaType: 0 | 1, packet: Buffer): Buffer;\n\tencryptOpus(packet: Buffer): Buffer;\n\tgetSerializedKeyPackage(): Buffer;\n\tgetVerificationCode(userId: string): Promise;\n\tprocessCommit(commit: Buffer): void;\n\tprocessProposals(optype: 0 | 1, proposals: Buffer, recognizedUserIds?: string[]): ProposalsResult;\n\tprocessWelcome(welcome: Buffer): void;\n\tready: boolean;\n\treinit(protocolVersion: number, userId: string, channelId: string): void;\n\treset(): void;\n\tsetExternalSender(externalSender: Buffer): void;\n\tsetPassthroughMode(passthrough: boolean, expiry: number): void;\n\tvoicePrivacyCode: string;\n}\n\ninterface ProposalsResult {\n\tcommit?: Buffer;\n\twelcome?: Buffer;\n}\n\nlet Davey: any = null;\n\n/**\n * The amount of seconds that a previous transition should be valid for.\n */\nconst TRANSITION_EXPIRY = 10;\n\n/**\n * The arbitrary amount of seconds to allow passthrough for mid-downgrade.\n * Generally, transitions last about 3 seconds maximum, but this should cover for when connections are delayed.\n */\nconst TRANSITION_EXPIRY_PENDING_DOWNGRADE = 24;\n\n/**\n * The amount of packets to allow decryption failure for until we deem the transition bad and re-initialize.\n * Usually 4 packets on a good connection may slip past when entering a new session.\n * After re-initializing, 5-24 packets may fail to decrypt after.\n */\nexport const DEFAULT_DECRYPTION_FAILURE_TOLERANCE = 36;\n\n// eslint-disable-next-line no-async-promise-executor\nexport const daveLoadPromise = new Promise(async (resolve) => {\n\ttry {\n\t\tconst lib = await import('@snazzah/davey');\n\t\tDavey = lib;\n\t} catch {}\n\n\tresolve();\n});\n\ninterface TransitionResult {\n\tsuccess: boolean;\n\ttransitionId: number;\n}\n/**\n * Options that dictate the session behavior.\n */\nexport interface DAVESessionOptions {\n\tdecryptionFailureTolerance?: number | undefined;\n}\n\n/**\n * The maximum DAVE protocol version supported.\n */\nexport function getMaxProtocolVersion(): number | null {\n\treturn Davey?.DAVE_PROTOCOL_VERSION;\n}\n\nexport interface DAVESession extends EventEmitter {\n\ton(event: 'error', listener: (error: Error) => void): this;\n\ton(event: 'debug', listener: (message: string) => void): this;\n\ton(event: 'keyPackage', listener: (message: Buffer) => void): this;\n\ton(event: 'invalidateTransition', listener: (transitionId: number) => void): this;\n}\n\n/**\n * Manages the DAVE protocol group session.\n */\nexport class DAVESession extends EventEmitter {\n\t/**\n\t * The channel id represented by this session.\n\t */\n\tpublic channelId: string;\n\n\t/**\n\t * The user id represented by this session.\n\t */\n\tpublic userId: string;\n\n\t/**\n\t * The protocol version being used.\n\t */\n\tpublic protocolVersion: number;\n\n\t/**\n\t * The last transition id executed.\n\t */\n\tpublic lastTransitionId?: number | undefined;\n\n\t/**\n\t * The pending transition.\n\t */\n\tprivate pendingTransition?: VoiceDavePrepareTransitionData | undefined;\n\n\t/**\n\t * Whether this session was downgraded previously.\n\t */\n\tprivate downgraded = false;\n\n\t/**\n\t * The amount of consecutive failures encountered when decrypting.\n\t */\n\tprivate consecutiveFailures = 0;\n\n\t/**\n\t * The amount of consecutive failures needed to attempt to recover.\n\t */\n\tprivate readonly failureTolerance: number;\n\n\t/**\n\t * Whether this session is currently re-initializing due to an invalid transition.\n\t */\n\tpublic reinitializing = false;\n\n\t/**\n\t * The underlying DAVE Session of this wrapper.\n\t */\n\tpublic session: SessionMethods | undefined;\n\n\tpublic constructor(protocolVersion: number, userId: string, channelId: string, options: DAVESessionOptions) {\n\t\tif (Davey === null)\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot utilize the DAVE protocol as the @snazzah/davey package has not been installed.\n- Use the generateDependencyReport() function for more information.\\n`,\n\t\t\t);\n\n\t\tsuper();\n\n\t\tthis.protocolVersion = protocolVersion;\n\t\tthis.userId = userId;\n\t\tthis.channelId = channelId;\n\t\tthis.failureTolerance = options.decryptionFailureTolerance ?? DEFAULT_DECRYPTION_FAILURE_TOLERANCE;\n\t}\n\n\t/**\n\t * The current voice privacy code of the session. Will be `null` if there is no session.\n\t */\n\tpublic get voicePrivacyCode(): string | null {\n\t\tif (this.protocolVersion === 0 || !this.session?.voicePrivacyCode) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.session.voicePrivacyCode;\n\t}\n\n\t/**\n\t * Gets the verification code for a user in the session.\n\t *\n\t * @throws Will throw if there is not an active session or the user id provided is invalid or not in the session.\n\t */\n\tpublic async getVerificationCode(userId: string): Promise {\n\t\tif (!this.session) throw new Error('Session not available');\n\t\treturn this.session.getVerificationCode(userId);\n\t}\n\n\t/**\n\t * Re-initializes (or initializes) the underlying session.\n\t */\n\tpublic reinit() {\n\t\tif (this.protocolVersion > 0) {\n\t\t\tif (this.session) {\n\t\t\t\tthis.session.reinit(this.protocolVersion, this.userId, this.channelId);\n\t\t\t\tthis.emit('debug', `Session reinitialized for protocol version ${this.protocolVersion}`);\n\t\t\t} else {\n\t\t\t\tthis.session = new Davey.DAVESession(this.protocolVersion, this.userId, this.channelId);\n\t\t\t\tthis.emit('debug', `Session initialized for protocol version ${this.protocolVersion}`);\n\t\t\t}\n\n\t\t\tthis.emit('keyPackage', this.session!.getSerializedKeyPackage());\n\t\t} else if (this.session) {\n\t\t\tthis.session.reset();\n\t\t\tthis.session.setPassthroughMode(true, TRANSITION_EXPIRY);\n\t\t\tthis.emit('debug', 'Session reset');\n\t\t}\n\t}\n\n\t/**\n\t * Set the external sender for this session.\n\t *\n\t * @param externalSender - The external sender\n\t */\n\tpublic setExternalSender(externalSender: Buffer) {\n\t\tif (!this.session) throw new Error('No session available');\n\t\tthis.session.setExternalSender(externalSender);\n\t\tthis.emit('debug', 'Set MLS external sender');\n\t}\n\n\t/**\n\t * Prepare for a transition.\n\t *\n\t * @param data - The transition data\n\t * @returns Whether we should signal to the voice server that we are ready\n\t */\n\tpublic prepareTransition(data: VoiceDavePrepareTransitionData) {\n\t\tthis.emit('debug', `Preparing for transition (${data.transition_id}, v${data.protocol_version})`);\n\t\tthis.pendingTransition = data;\n\n\t\t// When the included transition id is 0, the transition is for (re)initialization and it can be executed immediately.\n\t\tif (data.transition_id === 0) {\n\t\t\tthis.executeTransition(data.transition_id);\n\t\t} else {\n\t\t\tif (data.protocol_version === 0) this.session?.setPassthroughMode(true, TRANSITION_EXPIRY_PENDING_DOWNGRADE);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Execute a transition.\n\t *\n\t * @param transitionId - The transition id to execute on\n\t */\n\tpublic executeTransition(transitionId: number) {\n\t\tthis.emit('debug', `Executing transition (${transitionId})`);\n\t\tif (!this.pendingTransition) {\n\t\t\tthis.emit('debug', `Received execute transition, but we don't have a pending transition for ${transitionId}`);\n\t\t\treturn;\n\t\t}\n\n\t\tlet transitioned = false;\n\t\tif (transitionId === this.pendingTransition.transition_id) {\n\t\t\tconst oldVersion = this.protocolVersion;\n\t\t\tthis.protocolVersion = this.pendingTransition.protocol_version;\n\n\t\t\t// Handle upgrades & defer downgrades\n\t\t\tif (oldVersion !== this.protocolVersion && this.protocolVersion === 0) {\n\t\t\t\tthis.downgraded = true;\n\t\t\t\tthis.emit('debug', 'Session downgraded');\n\t\t\t} else if (transitionId > 0 && this.downgraded) {\n\t\t\t\tthis.downgraded = false;\n\t\t\t\tthis.session?.setPassthroughMode(true, TRANSITION_EXPIRY);\n\t\t\t\tthis.emit('debug', 'Session upgraded');\n\t\t\t}\n\n\t\t\t// In the future we'd want to signal to the DAVESession to transition also, but it only supports v1 at this time\n\t\t\ttransitioned = true;\n\t\t\tthis.reinitializing = false;\n\t\t\tthis.lastTransitionId = transitionId;\n\t\t\tthis.emit('debug', `Transition executed (v${oldVersion} -> v${this.protocolVersion}, id: ${transitionId})`);\n\t\t} else {\n\t\t\tthis.emit(\n\t\t\t\t'debug',\n\t\t\t\t`Received execute transition for an unexpected transition id (expected: ${this.pendingTransition.transition_id}, actual: ${transitionId})`,\n\t\t\t);\n\t\t}\n\n\t\tthis.pendingTransition = undefined;\n\t\treturn transitioned;\n\t}\n\n\t/**\n\t * Prepare for a new epoch.\n\t *\n\t * @param data - The epoch data\n\t */\n\tpublic prepareEpoch(data: VoiceDavePrepareEpochData) {\n\t\tthis.emit('debug', `Preparing for epoch (${data.epoch})`);\n\t\tif (data.epoch === 1) {\n\t\t\tthis.protocolVersion = data.protocol_version;\n\t\t\tthis.reinit();\n\t\t}\n\t}\n\n\t/**\n\t * Recover from an invalid transition by re-initializing.\n\t *\n\t * @param transitionId - The transition id to invalidate\n\t */\n\tpublic recoverFromInvalidTransition(transitionId: number) {\n\t\tif (this.reinitializing) return;\n\t\tthis.emit('debug', `Invalidating transition ${transitionId}`);\n\t\tthis.reinitializing = true;\n\t\tthis.consecutiveFailures = 0;\n\t\tthis.emit('invalidateTransition', transitionId);\n\t\tthis.reinit();\n\t}\n\n\t/**\n\t * Processes proposals from the MLS group.\n\t *\n\t * @param payload - The binary message payload\n\t * @param connectedClients - The set of connected client IDs\n\t * @returns The payload to send back to the voice server, if there is one\n\t */\n\tpublic processProposals(payload: Buffer, connectedClients: Set): Buffer | undefined {\n\t\tif (!this.session) throw new Error('No session available');\n\t\tconst optype = payload.readUInt8(0) as 0 | 1;\n\t\tconst { commit, welcome } = this.session.processProposals(\n\t\t\toptype,\n\t\t\tpayload.subarray(1),\n\t\t\tArray.from(connectedClients),\n\t\t);\n\t\tthis.emit('debug', 'MLS proposals processed');\n\t\tif (!commit) return;\n\t\treturn welcome ? Buffer.concat([commit, welcome]) : commit;\n\t}\n\n\t/**\n\t * Processes a commit from the MLS group.\n\t *\n\t * @param payload - The payload\n\t * @returns The transaction id and whether it was successful\n\t */\n\tpublic processCommit(payload: Buffer): TransitionResult {\n\t\tif (!this.session) throw new Error('No session available');\n\t\tconst transitionId = payload.readUInt16BE(0);\n\t\ttry {\n\t\t\tthis.session.processCommit(payload.subarray(2));\n\t\t\tif (transitionId === 0) {\n\t\t\t\tthis.reinitializing = false;\n\t\t\t\tthis.lastTransitionId = transitionId;\n\t\t\t} else {\n\t\t\t\tthis.pendingTransition = { transition_id: transitionId, protocol_version: this.protocolVersion };\n\t\t\t}\n\n\t\t\tthis.emit('debug', `MLS commit processed (transition id: ${transitionId})`);\n\t\t\treturn { transitionId, success: true };\n\t\t} catch (error) {\n\t\t\tthis.emit('debug', `MLS commit errored from transition ${transitionId}: ${error}`);\n\t\t\tthis.recoverFromInvalidTransition(transitionId);\n\t\t\treturn { transitionId, success: false };\n\t\t}\n\t}\n\n\t/**\n\t * Processes a welcome from the MLS group.\n\t *\n\t * @param payload - The payload\n\t * @returns The transaction id and whether it was successful\n\t */\n\tpublic processWelcome(payload: Buffer): TransitionResult {\n\t\tif (!this.session) throw new Error('No session available');\n\t\tconst transitionId = payload.readUInt16BE(0);\n\t\ttry {\n\t\t\tthis.session.processWelcome(payload.subarray(2));\n\t\t\tif (transitionId === 0) {\n\t\t\t\tthis.reinitializing = false;\n\t\t\t\tthis.lastTransitionId = transitionId;\n\t\t\t} else {\n\t\t\t\tthis.pendingTransition = { transition_id: transitionId, protocol_version: this.protocolVersion };\n\t\t\t}\n\n\t\t\tthis.emit('debug', `MLS welcome processed (transition id: ${transitionId})`);\n\t\t\treturn { transitionId, success: true };\n\t\t} catch (error) {\n\t\t\tthis.emit('debug', `MLS welcome errored from transition ${transitionId}: ${error}`);\n\t\t\tthis.recoverFromInvalidTransition(transitionId);\n\t\t\treturn { transitionId, success: false };\n\t\t}\n\t}\n\n\t/**\n\t * Encrypt a packet using end-to-end encryption.\n\t *\n\t * @param packet - The packet to encrypt\n\t */\n\tpublic encrypt(packet: Buffer) {\n\t\tif (this.protocolVersion === 0 || !this.session?.ready || packet.equals(SILENCE_FRAME)) return packet;\n\t\treturn this.session.encryptOpus(packet);\n\t}\n\n\t/**\n\t * Decrypt a packet using end-to-end encryption.\n\t *\n\t * @param packet - The packet to decrypt\n\t * @param userId - The user id that sent the packet\n\t * @returns The decrypted packet, or `null` if the decryption failed but should be ignored\n\t */\n\tpublic decrypt(packet: Buffer, userId: string) {\n\t\tconst canDecrypt = this.session?.ready && (this.protocolVersion !== 0 || this.session?.canPassthrough(userId));\n\t\tif (packet.equals(SILENCE_FRAME) || !canDecrypt || !this.session) return packet;\n\t\ttry {\n\t\t\tconst buffer = this.session.decrypt(userId, Davey.MediaType.AUDIO, packet);\n\t\t\tthis.consecutiveFailures = 0;\n\t\t\treturn buffer;\n\t\t} catch (error) {\n\t\t\tif (!this.reinitializing && !this.pendingTransition) {\n\t\t\t\tthis.consecutiveFailures++;\n\t\t\t\tthis.emit('debug', `Failed to decrypt a packet (${this.consecutiveFailures} consecutive fails)`);\n\t\t\t\tif (this.consecutiveFailures > this.failureTolerance) {\n\t\t\t\t\tif (this.lastTransitionId) this.recoverFromInvalidTransition(this.lastTransitionId);\n\t\t\t\t\telse throw error;\n\t\t\t\t}\n\t\t\t} else if (this.reinitializing) {\n\t\t\t\tthis.emit('debug', 'Failed to decrypt a packet (reinitializing session)');\n\t\t\t} else if (this.pendingTransition) {\n\t\t\t\tthis.emit(\n\t\t\t\t\t'debug',\n\t\t\t\t\t`Failed to decrypt a packet (pending transition ${this.pendingTransition.transition_id} to v${this.pendingTransition.protocol_version})`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Resets the session.\n\t */\n\tpublic destroy() {\n\t\ttry {\n\t\t\tthis.session?.reset();\n\t\t} catch {}\n\t}\n}\n","/* eslint-disable @typescript-eslint/prefer-ts-expect-error, @typescript-eslint/method-signature-style */\nimport { Buffer } from 'node:buffer';\nimport { EventEmitter } from 'node:events';\nimport { addAudioPlayer, deleteAudioPlayer } from '../DataStore';\nimport { VoiceConnectionStatus, type VoiceConnection } from '../VoiceConnection';\nimport { noop } from '../util/util';\nimport { AudioPlayerError } from './AudioPlayerError';\nimport type { AudioResource } from './AudioResource';\nimport { PlayerSubscription } from './PlayerSubscription';\n\n// The Opus \"silent\" frame\nexport const SILENCE_FRAME = Buffer.from([0xf8, 0xff, 0xfe]);\n\n/**\n * Describes the behavior of the player when an audio packet is played but there are no available\n * voice connections to play to.\n */\nexport enum NoSubscriberBehavior {\n\t/**\n\t * Pauses playing the stream until a voice connection becomes available.\n\t */\n\tPause = 'pause',\n\n\t/**\n\t * Continues to play through the resource regardless.\n\t */\n\tPlay = 'play',\n\n\t/**\n\t * The player stops and enters the Idle state.\n\t */\n\tStop = 'stop',\n}\n\nexport enum AudioPlayerStatus {\n\t/**\n\t * When the player has paused itself. Only possible with the \"pause\" no subscriber behavior.\n\t */\n\tAutoPaused = 'autopaused',\n\n\t/**\n\t * When the player is waiting for an audio resource to become readable before transitioning to Playing.\n\t */\n\tBuffering = 'buffering',\n\n\t/**\n\t * When there is currently no resource for the player to be playing.\n\t */\n\tIdle = 'idle',\n\n\t/**\n\t * When the player has been manually paused.\n\t */\n\tPaused = 'paused',\n\n\t/**\n\t * When the player is actively playing an audio resource.\n\t */\n\tPlaying = 'playing',\n}\n\n/**\n * Options that can be passed when creating an audio player, used to specify its behavior.\n */\nexport interface CreateAudioPlayerOptions {\n\tbehaviors?: {\n\t\tmaxMissedFrames?: number;\n\t\tnoSubscriber?: NoSubscriberBehavior;\n\t};\n\tdebug?: boolean;\n}\n\n/**\n * The state that an AudioPlayer is in when it has no resource to play. This is the starting state.\n */\nexport interface AudioPlayerIdleState {\n\tstatus: AudioPlayerStatus.Idle;\n}\n\n/**\n * The state that an AudioPlayer is in when it is waiting for a resource to become readable. Once this\n * happens, the AudioPlayer will enter the Playing state. If the resource ends/errors before this, then\n * it will re-enter the Idle state.\n */\nexport interface AudioPlayerBufferingState {\n\tonFailureCallback: () => void;\n\tonReadableCallback: () => void;\n\tonStreamError: (error: Error) => void;\n\t/**\n\t * The resource that the AudioPlayer is waiting for\n\t */\n\tresource: AudioResource;\n\tstatus: AudioPlayerStatus.Buffering;\n}\n\n/**\n * The state that an AudioPlayer is in when it is actively playing an AudioResource. When playback ends,\n * it will enter the Idle state.\n */\nexport interface AudioPlayerPlayingState {\n\t/**\n\t * The number of consecutive times that the audio resource has been unable to provide an Opus frame.\n\t */\n\tmissedFrames: number;\n\tonStreamError: (error: Error) => void;\n\n\t/**\n\t * The playback duration in milliseconds of the current audio resource. This includes filler silence packets\n\t * that have been played when the resource was buffering.\n\t */\n\tplaybackDuration: number;\n\n\t/**\n\t * The resource that is being played.\n\t */\n\tresource: AudioResource;\n\n\tstatus: AudioPlayerStatus.Playing;\n}\n\n/**\n * The state that an AudioPlayer is in when it has either been explicitly paused by the user, or done\n * automatically by the AudioPlayer itself if there are no available subscribers.\n */\nexport interface AudioPlayerPausedState {\n\tonStreamError: (error: Error) => void;\n\t/**\n\t * The playback duration in milliseconds of the current audio resource. This includes filler silence packets\n\t * that have been played when the resource was buffering.\n\t */\n\tplaybackDuration: number;\n\n\t/**\n\t * The current resource of the audio player.\n\t */\n\tresource: AudioResource;\n\n\t/**\n\t * How many silence packets still need to be played to avoid audio interpolation due to the stream suddenly pausing.\n\t */\n\tsilencePacketsRemaining: number;\n\n\tstatus: AudioPlayerStatus.AutoPaused | AudioPlayerStatus.Paused;\n}\n\n/**\n * The various states that the player can be in.\n */\nexport type AudioPlayerState =\n\t| AudioPlayerBufferingState\n\t| AudioPlayerIdleState\n\t| AudioPlayerPausedState\n\t| AudioPlayerPlayingState;\n\nexport interface AudioPlayer extends EventEmitter {\n\t/**\n\t * Emitted when there is an error emitted from the audio resource played by the audio player\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'error', listener: (error: AudioPlayerError) => void): this;\n\t/**\n\t * Emitted debugging information about the audio player\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'debug', listener: (message: string) => void): this;\n\t/**\n\t * Emitted when the state of the audio player changes\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'stateChange', listener: (oldState: AudioPlayerState, newState: AudioPlayerState) => void): this;\n\t/**\n\t * Emitted when the audio player is subscribed to a voice connection\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'subscribe' | 'unsubscribe', listener: (subscription: PlayerSubscription) => void): this;\n\t/**\n\t * Emitted when the status of state changes to a specific status\n\t *\n\t * @eventProperty\n\t */\n\ton(\n\t\tevent: Event,\n\t\tlistener: (oldState: AudioPlayerState, newState: AudioPlayerState & { status: Event }) => void,\n\t): this;\n}\n\n/**\n * Stringifies an AudioPlayerState instance.\n *\n * @param state - The state to stringify\n */\nfunction stringifyState(state: AudioPlayerState) {\n\treturn JSON.stringify({\n\t\t...state,\n\t\tresource: Reflect.has(state, 'resource'),\n\t\tstepTimeout: Reflect.has(state, 'stepTimeout'),\n\t});\n}\n\n/**\n * Used to play audio resources (i.e. tracks, streams) to voice connections.\n *\n * @remarks\n * Audio players are designed to be re-used - even if a resource has finished playing, the player itself\n * can still be used.\n *\n * The AudioPlayer drives the timing of playback, and therefore is unaffected by voice connections\n * becoming unavailable. Its behavior in these scenarios can be configured.\n */\nexport class AudioPlayer extends EventEmitter {\n\t/**\n\t * The state that the AudioPlayer is in.\n\t */\n\tprivate _state: AudioPlayerState;\n\n\t/**\n\t * A list of VoiceConnections that are registered to this AudioPlayer. The player will attempt to play audio\n\t * to the streams in this list.\n\t */\n\tprivate readonly subscribers: PlayerSubscription[] = [];\n\n\t/**\n\t * The behavior that the player should follow when it enters certain situations.\n\t */\n\tprivate readonly behaviors: {\n\t\tmaxMissedFrames: number;\n\t\tnoSubscriber: NoSubscriberBehavior;\n\t};\n\n\t/**\n\t * The debug logger function, if debugging is enabled.\n\t */\n\tprivate readonly debug: ((message: string) => void) | null;\n\n\t/**\n\t * Creates a new AudioPlayer.\n\t */\n\tpublic constructor(options: CreateAudioPlayerOptions = {}) {\n\t\tsuper();\n\t\tthis._state = { status: AudioPlayerStatus.Idle };\n\t\tthis.behaviors = {\n\t\t\tnoSubscriber: NoSubscriberBehavior.Pause,\n\t\t\tmaxMissedFrames: 5,\n\t\t\t...options.behaviors,\n\t\t};\n\t\tthis.debug = options.debug === false ? null : (message: string) => this.emit('debug', message);\n\t}\n\n\t/**\n\t * A list of subscribed voice connections that can currently receive audio to play.\n\t */\n\tpublic get playable() {\n\t\treturn this.subscribers\n\t\t\t.filter(({ connection }) => connection.state.status === VoiceConnectionStatus.Ready)\n\t\t\t.map(({ connection }) => connection);\n\t}\n\n\t/**\n\t * Subscribes a VoiceConnection to the audio player's play list. If the VoiceConnection is already subscribed,\n\t * then the existing subscription is used.\n\t *\n\t * @remarks\n\t * This method should not be directly called. Instead, use VoiceConnection#subscribe.\n\t * @param connection - The connection to subscribe\n\t * @returns The new subscription if the voice connection is not yet subscribed, otherwise the existing subscription\n\t */\n\t// @ts-ignore\n\tprivate subscribe(connection: VoiceConnection) {\n\t\tconst existingSubscription = this.subscribers.find((subscription) => subscription.connection === connection);\n\t\tif (!existingSubscription) {\n\t\t\tconst subscription = new PlayerSubscription(connection, this);\n\t\t\tthis.subscribers.push(subscription);\n\t\t\tsetImmediate(() => this.emit('subscribe', subscription));\n\t\t\treturn subscription;\n\t\t}\n\n\t\treturn existingSubscription;\n\t}\n\n\t/**\n\t * Unsubscribes a subscription - i.e. removes a voice connection from the play list of the audio player.\n\t *\n\t * @remarks\n\t * This method should not be directly called. Instead, use PlayerSubscription#unsubscribe.\n\t * @param subscription - The subscription to remove\n\t * @returns Whether or not the subscription existed on the player and was removed\n\t */\n\t// @ts-ignore\n\tprivate unsubscribe(subscription: PlayerSubscription) {\n\t\tconst index = this.subscribers.indexOf(subscription);\n\t\tconst exists = index !== -1;\n\t\tif (exists) {\n\t\t\tthis.subscribers.splice(index, 1);\n\t\t\tsubscription.connection.setSpeaking(false);\n\t\t\tthis.emit('unsubscribe', subscription);\n\t\t}\n\n\t\treturn exists;\n\t}\n\n\t/**\n\t * The state that the player is in.\n\t *\n\t * @remarks\n\t * The setter will perform clean-up operations where necessary.\n\t */\n\tpublic get state() {\n\t\treturn this._state;\n\t}\n\n\tpublic set state(newState: AudioPlayerState) {\n\t\tconst oldState = this._state;\n\t\tconst newResource = Reflect.get(newState, 'resource') as AudioResource | undefined;\n\n\t\tif (oldState.status !== AudioPlayerStatus.Idle && oldState.resource !== newResource) {\n\t\t\toldState.resource.playStream.on('error', noop);\n\t\t\toldState.resource.playStream.off('error', oldState.onStreamError);\n\t\t\toldState.resource.audioPlayer = undefined;\n\t\t\toldState.resource.playStream.destroy();\n\t\t\toldState.resource.playStream.read(); // required to ensure buffered data is drained, prevents memory leak\n\t\t}\n\n\t\t// When leaving the Buffering state (or buffering a new resource), then remove the event listeners from it\n\t\tif (\n\t\t\toldState.status === AudioPlayerStatus.Buffering &&\n\t\t\t(newState.status !== AudioPlayerStatus.Buffering || newState.resource !== oldState.resource)\n\t\t) {\n\t\t\toldState.resource.playStream.off('end', oldState.onFailureCallback);\n\t\t\toldState.resource.playStream.off('close', oldState.onFailureCallback);\n\t\t\toldState.resource.playStream.off('finish', oldState.onFailureCallback);\n\t\t\toldState.resource.playStream.off('readable', oldState.onReadableCallback);\n\t\t}\n\n\t\t// transitioning into an idle should ensure that connections stop speaking\n\t\tif (newState.status === AudioPlayerStatus.Idle) {\n\t\t\tthis._signalStopSpeaking();\n\t\t\tdeleteAudioPlayer(this);\n\t\t}\n\n\t\t// attach to the global audio player timer\n\t\tif (newResource) {\n\t\t\taddAudioPlayer(this);\n\t\t}\n\n\t\t// playing -> playing state changes should still transition if a resource changed (seems like it would be useful!)\n\t\tconst didChangeResources =\n\t\t\toldState.status !== AudioPlayerStatus.Idle &&\n\t\t\tnewState.status === AudioPlayerStatus.Playing &&\n\t\t\toldState.resource !== newState.resource;\n\n\t\tthis._state = newState;\n\n\t\tthis.emit('stateChange', oldState, this._state);\n\t\tif (oldState.status !== newState.status || didChangeResources) {\n\t\t\tthis.emit(newState.status, oldState, this._state as any);\n\t\t}\n\n\t\tthis.debug?.(`state change:\\nfrom ${stringifyState(oldState)}\\nto ${stringifyState(newState)}`);\n\t}\n\n\t/**\n\t * Plays a new resource on the player. If the player is already playing a resource, the existing resource is destroyed\n\t * (it cannot be reused, even in another player) and is replaced with the new resource.\n\t *\n\t * @remarks\n\t * The player will transition to the Playing state once playback begins, and will return to the Idle state once\n\t * playback is ended.\n\t *\n\t * If the player was previously playing a resource and this method is called, the player will not transition to the\n\t * Idle state during the swap over.\n\t * @param resource - The resource to play\n\t * @throws Will throw if attempting to play an audio resource that has already ended, or is being played by another player\n\t */\n\tpublic play(resource: AudioResource) {\n\t\tif (resource.ended) {\n\t\t\tthrow new Error('Cannot play a resource that has already ended.');\n\t\t}\n\n\t\tif (resource.audioPlayer) {\n\t\t\tif (resource.audioPlayer === this) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthrow new Error('Resource is already being played by another audio player.');\n\t\t}\n\n\t\tresource.audioPlayer = this;\n\n\t\t// Attach error listeners to the stream that will propagate the error and then return to the Idle\n\t\t// state if the resource is still being used.\n\t\tconst onStreamError = (error: Error) => {\n\t\t\tif (this.state.status !== AudioPlayerStatus.Idle) {\n\t\t\t\tthis.emit('error', new AudioPlayerError(error, this.state.resource));\n\t\t\t}\n\n\t\t\tif (this.state.status !== AudioPlayerStatus.Idle && this.state.resource === resource) {\n\t\t\t\tthis.state = {\n\t\t\t\t\tstatus: AudioPlayerStatus.Idle,\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\n\t\tresource.playStream.once('error', onStreamError);\n\n\t\tif (resource.started) {\n\t\t\tthis.state = {\n\t\t\t\tstatus: AudioPlayerStatus.Playing,\n\t\t\t\tmissedFrames: 0,\n\t\t\t\tplaybackDuration: 0,\n\t\t\t\tresource,\n\t\t\t\tonStreamError,\n\t\t\t};\n\t\t} else {\n\t\t\tconst onReadableCallback = () => {\n\t\t\t\tif (this.state.status === AudioPlayerStatus.Buffering && this.state.resource === resource) {\n\t\t\t\t\tthis.state = {\n\t\t\t\t\t\tstatus: AudioPlayerStatus.Playing,\n\t\t\t\t\t\tmissedFrames: 0,\n\t\t\t\t\t\tplaybackDuration: 0,\n\t\t\t\t\t\tresource,\n\t\t\t\t\t\tonStreamError,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst onFailureCallback = () => {\n\t\t\t\tif (this.state.status === AudioPlayerStatus.Buffering && this.state.resource === resource) {\n\t\t\t\t\tthis.state = {\n\t\t\t\t\t\tstatus: AudioPlayerStatus.Idle,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tresource.playStream.once('readable', onReadableCallback);\n\n\t\t\tresource.playStream.once('end', onFailureCallback);\n\t\t\tresource.playStream.once('close', onFailureCallback);\n\t\t\tresource.playStream.once('finish', onFailureCallback);\n\n\t\t\tthis.state = {\n\t\t\t\tstatus: AudioPlayerStatus.Buffering,\n\t\t\t\tresource,\n\t\t\t\tonReadableCallback,\n\t\t\t\tonFailureCallback,\n\t\t\t\tonStreamError,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Pauses playback of the current resource, if any.\n\t *\n\t * @param interpolateSilence - If true, the player will play 5 packets of silence after pausing to prevent audio glitches\n\t * @returns `true` if the player was successfully paused, otherwise `false`\n\t */\n\tpublic pause(interpolateSilence = true) {\n\t\tif (this.state.status !== AudioPlayerStatus.Playing) return false;\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\tstatus: AudioPlayerStatus.Paused,\n\t\t\tsilencePacketsRemaining: interpolateSilence ? 5 : 0,\n\t\t};\n\t\treturn true;\n\t}\n\n\t/**\n\t * Unpauses playback of the current resource, if any.\n\t *\n\t * @returns `true` if the player was successfully unpaused, otherwise `false`\n\t */\n\tpublic unpause() {\n\t\tif (this.state.status !== AudioPlayerStatus.Paused) return false;\n\t\tthis.state = {\n\t\t\t...this.state,\n\t\t\tstatus: AudioPlayerStatus.Playing,\n\t\t\tmissedFrames: 0,\n\t\t};\n\t\treturn true;\n\t}\n\n\t/**\n\t * Stops playback of the current resource and destroys the resource. The player will either transition to the Idle state,\n\t * or remain in its current state until the silence padding frames of the resource have been played.\n\t *\n\t * @param force - If true, will force the player to enter the Idle state even if the resource has silence padding frames\n\t * @returns `true` if the player will come to a stop, otherwise `false`\n\t */\n\tpublic stop(force = false) {\n\t\tif (this.state.status === AudioPlayerStatus.Idle) return false;\n\t\tif (force || this.state.resource.silencePaddingFrames === 0) {\n\t\t\tthis.state = {\n\t\t\t\tstatus: AudioPlayerStatus.Idle,\n\t\t\t};\n\t\t} else if (this.state.resource.silenceRemaining === -1) {\n\t\t\tthis.state.resource.silenceRemaining = this.state.resource.silencePaddingFrames;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks whether the underlying resource (if any) is playable (readable)\n\t *\n\t * @returns `true` if the resource is playable, otherwise `false`\n\t */\n\tpublic checkPlayable() {\n\t\tconst state = this._state;\n\t\tif (state.status === AudioPlayerStatus.Idle || state.status === AudioPlayerStatus.Buffering) return false;\n\n\t\t// If the stream has been destroyed or is no longer readable, then transition to the Idle state.\n\t\tif (!state.resource.readable) {\n\t\t\tthis.state = {\n\t\t\t\tstatus: AudioPlayerStatus.Idle,\n\t\t\t};\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Called roughly every 20ms by the global audio player timer. Dispatches any audio packets that are buffered\n\t * by the active connections of this audio player.\n\t */\n\t// @ts-ignore\n\tprivate _stepDispatch() {\n\t\tconst state = this._state;\n\n\t\t// Guard against the Idle state\n\t\tif (state.status === AudioPlayerStatus.Idle || state.status === AudioPlayerStatus.Buffering) return;\n\n\t\t// Dispatch any audio packets that were prepared in the previous cycle\n\t\tfor (const connection of this.playable) {\n\t\t\tconnection.dispatchAudio();\n\t\t}\n\t}\n\n\t/**\n\t * Called roughly every 20ms by the global audio player timer. Attempts to read an audio packet from the\n\t * underlying resource of the stream, and then has all the active connections of the audio player prepare it\n\t * (encrypt it, append header data) so that it is ready to play at the start of the next cycle.\n\t */\n\t// @ts-ignore\n\tprivate _stepPrepare() {\n\t\tconst state = this._state;\n\n\t\t// Guard against the Idle state\n\t\tif (state.status === AudioPlayerStatus.Idle || state.status === AudioPlayerStatus.Buffering) return;\n\n\t\t// List of connections that can receive the packet\n\t\tconst playable = this.playable;\n\n\t\t/* If the player was previously in the AutoPaused state, check to see whether there are newly available\n\t\t connections, allowing us to transition out of the AutoPaused state back into the Playing state */\n\t\tif (state.status === AudioPlayerStatus.AutoPaused && playable.length > 0) {\n\t\t\tthis.state = {\n\t\t\t\t...state,\n\t\t\t\tstatus: AudioPlayerStatus.Playing,\n\t\t\t\tmissedFrames: 0,\n\t\t\t};\n\t\t}\n\n\t\t/* If the player is (auto)paused, check to see whether silence packets should be played and\n\t\t set a timeout to begin the next cycle, ending the current cycle here. */\n\t\tif (state.status === AudioPlayerStatus.Paused || state.status === AudioPlayerStatus.AutoPaused) {\n\t\t\tif (state.silencePacketsRemaining > 0) {\n\t\t\t\tstate.silencePacketsRemaining--;\n\t\t\t\tthis._preparePacket(SILENCE_FRAME, playable, state);\n\t\t\t\tif (state.silencePacketsRemaining === 0) {\n\t\t\t\t\tthis._signalStopSpeaking();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are no available connections in this cycle, observe the configured \"no subscriber\" behavior.\n\t\tif (playable.length === 0) {\n\t\t\tif (this.behaviors.noSubscriber === NoSubscriberBehavior.Pause) {\n\t\t\t\tthis.state = {\n\t\t\t\t\t...state,\n\t\t\t\t\tstatus: AudioPlayerStatus.AutoPaused,\n\t\t\t\t\tsilencePacketsRemaining: 5,\n\t\t\t\t};\n\t\t\t\treturn;\n\t\t\t} else if (this.behaviors.noSubscriber === NoSubscriberBehavior.Stop) {\n\t\t\t\tthis.stop(true);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Attempt to read an Opus packet from the resource. If there isn't an available packet,\n\t\t * play a silence packet. If there are 5 consecutive cycles with failed reads, then the\n\t\t * playback will end.\n\t\t */\n\t\tconst packet: Buffer | null = state.resource.read();\n\n\t\tif (state.status === AudioPlayerStatus.Playing) {\n\t\t\tif (packet) {\n\t\t\t\tthis._preparePacket(packet, playable, state);\n\t\t\t\tstate.missedFrames = 0;\n\t\t\t} else {\n\t\t\t\tthis._preparePacket(SILENCE_FRAME, playable, state);\n\t\t\t\tstate.missedFrames++;\n\t\t\t\tif (state.missedFrames >= this.behaviors.maxMissedFrames) {\n\t\t\t\t\tthis.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Signals to all the subscribed connections that they should send a packet to Discord indicating\n\t * they are no longer speaking. Called once playback of a resource ends.\n\t */\n\tprivate _signalStopSpeaking() {\n\t\tfor (const { connection } of this.subscribers) {\n\t\t\tconnection.setSpeaking(false);\n\t\t}\n\t}\n\n\t/**\n\t * Instructs the given connections to each prepare this packet to be played at the start of the\n\t * next cycle.\n\t *\n\t * @param packet - The Opus packet to be prepared by each receiver\n\t * @param receivers - The connections that should play this packet\n\t */\n\tprivate _preparePacket(\n\t\tpacket: Buffer,\n\t\treceivers: VoiceConnection[],\n\t\tstate: AudioPlayerPausedState | AudioPlayerPlayingState,\n\t) {\n\t\tstate.playbackDuration += 20;\n\t\tfor (const connection of receivers) {\n\t\t\tconnection.prepareAudioPacket(packet);\n\t\t}\n\t}\n}\n\n/**\n * Creates a new AudioPlayer to be used.\n */\nexport function createAudioPlayer(options?: CreateAudioPlayerOptions) {\n\treturn new AudioPlayer(options);\n}\n","import type { AudioResource } from './AudioResource';\n\n/**\n * An error emitted by an AudioPlayer. Contains an attached resource to aid with\n * debugging and identifying where the error came from.\n */\nexport class AudioPlayerError extends Error {\n\t/**\n\t * The resource associated with the audio player at the time the error was thrown.\n\t */\n\tpublic readonly resource: AudioResource;\n\n\tpublic constructor(error: Error, resource: AudioResource) {\n\t\tsuper(error.message);\n\t\tthis.resource = resource;\n\t\tthis.name = error.name;\n\t\tthis.stack = error.stack!;\n\t}\n}\n","/* eslint-disable @typescript-eslint/dot-notation */\nimport type { VoiceConnection } from '../VoiceConnection';\nimport type { AudioPlayer } from './AudioPlayer';\n\n/**\n * Represents a subscription of a voice connection to an audio player, allowing\n * the audio player to play audio on the voice connection.\n */\nexport class PlayerSubscription {\n\t/**\n\t * The voice connection of this subscription.\n\t */\n\tpublic readonly connection: VoiceConnection;\n\n\t/**\n\t * The audio player of this subscription.\n\t */\n\tpublic readonly player: AudioPlayer;\n\n\tpublic constructor(connection: VoiceConnection, player: AudioPlayer) {\n\t\tthis.connection = connection;\n\t\tthis.player = player;\n\t}\n\n\t/**\n\t * Unsubscribes the connection from the audio player, meaning that the\n\t * audio player cannot stream audio to it until a new subscription is made.\n\t */\n\tpublic unsubscribe() {\n\t\tthis.connection['onSubscriptionRemoved'](this);\n\t\tthis.player['unsubscribe'](this);\n\t}\n}\n","import { Buffer } from 'node:buffer';\nimport { createSocket, type Socket } from 'node:dgram';\nimport { EventEmitter } from 'node:events';\nimport { isIPv4 } from 'node:net';\n\n/**\n * Stores an IP address and port. Used to store socket details for the local client as well as\n * for Discord.\n */\nexport interface SocketConfig {\n\tip: string;\n\tport: number;\n}\n\n/**\n * Parses the response from Discord to aid with local IP discovery.\n *\n * @param message - The received message\n */\nexport function parseLocalPacket(message: Buffer): SocketConfig {\n\tconst packet = Buffer.from(message);\n\n\tconst ip = packet.slice(8, packet.indexOf(0, 8)).toString('utf8');\n\n\tif (!isIPv4(ip)) {\n\t\tthrow new Error('Malformed IP address');\n\t}\n\n\tconst port = packet.readUInt16BE(packet.length - 2);\n\n\treturn { ip, port };\n}\n\n/**\n * The interval in milliseconds at which keep alive datagrams are sent.\n */\nconst KEEP_ALIVE_INTERVAL = 5e3;\n\n/**\n * The maximum value of the keep alive counter.\n */\nconst MAX_COUNTER_VALUE = 2 ** 32 - 1;\n\nexport interface VoiceUDPSocket extends EventEmitter {\n\ton(event: 'error', listener: (error: Error) => void): this;\n\ton(event: 'close', listener: () => void): this;\n\ton(event: 'debug', listener: (message: string) => void): this;\n\ton(event: 'message', listener: (message: Buffer) => void): this;\n}\n\n/**\n * Manages the UDP networking for a voice connection.\n */\nexport class VoiceUDPSocket extends EventEmitter {\n\t/**\n\t * The underlying network Socket for the VoiceUDPSocket.\n\t */\n\tprivate readonly socket: Socket;\n\n\t/**\n\t * The socket details for Discord (remote)\n\t */\n\tprivate readonly remote: SocketConfig;\n\n\t/**\n\t * The counter used in the keep alive mechanism.\n\t */\n\tprivate keepAliveCounter = 0;\n\n\t/**\n\t * The buffer used to write the keep alive counter into.\n\t */\n\tprivate readonly keepAliveBuffer: Buffer;\n\n\t/**\n\t * The Node.js interval for the keep-alive mechanism.\n\t */\n\tprivate readonly keepAliveInterval: NodeJS.Timeout;\n\n\t/**\n\t * The time taken to receive a response to keep alive messages.\n\t *\n\t * @deprecated This field is no longer updated as keep alive messages are no longer tracked.\n\t */\n\tpublic ping?: number;\n\n\t/**\n\t * Creates a new VoiceUDPSocket.\n\t *\n\t * @param remote - Details of the remote socket\n\t */\n\tpublic constructor(remote: SocketConfig) {\n\t\tsuper();\n\t\tthis.socket = createSocket('udp4');\n\t\tthis.socket.on('error', (error: Error) => this.emit('error', error));\n\t\tthis.socket.on('message', (buffer: Buffer) => this.onMessage(buffer));\n\t\tthis.socket.on('close', () => this.emit('close'));\n\t\tthis.remote = remote;\n\t\tthis.keepAliveBuffer = Buffer.alloc(8);\n\t\tthis.keepAliveInterval = setInterval(() => this.keepAlive(), KEEP_ALIVE_INTERVAL);\n\t\tsetImmediate(() => this.keepAlive());\n\t}\n\n\t/**\n\t * Called when a message is received on the UDP socket.\n\t *\n\t * @param buffer - The received buffer\n\t */\n\tprivate onMessage(buffer: Buffer): void {\n\t\t// Propagate the message\n\t\tthis.emit('message', buffer);\n\t}\n\n\t/**\n\t * Called at a regular interval to check whether we are still able to send datagrams to Discord.\n\t */\n\tprivate keepAlive() {\n\t\tthis.keepAliveBuffer.writeUInt32LE(this.keepAliveCounter, 0);\n\t\tthis.send(this.keepAliveBuffer);\n\t\tthis.keepAliveCounter++;\n\t\tif (this.keepAliveCounter > MAX_COUNTER_VALUE) {\n\t\t\tthis.keepAliveCounter = 0;\n\t\t}\n\t}\n\n\t/**\n\t * Sends a buffer to Discord.\n\t *\n\t * @param buffer - The buffer to send\n\t */\n\tpublic send(buffer: Buffer) {\n\t\tthis.socket.send(buffer, this.remote.port, this.remote.ip);\n\t}\n\n\t/**\n\t * Closes the socket, the instance will not be able to be reused.\n\t */\n\tpublic destroy() {\n\t\ttry {\n\t\t\tthis.socket.close();\n\t\t} catch {}\n\n\t\tclearInterval(this.keepAliveInterval);\n\t}\n\n\t/**\n\t * Performs IP discovery to discover the local address and port to be used for the voice connection.\n\t *\n\t * @param ssrc - The SSRC received from Discord\n\t */\n\tpublic async performIPDiscovery(ssrc: number): Promise {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst listener = (message: Buffer) => {\n\t\t\t\ttry {\n\t\t\t\t\tif (message.readUInt16BE(0) !== 2) return;\n\t\t\t\t\tconst packet = parseLocalPacket(message);\n\t\t\t\t\tthis.socket.off('message', listener);\n\t\t\t\t\tresolve(packet);\n\t\t\t\t} catch {}\n\t\t\t};\n\n\t\t\tthis.socket.on('message', listener);\n\t\t\tthis.socket.once('close', () => reject(new Error('Cannot perform IP discovery - socket closed')));\n\n\t\t\tconst discoveryBuffer = Buffer.alloc(74);\n\n\t\t\tdiscoveryBuffer.writeUInt16BE(1, 0);\n\t\t\tdiscoveryBuffer.writeUInt16BE(70, 2);\n\t\t\tdiscoveryBuffer.writeUInt32BE(ssrc, 4);\n\t\t\tthis.send(discoveryBuffer);\n\t\t});\n\t}\n}\n","import { Buffer } from 'node:buffer';\nimport { EventEmitter } from 'node:events';\nimport type { VoiceSendPayload } from 'discord-api-types/voice/v8';\nimport { VoiceOpcodes } from 'discord-api-types/voice/v8';\nimport WebSocket, { type MessageEvent } from 'ws';\n\n/**\n * A binary WebSocket message.\n */\nexport interface BinaryWebSocketMessage {\n\top: VoiceOpcodes;\n\tpayload: Buffer;\n\tseq: number;\n}\n\nexport interface VoiceWebSocket extends EventEmitter {\n\ton(event: 'error', listener: (error: Error) => void): this;\n\ton(event: 'open', listener: (event: WebSocket.Event) => void): this;\n\ton(event: 'close', listener: (event: WebSocket.CloseEvent) => void): this;\n\t/**\n\t * Debug event for VoiceWebSocket.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'debug', listener: (message: string) => void): this;\n\t/**\n\t * Packet event.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'packet', listener: (packet: any) => void): this;\n\t/**\n\t * Binary message event.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'binary', listener: (message: BinaryWebSocketMessage) => void): this;\n}\n\n/**\n * An extension of the WebSocket class to provide helper functionality when interacting\n * with the Discord Voice gateway.\n */\nexport class VoiceWebSocket extends EventEmitter {\n\t/**\n\t * The current heartbeat interval, if any.\n\t */\n\tprivate heartbeatInterval?: NodeJS.Timeout;\n\n\t/**\n\t * The time (milliseconds since UNIX epoch) that the last heartbeat acknowledgement packet was received.\n\t * This is set to 0 if an acknowledgement packet hasn't been received yet.\n\t */\n\tprivate lastHeartbeatAck: number;\n\n\t/**\n\t * The time (milliseconds since UNIX epoch) that the last heartbeat was sent. This is set to 0 if a heartbeat\n\t * hasn't been sent yet.\n\t */\n\tprivate lastHeartbeatSend: number;\n\n\t/**\n\t * The number of consecutively missed heartbeats.\n\t */\n\tprivate missedHeartbeats = 0;\n\n\t/**\n\t * The last recorded ping.\n\t */\n\tpublic ping?: number;\n\n\t/**\n\t * The last sequence number acknowledged from Discord. Will be `-1` if no sequence numbered messages have been received.\n\t */\n\tpublic sequence = -1;\n\n\t/**\n\t * The debug logger function, if debugging is enabled.\n\t */\n\tprivate readonly debug: ((message: string) => void) | null;\n\n\t/**\n\t * The underlying WebSocket of this wrapper.\n\t */\n\tprivate readonly ws: WebSocket;\n\n\t/**\n\t * Creates a new VoiceWebSocket.\n\t *\n\t * @param address - The address to connect to\n\t */\n\tpublic constructor(address: string, debug: boolean) {\n\t\tsuper();\n\t\tthis.ws = new WebSocket(address);\n\t\tthis.ws.onmessage = (err) => this.onMessage(err);\n\t\tthis.ws.onopen = (err) => this.emit('open', err);\n\t\tthis.ws.onerror = (err: Error | WebSocket.ErrorEvent) => this.emit('error', err instanceof Error ? err : err.error);\n\t\tthis.ws.onclose = (err) => this.emit('close', err);\n\n\t\tthis.lastHeartbeatAck = 0;\n\t\tthis.lastHeartbeatSend = 0;\n\n\t\tthis.debug = debug ? (message: string) => this.emit('debug', message) : null;\n\t}\n\n\t/**\n\t * Destroys the VoiceWebSocket. The heartbeat interval is cleared, and the connection is closed.\n\t */\n\tpublic destroy() {\n\t\ttry {\n\t\t\tthis.debug?.('destroyed');\n\t\t\tthis.setHeartbeatInterval(-1);\n\t\t\tthis.ws.close(1_000);\n\t\t} catch (error) {\n\t\t\tconst err = error as Error;\n\t\t\tthis.emit('error', err);\n\t\t}\n\t}\n\n\t/**\n\t * Handles message events on the WebSocket. Attempts to JSON parse the messages and emit them\n\t * as packets. Binary messages will be parsed and emitted.\n\t *\n\t * @param event - The message event\n\t */\n\tpublic onMessage(event: MessageEvent) {\n\t\tif (event.data instanceof Buffer || event.data instanceof ArrayBuffer) {\n\t\t\tconst buffer = event.data instanceof ArrayBuffer ? Buffer.from(event.data) : event.data;\n\t\t\tconst seq = buffer.readUInt16BE(0);\n\t\t\tconst op = buffer.readUInt8(2);\n\t\t\tconst payload = buffer.subarray(3);\n\n\t\t\tthis.sequence = seq;\n\t\t\tthis.debug?.(`<< [bin] opcode ${op}, seq ${seq}, ${payload.byteLength} bytes`);\n\n\t\t\tthis.emit('binary', { op, seq, payload });\n\t\t\treturn;\n\t\t} else if (typeof event.data !== 'string') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.debug?.(`<< ${event.data}`);\n\n\t\tlet packet: any;\n\t\ttry {\n\t\t\tpacket = JSON.parse(event.data);\n\t\t} catch (error) {\n\t\t\tconst err = error as Error;\n\t\t\tthis.emit('error', err);\n\t\t\treturn;\n\t\t}\n\n\t\tif (packet.seq) {\n\t\t\tthis.sequence = packet.seq;\n\t\t}\n\n\t\tif (packet.op === VoiceOpcodes.HeartbeatAck) {\n\t\t\tthis.lastHeartbeatAck = Date.now();\n\t\t\tthis.missedHeartbeats = 0;\n\t\t\tthis.ping = this.lastHeartbeatAck - this.lastHeartbeatSend;\n\t\t}\n\n\t\tthis.emit('packet', packet);\n\t}\n\n\t/**\n\t * Sends a JSON-stringifiable packet over the WebSocket.\n\t *\n\t * @param packet - The packet to send\n\t */\n\tpublic sendPacket(packet: VoiceSendPayload) {\n\t\ttry {\n\t\t\tconst stringified = JSON.stringify(packet);\n\t\t\tthis.debug?.(`>> ${stringified}`);\n\t\t\tthis.ws.send(stringified);\n\t\t} catch (error) {\n\t\t\tconst err = error as Error;\n\t\t\tthis.emit('error', err);\n\t\t}\n\t}\n\n\t/**\n\t * Sends a binary message over the WebSocket.\n\t *\n\t * @param opcode - The opcode to use\n\t * @param payload - The payload to send\n\t */\n\tpublic sendBinaryMessage(opcode: VoiceOpcodes, payload: Buffer) {\n\t\ttry {\n\t\t\tconst message = Buffer.concat([new Uint8Array([opcode]), payload]);\n\t\t\tthis.debug?.(`>> [bin] opcode ${opcode}, ${payload.byteLength} bytes`);\n\t\t\tthis.ws.send(message);\n\t\t} catch (error) {\n\t\t\tconst err = error as Error;\n\t\t\tthis.emit('error', err);\n\t\t}\n\t}\n\n\t/**\n\t * Sends a heartbeat over the WebSocket.\n\t */\n\tprivate sendHeartbeat() {\n\t\tthis.lastHeartbeatSend = Date.now();\n\t\tthis.missedHeartbeats++;\n\t\tconst nonce = this.lastHeartbeatSend;\n\t\tthis.sendPacket({\n\t\t\top: VoiceOpcodes.Heartbeat,\n\t\t\t// eslint-disable-next-line id-length\n\t\t\td: {\n\t\t\t\t// eslint-disable-next-line id-length\n\t\t\t\tt: nonce,\n\t\t\t\tseq_ack: this.sequence,\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Sets/clears an interval to send heartbeats over the WebSocket.\n\t *\n\t * @param ms - The interval in milliseconds. If negative, the interval will be unset\n\t */\n\tpublic setHeartbeatInterval(ms: number) {\n\t\tif (this.heartbeatInterval !== undefined) clearInterval(this.heartbeatInterval);\n\t\tif (ms > 0) {\n\t\t\tthis.heartbeatInterval = setInterval(() => {\n\t\t\t\tif (this.lastHeartbeatSend !== 0 && this.missedHeartbeats >= 3) {\n\t\t\t\t\t// Missed too many heartbeats - disconnect\n\t\t\t\t\tthis.ws.close();\n\t\t\t\t\tthis.setHeartbeatInterval(-1);\n\t\t\t\t}\n\n\t\t\t\tthis.sendHeartbeat();\n\t\t\t}, ms);\n\t\t}\n\t}\n}\n","/* eslint-disable jsdoc/check-param-names */\n\nimport { Buffer } from 'node:buffer';\nimport crypto from 'node:crypto';\nimport type { VoiceReceivePayload } from 'discord-api-types/voice/v8';\nimport { VoiceOpcodes } from 'discord-api-types/voice/v8';\nimport { VoiceConnectionStatus, type VoiceConnection } from '../VoiceConnection';\nimport { NetworkingStatusCode, type ConnectionData } from '../networking/Networking';\nimport { methods } from '../util/Secretbox';\nimport {\n\tAudioReceiveStream,\n\tcreateDefaultAudioReceiveStreamOptions,\n\ttype AudioReceiveStreamOptions,\n} from './AudioReceiveStream';\nimport { SSRCMap } from './SSRCMap';\nimport { SpeakingMap } from './SpeakingMap';\n\nconst HEADER_EXTENSION_BYTE = Buffer.from([0xbe, 0xde]);\nconst UNPADDED_NONCE_LENGTH = 4;\nconst AUTH_TAG_LENGTH = 16;\n\n/**\n * Attaches to a VoiceConnection, allowing you to receive audio packets from other\n * users that are speaking.\n *\n * @beta\n */\nexport class VoiceReceiver {\n\t/**\n\t * The attached connection of this receiver.\n\t */\n\tpublic readonly voiceConnection;\n\n\t/**\n\t * Maps SSRCs to Discord user ids.\n\t */\n\tpublic readonly ssrcMap: SSRCMap;\n\n\t/**\n\t * The current audio subscriptions of this receiver.\n\t */\n\tpublic readonly subscriptions: Map;\n\n\t/**\n\t * The connection data of the receiver.\n\t *\n\t * @internal\n\t */\n\tpublic connectionData: Partial;\n\n\t/**\n\t * The speaking map of the receiver.\n\t */\n\tpublic readonly speaking: SpeakingMap;\n\n\tpublic constructor(voiceConnection: VoiceConnection) {\n\t\tthis.voiceConnection = voiceConnection;\n\t\tthis.ssrcMap = new SSRCMap();\n\t\tthis.speaking = new SpeakingMap();\n\t\tthis.subscriptions = new Map();\n\t\tthis.connectionData = {};\n\n\t\tthis.onWsPacket = this.onWsPacket.bind(this);\n\t\tthis.onUdpMessage = this.onUdpMessage.bind(this);\n\t}\n\n\t/**\n\t * Called when a packet is received on the attached connection's WebSocket.\n\t *\n\t * @param packet - The received packet\n\t * @internal\n\t */\n\tpublic onWsPacket(packet: VoiceReceivePayload) {\n\t\tif (packet.op === VoiceOpcodes.ClientDisconnect) {\n\t\t\tthis.ssrcMap.delete(packet.d.user_id);\n\t\t} else if (packet.op === VoiceOpcodes.Speaking) {\n\t\t\tthis.ssrcMap.update({ userId: packet.d.user_id, audioSSRC: packet.d.ssrc });\n\t\t}\n\t}\n\n\tprivate decrypt(buffer: Buffer, mode: string, nonce: Buffer, secretKey: Uint8Array) {\n\t\t// Copy the last 4 bytes of unpadded nonce to the padding of (12 - 4) or (24 - 4) bytes\n\t\tbuffer.copy(nonce, 0, buffer.length - UNPADDED_NONCE_LENGTH);\n\n\t\tlet headerSize = 12;\n\t\tconst first = buffer.readUint8();\n\t\tif ((first >> 4) & 0x01) headerSize += 4;\n\n\t\t// The unencrypted RTP header contains 12 bytes, HEADER_EXTENSION and the extension size\n\t\tconst header = buffer.subarray(0, headerSize);\n\n\t\t// Encrypted contains the extension, if any, the opus packet, and the auth tag\n\t\tconst encrypted = buffer.subarray(headerSize, buffer.length - AUTH_TAG_LENGTH - UNPADDED_NONCE_LENGTH);\n\t\tconst authTag = buffer.subarray(\n\t\t\tbuffer.length - AUTH_TAG_LENGTH - UNPADDED_NONCE_LENGTH,\n\t\t\tbuffer.length - UNPADDED_NONCE_LENGTH,\n\t\t);\n\n\t\tswitch (mode) {\n\t\t\tcase 'aead_aes256_gcm_rtpsize': {\n\t\t\t\tconst decipheriv = crypto.createDecipheriv('aes-256-gcm', secretKey, nonce);\n\t\t\t\tdecipheriv.setAAD(header);\n\t\t\t\tdecipheriv.setAuthTag(authTag);\n\n\t\t\t\treturn Buffer.concat([decipheriv.update(encrypted), decipheriv.final()]);\n\t\t\t}\n\n\t\t\tcase 'aead_xchacha20_poly1305_rtpsize': {\n\t\t\t\t// Combined mode expects authtag in the encrypted message\n\t\t\t\treturn Buffer.from(\n\t\t\t\t\tmethods.crypto_aead_xchacha20poly1305_ietf_decrypt(\n\t\t\t\t\t\tBuffer.concat([encrypted, authTag]),\n\t\t\t\t\t\theader,\n\t\t\t\t\t\tnonce,\n\t\t\t\t\t\tsecretKey,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tdefault: {\n\t\t\t\tthrow new RangeError(`Unsupported decryption method: ${mode}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Parses an audio packet, decrypting it to yield an Opus packet.\n\t *\n\t * @param buffer - The buffer to parse\n\t * @param mode - The encryption mode\n\t * @param nonce - The nonce buffer used by the connection for encryption\n\t * @param secretKey - The secret key used by the connection for encryption\n\t * @param userId - The user id that sent the packet\n\t * @returns The parsed Opus packet\n\t */\n\tprivate parsePacket(buffer: Buffer, mode: string, nonce: Buffer, secretKey: Uint8Array, userId: string) {\n\t\tlet packet = this.decrypt(buffer, mode, nonce, secretKey);\n\t\tif (!packet) throw new Error('Failed to parse packet');\n\n\t\t// Strip decrypted RTP Header Extension if present\n\t\t// The header is only indicated in the original data, so compare with buffer first\n\t\tif (buffer.subarray(12, 14).compare(HEADER_EXTENSION_BYTE) === 0) {\n\t\t\tconst headerExtensionLength = buffer.subarray(14).readUInt16BE();\n\t\t\tpacket = packet.subarray(4 * headerExtensionLength);\n\t\t}\n\n\t\t// Decrypt packet if in a DAVE session.\n\t\tif (\n\t\t\tthis.voiceConnection.state.status === VoiceConnectionStatus.Ready &&\n\t\t\t(this.voiceConnection.state.networking.state.code === NetworkingStatusCode.Ready ||\n\t\t\t\tthis.voiceConnection.state.networking.state.code === NetworkingStatusCode.Resuming)\n\t\t) {\n\t\t\tconst daveSession = this.voiceConnection.state.networking.state.dave;\n\t\t\tif (daveSession) packet = daveSession.decrypt(packet, userId)!;\n\t\t}\n\n\t\treturn packet;\n\t}\n\n\t/**\n\t * Called when the UDP socket of the attached connection receives a message.\n\t *\n\t * @param msg - The received message\n\t * @internal\n\t */\n\tpublic onUdpMessage(msg: Buffer) {\n\t\tif (msg.length <= 8) return;\n\t\tconst ssrc = msg.readUInt32BE(8);\n\n\t\tconst userData = this.ssrcMap.get(ssrc);\n\t\tif (!userData) return;\n\n\t\tthis.speaking.onPacket(userData.userId);\n\n\t\tconst stream = this.subscriptions.get(userData.userId);\n\t\tif (!stream) return;\n\n\t\tif (this.connectionData.encryptionMode && this.connectionData.nonceBuffer && this.connectionData.secretKey) {\n\t\t\ttry {\n\t\t\t\tconst packet = this.parsePacket(\n\t\t\t\t\tmsg,\n\t\t\t\t\tthis.connectionData.encryptionMode,\n\t\t\t\t\tthis.connectionData.nonceBuffer,\n\t\t\t\t\tthis.connectionData.secretKey,\n\t\t\t\t\tuserData.userId,\n\t\t\t\t);\n\t\t\t\tif (packet) stream.push(packet);\n\t\t\t} catch (error) {\n\t\t\t\tstream.destroy(error as Error);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Creates a subscription for the given user id.\n\t *\n\t * @param target - The id of the user to subscribe to\n\t * @returns A readable stream of Opus packets received from the target\n\t */\n\tpublic subscribe(userId: string, options?: Partial) {\n\t\tconst existing = this.subscriptions.get(userId);\n\t\tif (existing) return existing;\n\n\t\tconst stream = new AudioReceiveStream({\n\t\t\t...createDefaultAudioReceiveStreamOptions(),\n\t\t\t...options,\n\t\t});\n\n\t\tstream.once('close', () => this.subscriptions.delete(userId));\n\t\tthis.subscriptions.set(userId, stream);\n\t\treturn stream;\n\t}\n}\n","import type { Buffer } from 'node:buffer';\nimport { nextTick } from 'node:process';\nimport { Readable, type ReadableOptions } from 'node:stream';\nimport { SILENCE_FRAME } from '../audio/AudioPlayer';\n\n/**\n * The different behaviors an audio receive stream can have for deciding when to end.\n */\nexport enum EndBehaviorType {\n\t/**\n\t * The stream will only end when manually destroyed.\n\t */\n\tManual,\n\n\t/**\n\t * The stream will end after a given time period of silence/no audio packets.\n\t */\n\tAfterSilence,\n\n\t/**\n\t * The stream will end after a given time period of no audio packets.\n\t */\n\tAfterInactivity,\n}\n\nexport type EndBehavior =\n\t| {\n\t\t\tbehavior: EndBehaviorType.AfterInactivity | EndBehaviorType.AfterSilence;\n\t\t\tduration: number;\n\t }\n\t| {\n\t\t\tbehavior: EndBehaviorType.Manual;\n\t };\n\nexport interface AudioReceiveStreamOptions extends ReadableOptions {\n\tend: EndBehavior;\n}\n\nexport function createDefaultAudioReceiveStreamOptions(): AudioReceiveStreamOptions {\n\treturn {\n\t\tend: {\n\t\t\tbehavior: EndBehaviorType.Manual,\n\t\t},\n\t};\n}\n\n/**\n * A readable stream of Opus packets received from a specific entity\n * in a Discord voice connection.\n */\nexport class AudioReceiveStream extends Readable {\n\t/**\n\t * The end behavior of the receive stream.\n\t */\n\tpublic readonly end: EndBehavior;\n\n\tprivate endTimeout?: NodeJS.Timeout;\n\n\tpublic constructor(options: AudioReceiveStreamOptions) {\n\t\tconst { end, ...rest } = options;\n\n\t\tsuper({\n\t\t\t...rest,\n\t\t\tobjectMode: true,\n\t\t});\n\n\t\tthis.end = end;\n\t}\n\n\tpublic override push(buffer: Buffer | null) {\n\t\tif (\n\t\t\tbuffer &&\n\t\t\t(this.end.behavior === EndBehaviorType.AfterInactivity ||\n\t\t\t\t(this.end.behavior === EndBehaviorType.AfterSilence &&\n\t\t\t\t\t(buffer.compare(SILENCE_FRAME) !== 0 || this.endTimeout === undefined)))\n\t\t) {\n\t\t\tthis.renewEndTimeout(this.end);\n\t\t}\n\n\t\tif (buffer === null) {\n\t\t\t// null marks EOF for stream\n\t\t\tnextTick(() => this.destroy());\n\t\t}\n\n\t\treturn super.push(buffer);\n\t}\n\n\tprivate renewEndTimeout(end: EndBehavior & { duration: number }) {\n\t\tif (this.endTimeout) {\n\t\t\tclearTimeout(this.endTimeout);\n\t\t}\n\n\t\tthis.endTimeout = setTimeout(() => this.push(null), end.duration);\n\t}\n\n\tpublic override _read() {}\n}\n","import { EventEmitter } from 'node:events';\n\n/**\n * The known data for a user in a Discord voice connection.\n */\nexport interface VoiceUserData {\n\t/**\n\t * The SSRC of the user's audio stream.\n\t */\n\taudioSSRC: number;\n\n\t/**\n\t * The Discord user id of the user.\n\t */\n\tuserId: string;\n\n\t/**\n\t * The SSRC of the user's video stream (if one exists)\n\t * Cannot be 0. If undefined, the user has no video stream.\n\t */\n\tvideoSSRC?: number;\n}\n\nexport interface SSRCMap extends EventEmitter {\n\ton(event: 'create', listener: (newData: VoiceUserData) => void): this;\n\ton(event: 'update', listener: (oldData: VoiceUserData | undefined, newData: VoiceUserData) => void): this;\n\ton(event: 'delete', listener: (deletedData: VoiceUserData) => void): this;\n}\n\n/**\n * Maps audio SSRCs to data of users in voice connections.\n */\nexport class SSRCMap extends EventEmitter {\n\t/**\n\t * The underlying map.\n\t */\n\tprivate readonly map: Map;\n\n\tpublic constructor() {\n\t\tsuper();\n\t\tthis.map = new Map();\n\t}\n\n\t/**\n\t * Updates the map with new user data\n\t *\n\t * @param data - The data to update with\n\t */\n\tpublic update(data: VoiceUserData) {\n\t\tconst existing = this.map.get(data.audioSSRC);\n\n\t\tconst newValue = {\n\t\t\t...this.map.get(data.audioSSRC),\n\t\t\t...data,\n\t\t};\n\n\t\tthis.map.set(data.audioSSRC, newValue);\n\t\tif (!existing) this.emit('create', newValue);\n\t\tthis.emit('update', existing, newValue);\n\t}\n\n\t/**\n\t * Gets the stored voice data of a user.\n\t *\n\t * @param target - The target, either their user id or audio SSRC\n\t */\n\tpublic get(target: number | string) {\n\t\tif (typeof target === 'number') {\n\t\t\treturn this.map.get(target);\n\t\t}\n\n\t\tfor (const data of this.map.values()) {\n\t\t\tif (data.userId === target) {\n\t\t\t\treturn data;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Deletes the stored voice data about a user.\n\t *\n\t * @param target - The target of the delete operation, either their audio SSRC or user id\n\t * @returns The data that was deleted, if any\n\t */\n\tpublic delete(target: number | string) {\n\t\tif (typeof target === 'number') {\n\t\t\tconst existing = this.map.get(target);\n\t\t\tif (existing) {\n\t\t\t\tthis.map.delete(target);\n\t\t\t\tthis.emit('delete', existing);\n\t\t\t}\n\n\t\t\treturn existing;\n\t\t}\n\n\t\tfor (const [audioSSRC, data] of this.map.entries()) {\n\t\t\tif (data.userId === target) {\n\t\t\t\tthis.map.delete(audioSSRC);\n\t\t\t\tthis.emit('delete', data);\n\t\t\t\treturn data;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n","/* eslint-disable @typescript-eslint/unified-signatures */\nimport { EventEmitter } from 'node:events';\n\nexport interface SpeakingMap extends EventEmitter {\n\t/**\n\t * Emitted when a user starts speaking.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'start', listener: (userId: string) => void): this;\n\n\t/**\n\t * Emitted when a user ends speaking.\n\t *\n\t * @eventProperty\n\t */\n\ton(event: 'end', listener: (userId: string) => void): this;\n}\n\n/**\n * Tracks the speaking states of users in a voice channel.\n */\nexport class SpeakingMap extends EventEmitter {\n\t/**\n\t * The delay after a packet is received from a user until they're marked as not speaking anymore.\n\t */\n\tpublic static readonly DELAY = 100;\n\n\t/**\n\t * The currently speaking users, mapped to the milliseconds since UNIX epoch at which they started speaking.\n\t */\n\tpublic readonly users: Map;\n\n\tprivate readonly speakingTimeouts: Map;\n\n\tpublic constructor() {\n\t\tsuper();\n\t\tthis.users = new Map();\n\t\tthis.speakingTimeouts = new Map();\n\t}\n\n\tpublic onPacket(userId: string) {\n\t\tconst timeout = this.speakingTimeouts.get(userId);\n\t\tif (timeout) {\n\t\t\tclearTimeout(timeout);\n\t\t} else {\n\t\t\tthis.users.set(userId, Date.now());\n\t\t\tthis.emit('start', userId);\n\t\t}\n\n\t\tthis.startTimeout(userId);\n\t}\n\n\tprivate startTimeout(userId: string) {\n\t\tthis.speakingTimeouts.set(\n\t\t\tuserId,\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.emit('end', userId);\n\t\t\t\tthis.speakingTimeouts.delete(userId);\n\t\t\t\tthis.users.delete(userId);\n\t\t\t}, SpeakingMap.DELAY),\n\t\t);\n\t}\n}\n","import type { JoinConfig } from './DataStore';\nimport { createVoiceConnection } from './VoiceConnection';\nimport type { DiscordGatewayAdapterCreator } from './util/adapter';\n\n/**\n * The options that can be given when creating a voice connection.\n */\nexport interface CreateVoiceConnectionOptions {\n\tadapterCreator: DiscordGatewayAdapterCreator;\n\n\t/**\n\t * Whether to use the DAVE protocol for end-to-end encryption. Defaults to true.\n\t */\n\tdaveEncryption?: boolean | undefined;\n\n\t/**\n\t * If true, debug messages will be enabled for the voice connection and its\n\t * related components. Defaults to false.\n\t */\n\tdebug?: boolean | undefined;\n\n\t/**\n\t * The amount of consecutive decryption failures needed to try to\n\t * re-initialize the end-to-end encrypted session to recover. Defaults to 24.\n\t */\n\tdecryptionFailureTolerance?: number | undefined;\n}\n\n/**\n * The options that can be given when joining a voice channel.\n */\nexport interface JoinVoiceChannelOptions {\n\t/**\n\t * The id of the Discord voice channel to join.\n\t */\n\tchannelId: string;\n\n\t/**\n\t * An optional group identifier for the voice connection.\n\t */\n\tgroup?: string;\n\n\t/**\n\t * The id of the guild that the voice channel belongs to.\n\t */\n\tguildId: string;\n\n\t/**\n\t * Whether to join the channel deafened (defaults to true)\n\t */\n\tselfDeaf?: boolean;\n\n\t/**\n\t * Whether to join the channel muted (defaults to true)\n\t */\n\tselfMute?: boolean;\n}\n\n/**\n * Creates a VoiceConnection to a Discord voice channel.\n *\n * @param options - the options for joining the voice channel\n */\nexport function joinVoiceChannel(options: CreateVoiceConnectionOptions & JoinVoiceChannelOptions) {\n\tconst joinConfig: JoinConfig = {\n\t\tselfDeaf: true,\n\t\tselfMute: false,\n\t\tgroup: 'default',\n\t\t...options,\n\t};\n\n\treturn createVoiceConnection(joinConfig, {\n\t\tadapterCreator: options.adapterCreator,\n\t\tdebug: options.debug,\n\t\tdaveEncryption: options.daveEncryption,\n\t\tdecryptionFailureTolerance: options.decryptionFailureTolerance,\n\t});\n}\n","import type { Buffer } from 'node:buffer';\nimport { pipeline, type Readable } from 'node:stream';\nimport prism from 'prism-media';\nimport { noop } from '../util/util';\nimport { SILENCE_FRAME, type AudioPlayer } from './AudioPlayer';\nimport { findPipeline, StreamType, TransformerType, type Edge } from './TransformerGraph';\n\n/**\n * Options that are set when creating a new audio resource.\n *\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport interface CreateAudioResourceOptions {\n\t/**\n\t * Whether or not inline volume should be enabled. If enabled, you will be able to change the volume\n\t * of the stream on-the-fly. However, this also increases the performance cost of playback. Defaults to `false`.\n\t */\n\tinlineVolume?: boolean;\n\n\t/**\n\t * The type of the input stream. Defaults to `StreamType.Arbitrary`.\n\t */\n\tinputType?: StreamType;\n\n\t/**\n\t * Optional metadata that can be attached to the resource (e.g. track title, random id).\n\t * This is useful for identification purposes when the resource is passed around in events.\n\t * See {@link AudioResource.metadata}\n\t */\n\tmetadata?: Metadata;\n\n\t/**\n\t * The number of silence frames to append to the end of the resource's audio stream, to prevent interpolation glitches.\n\t * Defaults to 5.\n\t */\n\tsilencePaddingFrames?: number;\n}\n\n/**\n * Represents an audio resource that can be played by an audio player.\n *\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport class AudioResource {\n\t/**\n\t * An object-mode Readable stream that emits Opus packets. This is what is played by audio players.\n\t */\n\tpublic readonly playStream: Readable;\n\n\t/**\n\t * The pipeline used to convert the input stream into a playable format. For example, this may\n\t * contain an FFmpeg component for arbitrary inputs, and it may contain a VolumeTransformer component\n\t * for resources with inline volume transformation enabled.\n\t */\n\tpublic readonly edges: readonly Edge[];\n\n\t/**\n\t * Optional metadata that can be used to identify the resource.\n\t */\n\tpublic metadata: Metadata;\n\n\t/**\n\t * If the resource was created with inline volume transformation enabled, then this will be a\n\t * prism-media VolumeTransformer. You can use this to alter the volume of the stream.\n\t */\n\tpublic readonly volume?: prism.VolumeTransformer;\n\n\t/**\n\t * If using an Opus encoder to create this audio resource, then this will be a prism-media opus.Encoder.\n\t * You can use this to control settings such as bitrate, FEC, PLP.\n\t */\n\tpublic readonly encoder?: prism.opus.Encoder;\n\n\t/**\n\t * The audio player that the resource is subscribed to, if any.\n\t */\n\tpublic audioPlayer?: AudioPlayer | undefined;\n\n\t/**\n\t * The playback duration of this audio resource, given in milliseconds.\n\t */\n\tpublic playbackDuration = 0;\n\n\t/**\n\t * Whether or not the stream for this resource has started (data has become readable)\n\t */\n\tpublic started = false;\n\n\t/**\n\t * The number of silence frames to append to the end of the resource's audio stream, to prevent interpolation glitches.\n\t */\n\tpublic readonly silencePaddingFrames: number;\n\n\t/**\n\t * The number of remaining silence frames to play. If -1, the frames have not yet started playing.\n\t */\n\tpublic silenceRemaining = -1;\n\n\tpublic constructor(\n\t\tedges: readonly Edge[],\n\t\tstreams: readonly Readable[],\n\t\tmetadata: Metadata,\n\t\tsilencePaddingFrames: number,\n\t) {\n\t\tthis.edges = edges;\n\t\tthis.playStream = streams.length > 1 ? (pipeline(streams, noop) as any as Readable) : streams[0]!;\n\t\tthis.metadata = metadata;\n\t\tthis.silencePaddingFrames = silencePaddingFrames;\n\n\t\tfor (const stream of streams) {\n\t\t\tif (stream instanceof prism.VolumeTransformer) {\n\t\t\t\tthis.volume = stream;\n\t\t\t} else if (stream instanceof prism.opus.Encoder) {\n\t\t\t\tthis.encoder = stream;\n\t\t\t}\n\t\t}\n\n\t\tthis.playStream.once('readable', () => (this.started = true));\n\t}\n\n\t/**\n\t * Whether this resource is readable. If the underlying resource is no longer readable, this will still return true\n\t * while there are silence padding frames left to play.\n\t */\n\tpublic get readable() {\n\t\tif (this.silenceRemaining === 0) return false;\n\t\tconst real = this.playStream.readable;\n\t\tif (!real) {\n\t\t\tif (this.silenceRemaining === -1) this.silenceRemaining = this.silencePaddingFrames;\n\t\t\treturn this.silenceRemaining !== 0;\n\t\t}\n\n\t\treturn real;\n\t}\n\n\t/**\n\t * Whether this resource has ended or not.\n\t */\n\tpublic get ended() {\n\t\treturn this.playStream.readableEnded || this.playStream.destroyed || this.silenceRemaining === 0;\n\t}\n\n\t/**\n\t * Attempts to read an Opus packet from the audio resource. If a packet is available, the playbackDuration\n\t * is incremented.\n\t *\n\t * @remarks\n\t * It is advisable to check that the playStream is readable before calling this method. While no runtime\n\t * errors will be thrown, you should check that the resource is still available before attempting to\n\t * read from it.\n\t * @internal\n\t */\n\tpublic read(): Buffer | null {\n\t\tif (this.silenceRemaining === 0) {\n\t\t\treturn null;\n\t\t} else if (this.silenceRemaining > 0) {\n\t\t\tthis.silenceRemaining--;\n\t\t\treturn SILENCE_FRAME;\n\t\t}\n\n\t\tconst packet = this.playStream.read() as Buffer | null;\n\t\tif (packet) {\n\t\t\tthis.playbackDuration += 20;\n\t\t}\n\n\t\treturn packet;\n\t}\n}\n\n/**\n * Ensures that a path contains at least one volume transforming component.\n *\n * @param path - The path to validate constraints on\n */\nexport const VOLUME_CONSTRAINT = (path: Edge[]) => path.some((edge) => edge.type === TransformerType.InlineVolume);\n\nexport const NO_CONSTRAINT = () => true;\n\n/**\n * Tries to infer the type of a stream to aid with transcoder pipelining.\n *\n * @param stream - The stream to infer the type of\n */\nexport function inferStreamType(stream: Readable): {\n\thasVolume: boolean;\n\tstreamType: StreamType;\n} {\n\tif (stream instanceof prism.opus.Encoder) {\n\t\treturn { streamType: StreamType.Opus, hasVolume: false };\n\t} else if (stream instanceof prism.opus.Decoder) {\n\t\treturn { streamType: StreamType.Raw, hasVolume: false };\n\t} else if (stream instanceof prism.VolumeTransformer) {\n\t\treturn { streamType: StreamType.Raw, hasVolume: true };\n\t} else if (stream instanceof prism.opus.OggDemuxer) {\n\t\treturn { streamType: StreamType.Opus, hasVolume: false };\n\t} else if (stream instanceof prism.opus.WebmDemuxer) {\n\t\treturn { streamType: StreamType.Opus, hasVolume: false };\n\t}\n\n\treturn { streamType: StreamType.Arbitrary, hasVolume: false };\n}\n\n/**\n * Creates an audio resource that can be played by audio players.\n *\n * @remarks\n * If the input is given as a string, then the inputType option will be overridden and FFmpeg will be used.\n *\n * If the input is not in the correct format, then a pipeline of transcoders and transformers will be created\n * to ensure that the resultant stream is in the correct format for playback. This could involve using FFmpeg,\n * Opus transcoders, and Ogg/WebM demuxers.\n * @param input - The resource to play\n * @param options - Configurable options for creating the resource\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport function createAudioResource(\n\tinput: Readable | string,\n\toptions: CreateAudioResourceOptions &\n\t\tPick<\n\t\t\tMetadata extends null | undefined\n\t\t\t\t? CreateAudioResourceOptions\n\t\t\t\t: Required>,\n\t\t\t'metadata'\n\t\t>,\n): AudioResource;\n\n/**\n * Creates an audio resource that can be played by audio players.\n *\n * @remarks\n * If the input is given as a string, then the inputType option will be overridden and FFmpeg will be used.\n *\n * If the input is not in the correct format, then a pipeline of transcoders and transformers will be created\n * to ensure that the resultant stream is in the correct format for playback. This could involve using FFmpeg,\n * Opus transcoders, and Ogg/WebM demuxers.\n * @param input - The resource to play\n * @param options - Configurable options for creating the resource\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport function createAudioResource(\n\tinput: Readable | string,\n\toptions?: Omit, 'metadata'>,\n): AudioResource;\n\n/**\n * Creates an audio resource that can be played by audio players.\n *\n * @remarks\n * If the input is given as a string, then the inputType option will be overridden and FFmpeg will be used.\n *\n * If the input is not in the correct format, then a pipeline of transcoders and transformers will be created\n * to ensure that the resultant stream is in the correct format for playback. This could involve using FFmpeg,\n * Opus transcoders, and Ogg/WebM demuxers.\n * @param input - The resource to play\n * @param options - Configurable options for creating the resource\n * @typeParam Metadata - the type for the metadata (if any) of the audio resource\n */\nexport function createAudioResource(\n\tinput: Readable | string,\n\toptions: CreateAudioResourceOptions = {},\n): AudioResource {\n\tlet inputType = options.inputType;\n\tlet needsInlineVolume = Boolean(options.inlineVolume);\n\n\t// string inputs can only be used with FFmpeg\n\tif (typeof input === 'string') {\n\t\tinputType = StreamType.Arbitrary;\n\t} else if (inputType === undefined) {\n\t\tconst analysis = inferStreamType(input);\n\t\tinputType = analysis.streamType;\n\t\tneedsInlineVolume = needsInlineVolume && !analysis.hasVolume;\n\t}\n\n\tconst transformerPipeline = findPipeline(inputType, needsInlineVolume ? VOLUME_CONSTRAINT : NO_CONSTRAINT);\n\n\tif (transformerPipeline.length === 0) {\n\t\tif (typeof input === 'string') throw new Error(`Invalid pipeline constructed for string resource '${input}'`);\n\t\t// No adjustments required\n\t\treturn new AudioResource(\n\t\t\t[],\n\t\t\t[input],\n\t\t\t(options.metadata ?? null) as Metadata,\n\t\t\toptions.silencePaddingFrames ?? 5,\n\t\t);\n\t}\n\n\tconst streams = transformerPipeline.map((edge) => edge.transformer(input));\n\tif (typeof input !== 'string') streams.unshift(input);\n\n\treturn new AudioResource(\n\t\ttransformerPipeline,\n\t\tstreams,\n\t\t(options.metadata ?? null) as Metadata,\n\t\toptions.silencePaddingFrames ?? 5,\n\t);\n}\n","import type { Readable } from 'node:stream';\nimport prism from 'prism-media';\n\n/**\n * This module creates a Transformer Graph to figure out what the most efficient way\n * of transforming the input stream into something playable would be.\n */\n\nconst FFMPEG_PCM_ARGUMENTS = ['-analyzeduration', '0', '-loglevel', '0', '-f', 's16le', '-ar', '48000', '-ac', '2'];\nconst FFMPEG_OPUS_ARGUMENTS = [\n\t'-analyzeduration',\n\t'0',\n\t'-loglevel',\n\t'0',\n\t'-acodec',\n\t'libopus',\n\t'-f',\n\t'opus',\n\t'-ar',\n\t'48000',\n\t'-ac',\n\t'2',\n];\n\n/**\n * The different types of stream that can exist within the pipeline.\n */\nexport enum StreamType {\n\t/**\n\t * The type of the stream at this point is unknown.\n\t */\n\tArbitrary = 'arbitrary',\n\t/**\n\t * The stream at this point is Opus audio encoded in an Ogg wrapper.\n\t */\n\tOggOpus = 'ogg/opus',\n\t/**\n\t * The stream at this point is Opus audio, and the stream is in object-mode. This is ready to play.\n\t */\n\tOpus = 'opus',\n\t/**\n\t * The stream at this point is s16le PCM.\n\t */\n\tRaw = 'raw',\n\t/**\n\t * The stream at this point is Opus audio encoded in a WebM wrapper.\n\t */\n\tWebmOpus = 'webm/opus',\n}\n\n/**\n * The different types of transformers that can exist within the pipeline.\n */\nexport enum TransformerType {\n\tFFmpegOgg = 'ffmpeg ogg',\n\tFFmpegPCM = 'ffmpeg pcm',\n\tInlineVolume = 'volume transformer',\n\tOggOpusDemuxer = 'ogg/opus demuxer',\n\tOpusDecoder = 'opus decoder',\n\tOpusEncoder = 'opus encoder',\n\tWebmOpusDemuxer = 'webm/opus demuxer',\n}\n\n/**\n * Represents a pathway from one stream type to another using a transformer.\n */\nexport interface Edge {\n\tcost: number;\n\tfrom: Node;\n\tto: Node;\n\ttransformer(input: Readable | string): Readable;\n\ttype: TransformerType;\n}\n\n/**\n * Represents a type of stream within the graph, e.g. an Opus stream, or a stream of raw audio.\n */\nexport class Node {\n\t/**\n\t * The outbound edges from this node.\n\t */\n\tpublic readonly edges: Edge[] = [];\n\n\t/**\n\t * The type of stream for this node.\n\t */\n\tpublic readonly type: StreamType;\n\n\tpublic constructor(type: StreamType) {\n\t\tthis.type = type;\n\t}\n\n\t/**\n\t * Creates an outbound edge from this node.\n\t *\n\t * @param edge - The edge to create\n\t */\n\tpublic addEdge(edge: Omit) {\n\t\tthis.edges.push({ ...edge, from: this });\n\t}\n}\n\n// Create a node for each stream type\nlet NODES: Map | null = null;\n\n/**\n * Gets a node from its stream type.\n *\n * @param type - The stream type of the target node\n */\nexport function getNode(type: StreamType) {\n\tconst node = (NODES ??= initializeNodes()).get(type);\n\tif (!node) throw new Error(`Node type '${type}' does not exist!`);\n\treturn node;\n}\n\n// Try to enable FFmpeg Ogg optimizations\nfunction canEnableFFmpegOptimizations(): boolean {\n\ttry {\n\t\treturn prism.FFmpeg.getInfo().output.includes('--enable-libopus');\n\t} catch {}\n\n\treturn false;\n}\n\nfunction initializeNodes(): Map {\n\tconst nodes = new Map();\n\tfor (const streamType of Object.values(StreamType)) {\n\t\tnodes.set(streamType, new Node(streamType));\n\t}\n\n\tnodes.get(StreamType.Raw)!.addEdge({\n\t\ttype: TransformerType.OpusEncoder,\n\t\tto: nodes.get(StreamType.Opus)!,\n\t\tcost: 1.5,\n\t\ttransformer: () => new prism.opus.Encoder({ rate: 48_000, channels: 2, frameSize: 960 }),\n\t});\n\n\tnodes.get(StreamType.Opus)!.addEdge({\n\t\ttype: TransformerType.OpusDecoder,\n\t\tto: nodes.get(StreamType.Raw)!,\n\t\tcost: 1.5,\n\t\ttransformer: () => new prism.opus.Decoder({ rate: 48_000, channels: 2, frameSize: 960 }),\n\t});\n\n\tnodes.get(StreamType.OggOpus)!.addEdge({\n\t\ttype: TransformerType.OggOpusDemuxer,\n\t\tto: nodes.get(StreamType.Opus)!,\n\t\tcost: 1,\n\t\ttransformer: () => new prism.opus.OggDemuxer(),\n\t});\n\n\tnodes.get(StreamType.WebmOpus)!.addEdge({\n\t\ttype: TransformerType.WebmOpusDemuxer,\n\t\tto: nodes.get(StreamType.Opus)!,\n\t\tcost: 1,\n\t\ttransformer: () => new prism.opus.WebmDemuxer(),\n\t});\n\n\tconst FFMPEG_PCM_EDGE: Omit = {\n\t\ttype: TransformerType.FFmpegPCM,\n\t\tto: nodes.get(StreamType.Raw)!,\n\t\tcost: 2,\n\t\ttransformer: (input) =>\n\t\t\tnew prism.FFmpeg({\n\t\t\t\targs: ['-i', typeof input === 'string' ? input : '-', ...FFMPEG_PCM_ARGUMENTS],\n\t\t\t}),\n\t};\n\n\tnodes.get(StreamType.Arbitrary)!.addEdge(FFMPEG_PCM_EDGE);\n\tnodes.get(StreamType.OggOpus)!.addEdge(FFMPEG_PCM_EDGE);\n\tnodes.get(StreamType.WebmOpus)!.addEdge(FFMPEG_PCM_EDGE);\n\n\tnodes.get(StreamType.Raw)!.addEdge({\n\t\ttype: TransformerType.InlineVolume,\n\t\tto: nodes.get(StreamType.Raw)!,\n\t\tcost: 0.5,\n\t\ttransformer: () => new prism.VolumeTransformer({ type: 's16le' }),\n\t});\n\n\tif (canEnableFFmpegOptimizations()) {\n\t\tconst FFMPEG_OGG_EDGE: Omit = {\n\t\t\ttype: TransformerType.FFmpegOgg,\n\t\t\tto: nodes.get(StreamType.OggOpus)!,\n\t\t\tcost: 2,\n\t\t\ttransformer: (input) =>\n\t\t\t\tnew prism.FFmpeg({\n\t\t\t\t\targs: ['-i', typeof input === 'string' ? input : '-', ...FFMPEG_OPUS_ARGUMENTS],\n\t\t\t\t}),\n\t\t};\n\t\tnodes.get(StreamType.Arbitrary)!.addEdge(FFMPEG_OGG_EDGE);\n\t\t// Include Ogg and WebM as well in case they have different sampling rates or are mono instead of stereo\n\t\t// at the moment, this will not do anything. However, if/when detection for correct Opus headers is\n\t\t// implemented, this will help inform the voice engine that it is able to transcode the audio.\n\t\tnodes.get(StreamType.OggOpus)!.addEdge(FFMPEG_OGG_EDGE);\n\t\tnodes.get(StreamType.WebmOpus)!.addEdge(FFMPEG_OGG_EDGE);\n\t}\n\n\treturn nodes;\n}\n\n/**\n * Represents a step in the path from node A to node B.\n */\ninterface Step {\n\t/**\n\t * The cost of the steps after this step.\n\t */\n\tcost: number;\n\n\t/**\n\t * The edge associated with this step.\n\t */\n\tedge?: Edge;\n\n\t/**\n\t * The next step.\n\t */\n\tnext?: Step;\n}\n\n/**\n * Finds the shortest cost path from node A to node B.\n *\n * @param from - The start node\n * @param constraints - Extra validation for a potential solution. Takes a path, returns true if the path is valid\n * @param goal - The target node\n * @param path - The running path\n * @param depth - The number of remaining recursions\n */\nfunction findPath(\n\tfrom: Node,\n\tconstraints: (path: Edge[]) => boolean,\n\tgoal = getNode(StreamType.Opus),\n\tpath: Edge[] = [],\n\tdepth = 5,\n): Step {\n\tif (from === goal && constraints(path)) {\n\t\treturn { cost: 0 };\n\t} else if (depth === 0) {\n\t\treturn { cost: Number.POSITIVE_INFINITY };\n\t}\n\n\tlet currentBest: Step | undefined;\n\tfor (const edge of from.edges) {\n\t\tif (currentBest && edge.cost > currentBest.cost) continue;\n\t\tconst next = findPath(edge.to, constraints, goal, [...path, edge], depth - 1);\n\t\tconst cost = edge.cost + next.cost;\n\t\tif (!currentBest || cost < currentBest.cost) {\n\t\t\tcurrentBest = { cost, edge, next };\n\t\t}\n\t}\n\n\treturn currentBest ?? { cost: Number.POSITIVE_INFINITY };\n}\n\n/**\n * Takes the solution from findPath and assembles it into a list of edges.\n *\n * @param step - The first step of the path\n */\nfunction constructPipeline(step: Step) {\n\tconst edges = [];\n\tlet current: Step | undefined = step;\n\twhile (current?.edge) {\n\t\tedges.push(current.edge);\n\t\tcurrent = current.next;\n\t}\n\n\treturn edges;\n}\n\n/**\n * Finds the lowest-cost pipeline to convert the input stream type into an Opus stream.\n *\n * @param from - The stream type to start from\n * @param constraint - Extra constraints that may be imposed on potential solution\n */\nexport function findPipeline(from: StreamType, constraint: (path: Edge[]) => boolean) {\n\treturn constructPipeline(findPath(getNode(from), constraint));\n}\n","/* eslint-disable @typescript-eslint/no-var-requires */\n/* eslint-disable @typescript-eslint/no-require-imports */\nimport { getCiphers } from 'node:crypto';\nimport { resolve, dirname } from 'node:path';\nimport prism from 'prism-media';\n\n/**\n * Tries to find the package.json file for a given module.\n *\n * @param dir - The directory to look in\n * @param packageName - The name of the package to look for\n * @param depth - The maximum recursion depth\n */\nfunction findPackageJSON(\n\tdir: string,\n\tpackageName: string,\n\tdepth: number,\n): { name: string; version: string } | undefined {\n\tif (depth === 0) return undefined;\n\tconst attemptedPath = resolve(dir, './package.json');\n\ttry {\n\t\tconst pkg = require(attemptedPath);\n\t\tif (pkg.name !== packageName) throw new Error('package.json does not match');\n\t\treturn pkg;\n\t} catch {\n\t\treturn findPackageJSON(resolve(dir, '..'), packageName, depth - 1);\n\t}\n}\n\n/**\n * Tries to find the version of a dependency.\n *\n * @param name - The package to find the version of\n */\nfunction version(name: string): string {\n\ttry {\n\t\tif (name === '@discordjs/voice') {\n\t\t\treturn '0.19.0';\n\t\t}\n\n\t\tconst pkg = findPackageJSON(dirname(require.resolve(name)), name, 3);\n\t\treturn pkg?.version ?? 'not found';\n\t} catch {\n\t\treturn 'not found';\n\t}\n}\n\n/**\n * Generates a report of the dependencies used by the \\@discordjs/voice module.\n * Useful for debugging.\n */\nexport function generateDependencyReport() {\n\tconst report = [];\n\tconst addVersion = (name: string) => report.push(`- ${name}: ${version(name)}`);\n\t// general\n\treport.push('Core Dependencies');\n\taddVersion('@discordjs/voice');\n\taddVersion('prism-media');\n\treport.push('');\n\n\t// opus\n\treport.push('Opus Libraries');\n\taddVersion('@discordjs/opus');\n\taddVersion('opusscript');\n\treport.push('');\n\n\t// encryption\n\treport.push('Encryption Libraries');\n\treport.push(`- native crypto support for aes-256-gcm: ${getCiphers().includes('aes-256-gcm') ? 'yes' : 'no'}`);\n\taddVersion('sodium-native');\n\taddVersion('sodium');\n\taddVersion('libsodium-wrappers');\n\taddVersion('@stablelib/xchacha20poly1305');\n\taddVersion('@noble/ciphers');\n\treport.push('');\n\n\t// dave\n\treport.push('DAVE Libraries');\n\taddVersion('@snazzah/davey');\n\treport.push('');\n\n\t// ffmpeg\n\treport.push('FFmpeg');\n\ttry {\n\t\tconst info = prism.FFmpeg.getInfo();\n\t\treport.push(`- version: ${info.version}`);\n\t\treport.push(`- libopus: ${info.output.includes('--enable-libopus') ? 'yes' : 'no'}`);\n\t} catch {\n\t\treport.push('- not found');\n\t}\n\n\treturn ['-'.repeat(50), ...report, '-'.repeat(50)].join('\\n');\n}\n","import { type EventEmitter, once } from 'node:events';\nimport type { VoiceConnection, VoiceConnectionStatus } from '../VoiceConnection';\nimport type { AudioPlayer, AudioPlayerStatus } from '../audio/AudioPlayer';\nimport { abortAfter } from './abortAfter';\n\n/**\n * Allows a voice connection a specified amount of time to enter a given state, otherwise rejects with an error.\n *\n * @param target - The voice connection that we want to observe the state change for\n * @param status - The status that the voice connection should be in\n * @param timeoutOrSignal - The maximum time we are allowing for this to occur, or a signal that will abort the operation\n */\nexport function entersState(\n\ttarget: VoiceConnection,\n\tstatus: VoiceConnectionStatus,\n\ttimeoutOrSignal: AbortSignal | number,\n): Promise;\n\n/**\n * Allows an audio player a specified amount of time to enter a given state, otherwise rejects with an error.\n *\n * @param target - The audio player that we want to observe the state change for\n * @param status - The status that the audio player should be in\n * @param timeoutOrSignal - The maximum time we are allowing for this to occur, or a signal that will abort the operation\n */\nexport function entersState(\n\ttarget: AudioPlayer,\n\tstatus: AudioPlayerStatus,\n\ttimeoutOrSignal: AbortSignal | number,\n): Promise;\n\n/**\n * Allows a target a specified amount of time to enter a given state, otherwise rejects with an error.\n *\n * @param target - The object that we want to observe the state change for\n * @param status - The status that the target should be in\n * @param timeoutOrSignal - The maximum time we are allowing for this to occur, or a signal that will abort the operation\n */\nexport async function entersState(\n\ttarget: Target,\n\tstatus: AudioPlayerStatus | VoiceConnectionStatus,\n\ttimeoutOrSignal: AbortSignal | number,\n) {\n\tif (target.state.status !== status) {\n\t\tconst [ac, signal] =\n\t\t\ttypeof timeoutOrSignal === 'number' ? abortAfter(timeoutOrSignal) : [undefined, timeoutOrSignal];\n\t\ttry {\n\t\t\tawait once(target as EventEmitter, status, { signal });\n\t\t} finally {\n\t\t\tac?.abort();\n\t\t}\n\t}\n\n\treturn target;\n}\n","/**\n * Creates an abort controller that aborts after the given time.\n *\n * @param delay - The time in milliseconds to wait before aborting\n */\nexport function abortAfter(delay: number): [AbortController, AbortSignal] {\n\tconst ac = new AbortController();\n\tconst timeout = setTimeout(() => ac.abort(), delay);\n\tac.signal.addEventListener('abort', () => clearTimeout(timeout));\n\treturn [ac, ac.signal];\n}\n","import { Buffer } from 'node:buffer';\nimport process from 'node:process';\nimport { Readable } from 'node:stream';\nimport prism from 'prism-media';\nimport { StreamType } from '..';\nimport { noop } from './util';\n\n/**\n * Takes an Opus Head, and verifies whether the associated Opus audio is suitable to play in a Discord voice channel.\n *\n * @param opusHead - The Opus Head to validate\n * @returns `true` if suitable to play in a Discord voice channel, otherwise `false`\n */\nexport function validateDiscordOpusHead(opusHead: Buffer): boolean {\n\tconst channels = opusHead.readUInt8(9);\n\tconst sampleRate = opusHead.readUInt32LE(12);\n\treturn channels === 2 && sampleRate === 48_000;\n}\n\n/**\n * The resulting information after probing an audio stream\n */\nexport interface ProbeInfo {\n\t/**\n\t * The readable audio stream to use. You should use this rather than the input stream, as the probing\n\t * function can sometimes read the input stream to its end and cause the stream to close.\n\t */\n\tstream: Readable;\n\n\t/**\n\t * The recommended stream type for this audio stream.\n\t */\n\ttype: StreamType;\n}\n\n/**\n * Attempt to probe a readable stream to figure out whether it can be demuxed using an Ogg or WebM Opus demuxer.\n *\n * @param stream - The readable stream to probe\n * @param probeSize - The number of bytes to attempt to read before giving up on the probe\n * @param validator - The Opus Head validator function\n * @experimental\n */\nexport async function demuxProbe(\n\tstream: Readable,\n\tprobeSize = 1_024,\n\tvalidator = validateDiscordOpusHead,\n): Promise {\n\treturn new Promise((resolve, reject) => {\n\t\t// Preconditions\n\t\tif (stream.readableObjectMode) {\n\t\t\treject(new Error('Cannot probe a readable stream in object mode'));\n\t\t\treturn;\n\t\t}\n\n\t\tif (stream.readableEnded) {\n\t\t\treject(new Error('Cannot probe a stream that has ended'));\n\t\t\treturn;\n\t\t}\n\n\t\tlet readBuffer = Buffer.alloc(0);\n\n\t\tlet resolved: StreamType | undefined;\n\n\t\tconst finish = (type: StreamType) => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\t\tstream.off('data', onData);\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\t\tstream.off('close', onClose);\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\t\tstream.off('end', onClose);\n\t\t\tstream.pause();\n\t\t\tresolved = type;\n\t\t\tif (stream.readableEnded) {\n\t\t\t\tresolve({\n\t\t\t\t\tstream: Readable.from(readBuffer),\n\t\t\t\t\ttype,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (readBuffer.length > 0) {\n\t\t\t\t\tstream.push(readBuffer);\n\t\t\t\t}\n\n\t\t\t\tresolve({\n\t\t\t\t\tstream,\n\t\t\t\t\ttype,\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tconst foundHead = (type: StreamType) => (head: Buffer) => {\n\t\t\tif (validator(head)) {\n\t\t\t\tfinish(type);\n\t\t\t}\n\t\t};\n\n\t\tconst webm = new prism.opus.WebmDemuxer();\n\t\twebm.once('error', noop);\n\t\twebm.on('head', foundHead(StreamType.WebmOpus));\n\n\t\tconst ogg = new prism.opus.OggDemuxer();\n\t\togg.once('error', noop);\n\t\togg.on('head', foundHead(StreamType.OggOpus));\n\n\t\tconst onClose = () => {\n\t\t\tif (!resolved) {\n\t\t\t\tfinish(StreamType.Arbitrary);\n\t\t\t}\n\t\t};\n\n\t\tconst onData = (buffer: Buffer) => {\n\t\t\treadBuffer = Buffer.concat([readBuffer, buffer]);\n\n\t\t\twebm.write(buffer);\n\t\t\togg.write(buffer);\n\n\t\t\tif (readBuffer.length >= probeSize) {\n\t\t\t\tstream.off('data', onData);\n\t\t\t\tstream.pause();\n\t\t\t\tprocess.nextTick(onClose);\n\t\t\t}\n\t\t};\n\n\t\tstream.once('error', reject);\n\t\tstream.on('data', onData);\n\t\tstream.once('close', onClose);\n\t\tstream.once('end', onClose);\n\t});\n}\n","export * from './joinVoiceChannel';\nexport * from './audio/index';\nexport * from './util/index';\nexport * from './receive/index';\n\nexport {\n\tNetworking,\n\ttype ConnectionData,\n\ttype ConnectionOptions,\n\ttype NetworkingState,\n\ttype NetworkingResumingState,\n\ttype NetworkingSelectingProtocolState,\n\ttype NetworkingUdpHandshakingState,\n\ttype NetworkingClosedState,\n\ttype NetworkingIdentifyingState,\n\ttype NetworkingOpeningWsState,\n\ttype NetworkingReadyState,\n\tNetworkingStatusCode,\n\tVoiceUDPSocket,\n\tVoiceWebSocket,\n\ttype SocketConfig,\n\tDAVESession,\n} from './networking/index.js';\n\nexport {\n\tVoiceConnection,\n\ttype VoiceConnectionState,\n\tVoiceConnectionStatus,\n\ttype VoiceConnectionConnectingState,\n\ttype VoiceConnectionDestroyedState,\n\ttype VoiceConnectionDisconnectedState,\n\ttype VoiceConnectionDisconnectedBaseState,\n\ttype VoiceConnectionDisconnectedOtherState,\n\ttype VoiceConnectionDisconnectedWebSocketState,\n\tVoiceConnectionDisconnectReason,\n\ttype VoiceConnectionReadyState,\n\ttype VoiceConnectionSignallingState,\n} from './VoiceConnection';\n\nexport { type JoinConfig, getVoiceConnection, getVoiceConnections, getGroups } from './DataStore';\n\n/**\n * The {@link https://github.com/discordjs/discord.js/blob/main/packages/voice#readme | @discordjs/voice} version\n * that you are currently using.\n */\n// This needs to explicitly be `string` so it is not typed as a \"const string\" that gets injected by esbuild\nexport const version = '0.19.0' as string;\n"],"mappings":";;;;;;;;;;AAEA,SAAS,gBAAAA,qBAAoB;;;ACF7B,SAAS,sBAAsB;AAkBxB,SAAS,8BAA8B,QAAoB;AACjE,SAAO;AAAA,IACN,IAAI,eAAe;AAAA;AAAA,IAEnB,GAAG;AAAA,MACF,UAAU,OAAO;AAAA,MACjB,YAAY,OAAO;AAAA,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QAAQE,UAAS,KAAK,UAAU;AAAA,UAChC;AAAA,QACD,CAAC;AAAA,MACF,OAAO;AACN,YAAI,WAAW,SAAS,GAAG;AAC1B,iBAAO,KAAK,UAAU;AAAA,QACvB;AAEA,QAAAF,SAAQ;AAAA,UACP;AAAA,UACA;AAAA,QACD,CAAC;AAAA,MACF;AAAA,IACD,GAxBe;AA0Bf,UAAM,YAAY,wBAAC,SAAqB,CAAC,SAAiB;AACzD,UAAI,UAAU,IAAI,GAAG;AACpB,eAAO,IAAI;AAAA,MACZ;AAAA,IACD,GAJkB;AAMlB,UAAM,OAAO,IAAIG,OAAM,KAAK,YAAY;AACxC,SAAK,KAAK,SAAS,IAAI;AACvB,SAAK,GAAG,QAAQ,oCAA6B,CAAC;AAE9C,UAAM,MAAM,IAAIA,OAAM,KAAK,WAAW;AACtC,QAAI,KAAK,SAAS,IAAI;AACtB,QAAI,GAAG,QAAQ,kCAA4B,CAAC;AAE5C,UAAM,UAAU,6BAAM;AACrB,UAAI,CAAC,UAAU;AACd,0CAA2B;AAAA,MAC5B;AAAA,IACD,GAJgB;AAMhB,UAAM,SAAS,wBAAC,WAAmB;AAClC,mBAAaF,QAAO,OAAO,CAAC,YAAY,MAAM,CAAC;AAE/C,WAAK,MAAM,MAAM;AACjB,UAAI,MAAM,MAAM;AAEhB,UAAI,WAAW,UAAU,WAAW;AACnC,eAAO,IAAI,QAAQ,MAAM;AACzB,eAAO,MAAM;AACb,gBAAQ,SAAS,OAAO;AAAA,MACzB;AAAA,IACD,GAXe;AAaf,WAAO,KAAK,SAAS,MAAM;AAC3B,WAAO,GAAG,QAAQ,MAAM;AACxB,WAAO,KAAK,SAAS,OAAO;AAC5B,WAAO,KAAK,OAAO,OAAO;AAAA,EAC3B,CAAC;AACF;AArFsB;;;ACGf,IAAMG,WAAU;","names":["EventEmitter","Buffer","EventEmitter","VoiceOpcodes","Buffer","nonce","Buffer","crypto","resolve","Buffer","EventEmitter","Buffer","Buffer","NoSubscriberBehavior","AudioPlayerStatus","resolve","EventEmitter","Buffer","Buffer","EventEmitter","Buffer","EventEmitter","resolve","Buffer","EventEmitter","EventEmitter","Buffer","nonce","NetworkingStatusCode","Buffer","stringifyState","option","EventEmitter","VoiceOpcodes","Buffer","crypto","VoiceOpcodes","EndBehaviorType","EventEmitter","EventEmitter","EventEmitter","EventEmitter","Buffer","VoiceOpcodes","nonce","crypto","VoiceConnectionStatus","VoiceConnectionDisconnectReason","EventEmitter","prism","StreamType","TransformerType","prism","prism","prism","Buffer","Readable","prism","resolve","Buffer","Readable","prism","version"]} \ No newline at end of file diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/README.md b/node_modules/@discordjs/voice/node_modules/discord-api-types/README.md index e05f9e4..dd299b0 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/README.md +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/README.md @@ -77,25 +77,22 @@ import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts'; The exports of each API version is split into three main parts: -- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway. +- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway. -- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway. +- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway. -- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API. +- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API. + - For endpoint options, they will follow the following structure: `REST` where the type represents what it will return. + - For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`. - - For endpoint options, they will follow the following structure: `REST` where the type represents what it will return. + - Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `RESTOAuth2` - - For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`. + - If a type ends with `Result`, then it represents the expected result by calling its accompanying route. + - Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors. - - Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `RESTOAuth2` +- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object). - - If a type ends with `Result`, then it represents the expected result by calling its accompanying route. - - - Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors. - -- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object). - -- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above. +- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above. **A note about how types are documented**: This package will add types only for known and documented properties that are present in Discord's [API Documentation repository](https://github.com/discord/discord-api-docs), that are mentioned in an open pull request, or known through other means _and have received the green light to be used_. diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/common.d.ts b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/common.d.ts index 145c4a1..5909b4c 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/common.d.ts +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/common.d.ts @@ -1,5 +1,5 @@ /** - * https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-query-string-params + * @see {@link https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-query-string-params} */ export interface GatewayURLQuery { v: string; diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/index.mjs b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/index.mjs index fd4ff25..9ba4003 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/index.mjs +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/index.mjs @@ -6,3 +6,4 @@ export const GatewayDispatchEvents = mod.GatewayDispatchEvents; export const GatewayIntentBits = mod.GatewayIntentBits; export const GatewayOpcodes = mod.GatewayOpcodes; export const GatewayVersion = mod.GatewayVersion; +export const VoiceChannelEffectSendAnimationType = mod.VoiceChannelEffectSendAnimationType; diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.d.ts b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.d.ts index e2d063c..f5f24d3 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.d.ts +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.d.ts @@ -2,13 +2,12 @@ * Types extracted from https://discord.com/developers/docs/topics/gateway */ import type { Snowflake } from '../globals'; -import type { GatewayPresenceUpdate } from '../payloads/v10/gateway'; -import type { APIApplication, APIApplicationCommandPermission, APIAutoModerationRule, APIAutoModerationAction, APIChannel, APIEmoji, APIGuild, APIGuildIntegration, APIGuildMember, APIGuildScheduledEvent, APIInteraction, APIMessage, APIRole, APIStageInstance, APISticker, APIThreadChannel, APIThreadMember, APIUnavailableGuild, APIUser, GatewayActivity, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayThreadListSync as RawGatewayThreadListSync, GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate, GatewayVoiceState, InviteTargetType, PresenceUpdateStatus, AutoModerationRuleTriggerType, APIAuditLogEntry, APIEntitlement, ChannelType } from '../payloads/v10/index'; -import type { Nullable } from '../utils/internals'; -export * from './common'; +import type { APIApplication, APIApplicationCommandPermission, APIAutoModerationRule, APIAutoModerationAction, APIChannel, APIEmoji, APIGuild, APIGuildIntegration, APIGuildMember, APIGuildScheduledEvent, APIInteraction, APIRole, APIStageInstance, APISticker, APIThreadChannel, APIThreadMember, APIUnavailableGuild, APIUser, GatewayActivity, GatewayPresenceUpdate, GatewayThreadListSync, GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate, InviteTargetType, PresenceUpdateStatus, AutoModerationRuleTriggerType, APIAuditLogEntry, APIEntitlement, ChannelType, APISubscription, APISoundboardSound, GuildChannelType, ThreadChannelType, APIBaseGuild, APIBaseGuildMember, APIBaseVoiceState, APIBaseVoiceGuildMember, APIGuildMemberJoined, APIFlaggedGuildMember, APIGuildMemberAvatar, APIGuildMemberUser, GatewayGuildMembersChunkPresence, APIBaseMessage, APIVoiceState } from '../payloads/v10/index'; +import type { ReactionType } from '../rest/v10/index'; +export type * from './common'; export declare const GatewayVersion = "10"; /** - * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes + * @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes} */ export declare enum GatewayOpcodes { /** @@ -55,10 +54,14 @@ export declare enum GatewayOpcodes { /** * Sent in response to receiving a heartbeat to acknowledge that it has been received */ - HeartbeatAck = 11 + HeartbeatAck = 11, + /** + * Request information about soundboard sounds in a set of guilds + */ + RequestSoundboardSounds = 31 } /** - * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes + * @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes} */ export declare enum GatewayCloseCodes { /** @@ -68,25 +71,25 @@ export declare enum GatewayCloseCodes { /** * You sent an invalid Gateway opcode or an invalid payload for an opcode. Don't do that! * - * See https://discord.com/developers/docs/topics/gateway-events#payload-structure + * @see {@link https://discord.com/developers/docs/topics/gateway-events#payload-structure} */ UnknownOpcode = 4001, /** * You sent an invalid payload to us. Don't do that! * - * See https://discord.com/developers/docs/topics/gateway#sending-events + * @see {@link https://discord.com/developers/docs/topics/gateway#sending-events} */ DecodeError = 4002, /** * You sent us a payload prior to identifying * - * See https://discord.com/developers/docs/topics/gateway-events#identify + * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify} */ NotAuthenticated = 4003, /** * The account token sent with your identify payload is incorrect * - * See https://discord.com/developers/docs/topics/gateway-events#identify + * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify} */ AuthenticationFailed = 4004, /** @@ -96,7 +99,7 @@ export declare enum GatewayCloseCodes { /** * The sequence sent when resuming the session was invalid. Reconnect and start a new session * - * See https://discord.com/developers/docs/topics/gateway-events#resume + * @see {@link https://discord.com/developers/docs/topics/gateway-events#resume} */ InvalidSeq = 4007, /** @@ -110,13 +113,13 @@ export declare enum GatewayCloseCodes { /** * You sent us an invalid shard when identifying * - * See https://discord.com/developers/docs/topics/gateway#sharding + * @see {@link https://discord.com/developers/docs/topics/gateway#sharding} */ InvalidShard = 4010, /** * The session would have handled too many guilds - you are required to shard your connection in order to connect * - * See https://discord.com/developers/docs/topics/gateway#sharding + * @see {@link https://discord.com/developers/docs/topics/gateway#sharding} */ ShardingRequired = 4011, /** @@ -126,30 +129,33 @@ export declare enum GatewayCloseCodes { /** * You sent an invalid intent for a Gateway Intent. You may have incorrectly calculated the bitwise value * - * See https://discord.com/developers/docs/topics/gateway#gateway-intents + * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents} */ InvalidIntents = 4013, /** * You sent a disallowed intent for a Gateway Intent. You may have tried to specify an intent that you have not * enabled or are not whitelisted for * - * See https://discord.com/developers/docs/topics/gateway#gateway-intents - * - * See https://discord.com/developers/docs/topics/gateway#privileged-intents + * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents} + * @see {@link https://discord.com/developers/docs/topics/gateway#privileged-intents} */ DisallowedIntents = 4014 } /** - * https://discord.com/developers/docs/topics/gateway#list-of-intents + * @see {@link https://discord.com/developers/docs/topics/gateway#list-of-intents} */ export declare enum GatewayIntentBits { Guilds = 1, GuildMembers = 2, GuildModeration = 4, /** - * @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration} + * @deprecated This is the old name for {@link GatewayIntentBits.GuildModeration} */ GuildBans = 4, + GuildExpressions = 8, + /** + * @deprecated This is the old name for {@link GatewayIntentBits.GuildExpressions} + */ GuildEmojisAndStickers = 8, GuildIntegrations = 16, GuildWebhooks = 32, @@ -170,14 +176,22 @@ export declare enum GatewayIntentBits { DirectMessagePolls = 33554432 } /** - * https://discord.com/developers/docs/topics/gateway-events#receive-events + * @see {@link https://discord.com/developers/docs/topics/gateway-events#receive-events} */ export declare enum GatewayDispatchEvents { ApplicationCommandPermissionsUpdate = "APPLICATION_COMMAND_PERMISSIONS_UPDATE", + AutoModerationActionExecution = "AUTO_MODERATION_ACTION_EXECUTION", + AutoModerationRuleCreate = "AUTO_MODERATION_RULE_CREATE", + AutoModerationRuleDelete = "AUTO_MODERATION_RULE_DELETE", + AutoModerationRuleUpdate = "AUTO_MODERATION_RULE_UPDATE", ChannelCreate = "CHANNEL_CREATE", ChannelDelete = "CHANNEL_DELETE", ChannelPinsUpdate = "CHANNEL_PINS_UPDATE", ChannelUpdate = "CHANNEL_UPDATE", + EntitlementCreate = "ENTITLEMENT_CREATE", + EntitlementDelete = "ENTITLEMENT_DELETE", + EntitlementUpdate = "ENTITLEMENT_UPDATE", + GuildAuditLogEntryCreate = "GUILD_AUDIT_LOG_ENTRY_CREATE", GuildBanAdd = "GUILD_BAN_ADD", GuildBanRemove = "GUILD_BAN_REMOVE", GuildCreate = "GUILD_CREATE", @@ -191,6 +205,16 @@ export declare enum GatewayDispatchEvents { GuildRoleCreate = "GUILD_ROLE_CREATE", GuildRoleDelete = "GUILD_ROLE_DELETE", GuildRoleUpdate = "GUILD_ROLE_UPDATE", + GuildScheduledEventCreate = "GUILD_SCHEDULED_EVENT_CREATE", + GuildScheduledEventDelete = "GUILD_SCHEDULED_EVENT_DELETE", + GuildScheduledEventUpdate = "GUILD_SCHEDULED_EVENT_UPDATE", + GuildScheduledEventUserAdd = "GUILD_SCHEDULED_EVENT_USER_ADD", + GuildScheduledEventUserRemove = "GUILD_SCHEDULED_EVENT_USER_REMOVE", + GuildSoundboardSoundCreate = "GUILD_SOUNDBOARD_SOUND_CREATE", + GuildSoundboardSoundDelete = "GUILD_SOUNDBOARD_SOUND_DELETE", + GuildSoundboardSoundsUpdate = "GUILD_SOUNDBOARD_SOUNDS_UPDATE", + GuildSoundboardSoundUpdate = "GUILD_SOUNDBOARD_SOUND_UPDATE", + SoundboardSounds = "SOUNDBOARD_SOUNDS", GuildStickersUpdate = "GUILD_STICKERS_UPDATE", GuildUpdate = "GUILD_UPDATE", IntegrationCreate = "INTEGRATION_CREATE", @@ -202,17 +226,23 @@ export declare enum GatewayDispatchEvents { MessageCreate = "MESSAGE_CREATE", MessageDelete = "MESSAGE_DELETE", MessageDeleteBulk = "MESSAGE_DELETE_BULK", + MessagePollVoteAdd = "MESSAGE_POLL_VOTE_ADD", + MessagePollVoteRemove = "MESSAGE_POLL_VOTE_REMOVE", MessageReactionAdd = "MESSAGE_REACTION_ADD", MessageReactionRemove = "MESSAGE_REACTION_REMOVE", MessageReactionRemoveAll = "MESSAGE_REACTION_REMOVE_ALL", MessageReactionRemoveEmoji = "MESSAGE_REACTION_REMOVE_EMOJI", MessageUpdate = "MESSAGE_UPDATE", PresenceUpdate = "PRESENCE_UPDATE", + RateLimited = "RATE_LIMITED", + Ready = "READY", + Resumed = "RESUMED", StageInstanceCreate = "STAGE_INSTANCE_CREATE", StageInstanceDelete = "STAGE_INSTANCE_DELETE", StageInstanceUpdate = "STAGE_INSTANCE_UPDATE", - Ready = "READY", - Resumed = "RESUMED", + SubscriptionCreate = "SUBSCRIPTION_CREATE", + SubscriptionDelete = "SUBSCRIPTION_DELETE", + SubscriptionUpdate = "SUBSCRIPTION_UPDATE", ThreadCreate = "THREAD_CREATE", ThreadDelete = "THREAD_DELETE", ThreadListSync = "THREAD_LIST_SYNC", @@ -221,37 +251,23 @@ export declare enum GatewayDispatchEvents { ThreadUpdate = "THREAD_UPDATE", TypingStart = "TYPING_START", UserUpdate = "USER_UPDATE", + VoiceChannelEffectSend = "VOICE_CHANNEL_EFFECT_SEND", VoiceServerUpdate = "VOICE_SERVER_UPDATE", VoiceStateUpdate = "VOICE_STATE_UPDATE", - WebhooksUpdate = "WEBHOOKS_UPDATE", - MessagePollVoteAdd = "MESSAGE_POLL_VOTE_ADD", - MessagePollVoteRemove = "MESSAGE_POLL_VOTE_REMOVE", - GuildScheduledEventCreate = "GUILD_SCHEDULED_EVENT_CREATE", - GuildScheduledEventUpdate = "GUILD_SCHEDULED_EVENT_UPDATE", - GuildScheduledEventDelete = "GUILD_SCHEDULED_EVENT_DELETE", - GuildScheduledEventUserAdd = "GUILD_SCHEDULED_EVENT_USER_ADD", - GuildScheduledEventUserRemove = "GUILD_SCHEDULED_EVENT_USER_REMOVE", - AutoModerationRuleCreate = "AUTO_MODERATION_RULE_CREATE", - AutoModerationRuleUpdate = "AUTO_MODERATION_RULE_UPDATE", - AutoModerationRuleDelete = "AUTO_MODERATION_RULE_DELETE", - AutoModerationActionExecution = "AUTO_MODERATION_ACTION_EXECUTION", - GuildAuditLogEntryCreate = "GUILD_AUDIT_LOG_ENTRY_CREATE", - EntitlementCreate = "ENTITLEMENT_CREATE", - EntitlementUpdate = "ENTITLEMENT_UPDATE", - EntitlementDelete = "ENTITLEMENT_DELETE" + WebhooksUpdate = "WEBHOOKS_UPDATE" } -export type GatewaySendPayload = GatewayHeartbeat | GatewayIdentify | GatewayRequestGuildMembers | GatewayResume | GatewayUpdatePresence | GatewayVoiceStateUpdate; +export type GatewaySendPayload = GatewayHeartbeat | GatewayIdentify | GatewayRequestGuildMembers | GatewayRequestSoundboardSounds | GatewayResume | GatewayUpdatePresence | GatewayVoiceStateUpdate; export type GatewayReceivePayload = GatewayDispatchPayload | GatewayHeartbeatAck | GatewayHeartbeatRequest | GatewayHello | GatewayInvalidSession | GatewayReconnect; -export type GatewayDispatchPayload = GatewayApplicationCommandPermissionsUpdateDispatch | GatewayAutoModerationActionExecutionDispatch | GatewayAutoModerationRuleCreateDispatch | GatewayAutoModerationRuleDeleteDispatch | GatewayAutoModerationRuleModifyDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayEntitlementModifyDispatch | GatewayGuildAuditLogEntryCreateDispatch | GatewayGuildBanModifyDispatch | GatewayGuildCreateDispatch | GatewayGuildDeleteDispatch | GatewayGuildEmojisUpdateDispatch | GatewayGuildIntegrationsUpdateDispatch | GatewayGuildMemberAddDispatch | GatewayGuildMemberRemoveDispatch | GatewayGuildMembersChunkDispatch | GatewayGuildMemberUpdateDispatch | GatewayGuildModifyDispatch | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildScheduledEventCreateDispatch | GatewayGuildScheduledEventDeleteDispatch | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventUserAddDispatch | GatewayGuildScheduledEventUserRemoveDispatch | GatewayGuildStickersUpdateDispatch | GatewayIntegrationCreateDispatch | GatewayIntegrationDeleteDispatch | GatewayIntegrationUpdateDispatch | GatewayInteractionCreateDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch | GatewayMessageCreateDispatch | GatewayMessageDeleteBulkDispatch | GatewayMessageDeleteDispatch | GatewayMessagePollVoteAddDispatch | GatewayMessagePollVoteRemoveDispatch | GatewayMessageReactionAddDispatch | GatewayMessageReactionRemoveAllDispatch | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch | GatewayReadyDispatch | GatewayResumedDispatch | GatewayStageInstanceCreateDispatch | GatewayStageInstanceDeleteDispatch | GatewayStageInstanceUpdateDispatch | GatewayThreadCreateDispatch | GatewayThreadDeleteDispatch | GatewayThreadListSyncDispatch | GatewayThreadMembersUpdateDispatch | GatewayThreadMemberUpdateDispatch | GatewayThreadUpdateDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceServerUpdateDispatch | GatewayVoiceStateUpdateDispatch | GatewayWebhooksUpdateDispatch; +export type GatewayDispatchPayload = GatewayApplicationCommandPermissionsUpdateDispatch | GatewayAutoModerationActionExecutionDispatch | GatewayAutoModerationRuleCreateDispatch | GatewayAutoModerationRuleDeleteDispatch | GatewayAutoModerationRuleModifyDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayEntitlementModifyDispatch | GatewayGuildAuditLogEntryCreateDispatch | GatewayGuildBanModifyDispatch | GatewayGuildCreateDispatch | GatewayGuildDeleteDispatch | GatewayGuildEmojisUpdateDispatch | GatewayGuildIntegrationsUpdateDispatch | GatewayGuildMemberAddDispatch | GatewayGuildMemberRemoveDispatch | GatewayGuildMembersChunkDispatch | GatewayGuildMemberUpdateDispatch | GatewayGuildModifyDispatch | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildScheduledEventCreateDispatch | GatewayGuildScheduledEventDeleteDispatch | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventUserAddDispatch | GatewayGuildScheduledEventUserRemoveDispatch | GatewayGuildSoundboardSoundCreateDispatch | GatewayGuildSoundboardSoundDeleteDispatch | GatewayGuildSoundboardSoundsUpdateDispatch | GatewayGuildSoundboardSoundUpdateDispatch | GatewayGuildStickersUpdateDispatch | GatewayIntegrationCreateDispatch | GatewayIntegrationDeleteDispatch | GatewayIntegrationUpdateDispatch | GatewayInteractionCreateDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch | GatewayMessageCreateDispatch | GatewayMessageDeleteBulkDispatch | GatewayMessageDeleteDispatch | GatewayMessagePollVoteAddDispatch | GatewayMessagePollVoteRemoveDispatch | GatewayMessageReactionAddDispatch | GatewayMessageReactionRemoveAllDispatch | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch | GatewayRateLimitedDispatch | GatewayReadyDispatch | GatewayResumedDispatch | GatewaySoundboardSoundsDispatch | GatewayStageInstanceCreateDispatch | GatewayStageInstanceDeleteDispatch | GatewayStageInstanceUpdateDispatch | GatewaySubscriptionModifyDispatch | GatewayThreadCreateDispatch | GatewayThreadDeleteDispatch | GatewayThreadListSyncDispatch | GatewayThreadMembersUpdateDispatch | GatewayThreadMemberUpdateDispatch | GatewayThreadUpdateDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceChannelEffectSendDispatch | GatewayVoiceServerUpdateDispatch | GatewayVoiceStateUpdateDispatch | GatewayWebhooksUpdateDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#hello + * @see {@link https://discord.com/developers/docs/topics/gateway-events#hello} */ -export interface GatewayHello extends NonDispatchPayload { +export interface GatewayHello extends _NonDispatchPayload { op: GatewayOpcodes.Hello; d: GatewayHelloData; } /** - * https://discord.com/developers/docs/topics/gateway-events#hello + * @see {@link https://discord.com/developers/docs/topics/gateway-events#hello} */ export interface GatewayHelloData { /** @@ -260,61 +276,61 @@ export interface GatewayHelloData { heartbeat_interval: number; } /** - * https://discord.com/developers/docs/topics/gateway#sending-heartbeats + * @see {@link https://discord.com/developers/docs/topics/gateway#sending-heartbeats} */ -export interface GatewayHeartbeatRequest extends NonDispatchPayload { +export interface GatewayHeartbeatRequest extends _NonDispatchPayload { op: GatewayOpcodes.Heartbeat; d: never; } /** - * https://discord.com/developers/docs/topics/gateway-events#heartbeat + * @see {@link https://discord.com/developers/docs/topics/gateway-events#heartbeat} */ -export interface GatewayHeartbeatAck extends NonDispatchPayload { +export interface GatewayHeartbeatAck extends _NonDispatchPayload { op: GatewayOpcodes.HeartbeatAck; d: never; } /** - * https://discord.com/developers/docs/topics/gateway-events#invalid-session + * @see {@link https://discord.com/developers/docs/topics/gateway-events#invalid-session} */ -export interface GatewayInvalidSession extends NonDispatchPayload { +export interface GatewayInvalidSession extends _NonDispatchPayload { op: GatewayOpcodes.InvalidSession; d: GatewayInvalidSessionData; } /** - * https://discord.com/developers/docs/topics/gateway-events#invalid-session + * @see {@link https://discord.com/developers/docs/topics/gateway-events#invalid-session} */ export type GatewayInvalidSessionData = boolean; /** - * https://discord.com/developers/docs/topics/gateway-events#reconnect + * @see {@link https://discord.com/developers/docs/topics/gateway-events#reconnect} */ -export interface GatewayReconnect extends NonDispatchPayload { +export interface GatewayReconnect extends _NonDispatchPayload { op: GatewayOpcodes.Reconnect; d: never; } /** - * https://discord.com/developers/docs/topics/gateway-events#ready + * @see {@link https://discord.com/developers/docs/topics/gateway-events#ready} */ -export type GatewayReadyDispatch = DataPayload; +export type GatewayReadyDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#ready + * @see {@link https://discord.com/developers/docs/topics/gateway-events#ready} */ export interface GatewayReadyDispatchData { /** * Gateway version * - * See https://discord.com/developers/docs/reference#api-versioning + * @see {@link https://discord.com/developers/docs/reference#api-versioning} */ v: number; /** * Information about the user including email * - * See https://discord.com/developers/docs/resources/user#user-object + * @see {@link https://discord.com/developers/docs/resources/user#user-object} */ user: APIUser; /** * The guilds the user is in * - * See https://discord.com/developers/docs/resources/guild#unavailable-guild-object + * @see {@link https://discord.com/developers/docs/resources/guild#unavailable-guild-object} */ guilds: APIUnavailableGuild[]; /** @@ -328,62 +344,62 @@ export interface GatewayReadyDispatchData { /** * The shard information associated with this session, if sent when identifying * - * See https://discord.com/developers/docs/topics/gateway#sharding + * @see {@link https://discord.com/developers/docs/topics/gateway#sharding} */ shard?: [shard_id: number, shard_count: number]; /** * Contains `id` and `flags` * - * See https://discord.com/developers/docs/resources/application#application-object + * @see {@link https://discord.com/developers/docs/resources/application#application-object} */ application: Pick; } /** - * https://discord.com/developers/docs/topics/gateway-events#resumed + * @see {@link https://discord.com/developers/docs/topics/gateway-events#resumed} */ -export type GatewayResumedDispatch = DataPayload; +export type GatewayResumedDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete} */ -export type GatewayAutoModerationRuleModifyDispatch = DataPayload; +export type GatewayAutoModerationRuleModifyDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete} */ export type GatewayAutoModerationRuleModifyDispatchData = APIAutoModerationRule; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create} */ export type GatewayAutoModerationRuleCreateDispatch = GatewayAutoModerationRuleModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create} */ export type GatewayAutoModerationRuleCreateDispatchData = GatewayAutoModerationRuleModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update} */ export type GatewayAutoModerationRuleUpdateDispatch = GatewayAutoModerationRuleModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update} */ export type GatewayAutoModerationRuleUpdateDispatchData = GatewayAutoModerationRuleModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete} */ export type GatewayAutoModerationRuleDeleteDispatch = GatewayAutoModerationRuleModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete} */ export type GatewayAutoModerationRuleDeleteDispatchData = GatewayAutoModerationRuleModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-action-execution + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-action-execution} */ -export type GatewayAutoModerationActionExecutionDispatch = DataPayload; +export type GatewayAutoModerationActionExecutionDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-action-execution + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-action-execution} */ export interface GatewayAutoModerationActionExecutionDispatchData { /** @@ -440,11 +456,11 @@ export interface GatewayAutoModerationActionExecutionDispatchData { matched_content: string | null; } /** - * https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update} */ -export type GatewayApplicationCommandPermissionsUpdateDispatch = DataPayload; +export type GatewayApplicationCommandPermissionsUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update} */ export interface GatewayApplicationCommandPermissionsUpdateDispatchData { /** @@ -465,47 +481,86 @@ export interface GatewayApplicationCommandPermissionsUpdateDispatchData { permissions: APIApplicationCommandPermission[]; } /** - * https://discord.com/developers/docs/topics/gateway-events#channel-create - * https://discord.com/developers/docs/topics/gateway-events#channel-update - * https://discord.com/developers/docs/topics/gateway-events#channel-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-delete} */ -export type GatewayChannelModifyDispatch = DataPayload; +export type GatewaySubscriptionModifyDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-create - * https://discord.com/developers/docs/topics/gateway-events#channel-update - * https://discord.com/developers/docs/topics/gateway-events#channel-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-delete} */ -export type GatewayChannelModifyDispatchData = APIChannel; +export type GatewaySubscriptionModifyDispatchData = APISubscription; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-create} + */ +export type GatewaySubscriptionCreateDispatch = GatewaySubscriptionModifyDispatch; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-create} + */ +export type GatewaySubscriptionCreateDispatchData = GatewaySubscriptionModifyDispatchData; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-update} + */ +export type GatewaySubscriptionUpdateDispatch = GatewaySubscriptionModifyDispatch; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-update} + */ +export type GatewaySubscriptionUpdateDispatchData = GatewaySubscriptionModifyDispatchData; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-delete} + */ +export type GatewaySubscriptionDeleteDispatch = GatewaySubscriptionModifyDispatch; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-delete} + */ +export type GatewaySubscriptionDeleteDispatchData = GatewaySubscriptionModifyDispatchData; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-delete} + */ +export type GatewayChannelModifyDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-delete} + */ +export type GatewayChannelModifyDispatchData = APIChannel & { + type: Exclude; + guild_id: Snowflake; +}; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-create} */ export type GatewayChannelCreateDispatch = GatewayChannelModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-create} */ export type GatewayChannelCreateDispatchData = GatewayChannelModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-update} */ export type GatewayChannelUpdateDispatch = GatewayChannelModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-update} */ export type GatewayChannelUpdateDispatchData = GatewayChannelModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-delete} */ export type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-delete} */ export type GatewayChannelDeleteDispatchData = GatewayChannelModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-pins-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-pins-update} */ -export type GatewayChannelPinsUpdateDispatch = DataPayload; +export type GatewayChannelPinsUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-pins-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-pins-update} */ export interface GatewayChannelPinsUpdateDispatchData { /** @@ -522,68 +577,68 @@ export interface GatewayChannelPinsUpdateDispatchData { last_pin_timestamp?: string | null; } /** - * https://discord.com/developers/docs/topics/gateway-events#entitlement-create - * https://discord.com/developers/docs/topics/gateway-events#entitlement-update - * https://discord.com/developers/docs/topics/gateway-events#entitlement-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-delete} */ export type GatewayEntitlementModifyDispatchData = APIEntitlement; /** - * https://discord.com/developers/docs/topics/gateway-events#entitlement-create - * https://discord.com/developers/docs/topics/gateway-events#entitlement-update - * https://discord.com/developers/docs/topics/gateway-events#entitlement-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-delete} */ -export type GatewayEntitlementModifyDispatch = DataPayload; +export type GatewayEntitlementModifyDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#entitlement-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create} */ export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#entitlement-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create} */ export type GatewayEntitlementCreateDispatch = GatewayEntitlementModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#entitlement-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-update} */ export type GatewayEntitlementUpdateDispatchData = GatewayEntitlementModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#entitlement-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-update} */ export type GatewayEntitlementUpdateDispatch = GatewayEntitlementModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#entitlement-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-delete} */ export type GatewayEntitlementDeleteDispatchData = GatewayEntitlementModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#entitlement-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-delete} */ export type GatewayEntitlementDeleteDispatch = GatewayEntitlementModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-update} */ -export type GatewayGuildModifyDispatch = DataPayload; +export type GatewayGuildModifyDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-update} */ export type GatewayGuildModifyDispatchData = APIGuild; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-create} */ -export type GatewayGuildCreateDispatch = DataPayload; +export type GatewayGuildCreateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-create - * https://discord.com/developers/docs/topics/gateway-events#guild-create-guild-create-extra-fields + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-create-guild-create-extra-fields} */ export interface GatewayGuildCreateDispatchData extends APIGuild { /** * When this guild was joined at * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** */ joined_at: string; /** * `true` if this is considered a large guild * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** */ large: boolean; /** @@ -593,90 +648,109 @@ export interface GatewayGuildCreateDispatchData extends APIGuild { /** * Total number of members in this guild * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** */ member_count: number; /** * States of members currently in voice channels; lacks the `guild_id` key * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** * - * See https://discord.com/developers/docs/resources/voice#voice-state-object + * @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object} */ - voice_states: Omit[]; + voice_states: APIBaseVoiceState[]; /** * Users in the guild * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** * - * See https://discord.com/developers/docs/resources/guild#guild-member-object + * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object} */ members: APIGuildMember[]; /** * Channels in the guild * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** * - * See https://discord.com/developers/docs/resources/channel#channel-object + * @see {@link https://discord.com/developers/docs/resources/channel#channel-object} */ - channels: APIChannel[]; + channels: (APIChannel & { + type: Exclude; + })[]; /** * Threads in the guild * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** * - * See https://discord.com/developers/docs/resources/channel#channel-object + * @see {@link https://discord.com/developers/docs/resources/channel#channel-object} */ - threads: APIChannel[]; + threads: (APIChannel & { + type: ThreadChannelType; + })[]; /** * Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold` * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** * - * See https://discord.com/developers/docs/topics/gateway-events#presence-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update} */ presences: GatewayPresenceUpdate[]; /** * The stage instances in the guild * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** * - * See https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure + * @see {@link https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure} */ stage_instances: APIStageInstance[]; /** * The scheduled events in the guild * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** * - * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object + * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object} */ guild_scheduled_events: APIGuildScheduledEvent[]; + /** + * The soundboard sounds in the guild + * + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** + * + * @see {@link https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object} + */ + soundboard_sounds: APISoundboardSound[]; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-update} */ export type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-update} */ export type GatewayGuildUpdateDispatchData = GatewayGuildModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-delete} */ -export type GatewayGuildDeleteDispatch = DataPayload; +export type GatewayGuildDeleteDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-delete} */ -export type GatewayGuildDeleteDispatchData = APIUnavailableGuild; +export interface GatewayGuildDeleteDispatchData extends APIBaseGuild { + /** + * `true` if this guild is unavailable due to an outage + * + * If the field is not set, the user was removed from the guild. + */ + unavailable?: true; +} /** - * https://discord.com/developers/docs/topics/gateway-events#guild-ban-add - * https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-add} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove} */ -export type GatewayGuildBanModifyDispatch = DataPayload; +export type GatewayGuildBanModifyDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-ban-add - * https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-add} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove} */ export interface GatewayGuildBanModifyDispatchData { /** @@ -686,32 +760,32 @@ export interface GatewayGuildBanModifyDispatchData { /** * The banned user * - * See https://discord.com/developers/docs/resources/user#user-object + * @see {@link https://discord.com/developers/docs/resources/user#user-object} */ user: APIUser; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-ban-add + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-add} */ export type GatewayGuildBanAddDispatch = GatewayGuildBanModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-ban-add + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-add} */ export type GatewayGuildBanAddDispatchData = GatewayGuildBanModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove} */ export type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove} */ export type GatewayGuildBanRemoveDispatchData = GatewayGuildBanModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-emojis-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-emojis-update} */ -export type GatewayGuildEmojisUpdateDispatch = DataPayload; +export type GatewayGuildEmojisUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-emojis-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-emojis-update} */ export interface GatewayGuildEmojisUpdateDispatchData { /** @@ -721,16 +795,16 @@ export interface GatewayGuildEmojisUpdateDispatchData { /** * Array of emojis * - * See https://discord.com/developers/docs/resources/emoji#emoji-object + * @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object} */ emojis: APIEmoji[]; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-stickers-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-stickers-update} */ -export type GatewayGuildStickersUpdateDispatch = DataPayload; +export type GatewayGuildStickersUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-stickers-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-stickers-update} */ export interface GatewayGuildStickersUpdateDispatchData { /** @@ -740,16 +814,16 @@ export interface GatewayGuildStickersUpdateDispatchData { /** * Array of stickers * - * See https://discord.com/developers/docs/resources/sticker#sticker-object + * @see {@link https://discord.com/developers/docs/resources/sticker#sticker-object} */ stickers: APISticker[]; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-integrations-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-integrations-update} */ -export type GatewayGuildIntegrationsUpdateDispatch = DataPayload; +export type GatewayGuildIntegrationsUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-integrations-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-integrations-update} */ export interface GatewayGuildIntegrationsUpdateDispatchData { /** @@ -758,11 +832,11 @@ export interface GatewayGuildIntegrationsUpdateDispatchData { guild_id: Snowflake; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-member-add + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-add} */ -export type GatewayGuildMemberAddDispatch = DataPayload; +export type GatewayGuildMemberAddDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-member-add + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-add} */ export interface GatewayGuildMemberAddDispatchData extends APIGuildMember { /** @@ -771,11 +845,11 @@ export interface GatewayGuildMemberAddDispatchData extends APIGuildMember { guild_id: Snowflake; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-member-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-remove} */ -export type GatewayGuildMemberRemoveDispatch = DataPayload; +export type GatewayGuildMemberRemoveDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-member-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-remove} */ export interface GatewayGuildMemberRemoveDispatchData { /** @@ -785,33 +859,29 @@ export interface GatewayGuildMemberRemoveDispatchData { /** * The user who was removed * - * See https://discord.com/developers/docs/resources/user#user-object + * @see {@link https://discord.com/developers/docs/resources/user#user-object} */ user: APIUser; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-member-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-update} */ -export type GatewayGuildMemberUpdateDispatch = DataPayload; +export type GatewayGuildMemberUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-member-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-update} */ -export type GatewayGuildMemberUpdateDispatchData = Nullable> & Omit & Partial> & Required> & { +export interface GatewayGuildMemberUpdateDispatchData extends APIGuildMemberJoined, APIBaseGuildMember, Partial, Partial, Required, Required { /** * The id of the guild */ guild_id: Snowflake; -}; +} /** - * https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk} */ -export type GatewayGuildMembersChunkDispatch = DataPayload; +export type GatewayGuildMembersChunkDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#update-presence - */ -export type GatewayGuildMembersChunkPresence = Omit; -/** - * https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk} */ export interface GatewayGuildMembersChunkDispatchData { /** @@ -821,7 +891,7 @@ export interface GatewayGuildMembersChunkDispatchData { /** * Set of guild members * - * See https://discord.com/developers/docs/resources/guild#guild-member-object + * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object} */ members: APIGuildMember[]; /** @@ -839,24 +909,24 @@ export interface GatewayGuildMembersChunkDispatchData { /** * If passing true to `REQUEST_GUILD_MEMBERS`, presences of the returned members will be here * - * See https://discord.com/developers/docs/topics/gateway-events#update-presence + * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence} */ presences?: GatewayGuildMembersChunkPresence[]; /** * The nonce used in the Guild Members Request * - * See https://discord.com/developers/docs/topics/gateway-events#request-guild-members + * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members} */ nonce?: string; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-role-create - * https://discord.com/developers/docs/topics/gateway-events#guild-role-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-update} */ -export type GatewayGuildRoleModifyDispatch = DataPayload; +export type GatewayGuildRoleModifyDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-role-create - * https://discord.com/developers/docs/topics/gateway-events#guild-role-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-update} */ export interface GatewayGuildRoleModifyDispatchData { /** @@ -866,32 +936,32 @@ export interface GatewayGuildRoleModifyDispatchData { /** * The role created or updated * - * See https://discord.com/developers/docs/topics/permissions#role-object + * @see {@link https://discord.com/developers/docs/topics/permissions#role-object} */ role: APIRole; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-role-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-create} */ export type GatewayGuildRoleCreateDispatch = GatewayGuildRoleModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-role-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-create} */ export type GatewayGuildRoleCreateDispatchData = GatewayGuildRoleModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-role-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-update} */ export type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-role-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-update} */ export type GatewayGuildRoleUpdateDispatchData = GatewayGuildRoleModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-role-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-delete} */ -export type GatewayGuildRoleDeleteDispatch = DataPayload; +export type GatewayGuildRoleDeleteDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-role-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-delete} */ export interface GatewayGuildRoleDeleteDispatchData { /** @@ -903,50 +973,147 @@ export interface GatewayGuildRoleDeleteDispatchData { */ role_id: Snowflake; } -export type GatewayGuildScheduledEventCreateDispatch = DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-create} + */ +export type GatewayGuildScheduledEventCreateDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-create} + */ export type GatewayGuildScheduledEventCreateDispatchData = APIGuildScheduledEvent; -export type GatewayGuildScheduledEventUpdateDispatch = DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-update} + */ +export type GatewayGuildScheduledEventUpdateDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-update} + */ export type GatewayGuildScheduledEventUpdateDispatchData = APIGuildScheduledEvent; -export type GatewayGuildScheduledEventDeleteDispatch = DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-delete} + */ +export type GatewayGuildScheduledEventDeleteDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-delete} + */ export type GatewayGuildScheduledEventDeleteDispatchData = APIGuildScheduledEvent; -export type GatewayGuildScheduledEventUserAddDispatch = DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-add} + */ +export type GatewayGuildScheduledEventUserAddDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-add} + */ export interface GatewayGuildScheduledEventUserAddDispatchData { guild_scheduled_event_id: Snowflake; user_id: Snowflake; guild_id: Snowflake; } -export type GatewayGuildScheduledEventUserRemoveDispatch = DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-remove} + */ +export type GatewayGuildScheduledEventUserRemoveDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-remove} + */ export interface GatewayGuildScheduledEventUserRemoveDispatchData { guild_scheduled_event_id: Snowflake; user_id: Snowflake; guild_id: Snowflake; } /** - * https://discord.com/developers/docs/topics/gateway-events#integration-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create} */ -export type GatewayIntegrationCreateDispatch = DataPayload; +export type GatewayGuildSoundboardSoundCreateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#integration-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create} + */ +export type GatewayGuildSoundboardSoundCreateDispatchData = APISoundboardSound; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update} + */ +export type GatewayGuildSoundboardSoundUpdateDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update} + */ +export type GatewayGuildSoundboardSoundUpdateDispatchData = APISoundboardSound; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete} + */ +export type GatewayGuildSoundboardSoundDeleteDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete} + */ +export interface GatewayGuildSoundboardSoundDeleteDispatchData { + /** + * The id of the sound that was deleted + */ + sound_id: Snowflake; + /** + * The id of the guild the sound was in + */ + guild_id: Snowflake; +} +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update} + */ +export type GatewayGuildSoundboardSoundsUpdateDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update} + */ +export interface GatewayGuildSoundboardSoundsUpdateDispatchData { + /** + * The guild's soundboard sounds + */ + soundboard_sounds: APISoundboardSound[]; + /** + * The id of the guild + */ + guild_id: Snowflake; +} +/** + * @see {@link https://discord.com/developers/docs/events/gateway-events#soundboard-sounds} + */ +export type GatewaySoundboardSoundsDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/events/gateway-events#soundboard-sounds} + */ +export interface GatewaySoundboardSoundsDispatchData { + /** + * The guild's soundboard sounds + */ + soundboard_sounds: APISoundboardSound[]; + /** + * The id of the guild + */ + guild_id: Snowflake; +} +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-create} + */ +export type GatewayIntegrationCreateDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-create} */ export type GatewayIntegrationCreateDispatchData = APIGuildIntegration & { guild_id: Snowflake; }; /** - * https://discord.com/developers/docs/topics/gateway-events#integration-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-update} */ -export type GatewayIntegrationUpdateDispatch = DataPayload; +export type GatewayIntegrationUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#integration-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-update} */ export type GatewayIntegrationUpdateDispatchData = APIGuildIntegration & { guild_id: Snowflake; }; /** - * https://discord.com/developers/docs/topics/gateway-events#integration-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-update} */ -export type GatewayIntegrationDeleteDispatch = DataPayload; +export type GatewayIntegrationDeleteDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#integration-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-delete} */ export interface GatewayIntegrationDeleteDispatchData { /** @@ -963,19 +1130,19 @@ export interface GatewayIntegrationDeleteDispatchData { application_id?: Snowflake; } /** - * https://discord.com/developers/docs/topics/gateway-events#interaction-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#interaction-create} */ -export type GatewayInteractionCreateDispatch = DataPayload; +export type GatewayInteractionCreateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#interaction-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#interaction-create} */ export type GatewayInteractionCreateDispatchData = APIInteraction; /** - * https://discord.com/developers/docs/topics/gateway-events#invite-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#invite-create} */ -export type GatewayInviteCreateDispatch = DataPayload; +export type GatewayInviteCreateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#invite-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#invite-create} */ export interface GatewayInviteCreateDispatchData { /** @@ -985,7 +1152,7 @@ export interface GatewayInviteCreateDispatchData { /** * The unique invite code * - * See https://discord.com/developers/docs/resources/invite#invite-object + * @see {@link https://discord.com/developers/docs/resources/invite#invite-object} */ code: string; /** @@ -999,7 +1166,7 @@ export interface GatewayInviteCreateDispatchData { /** * The user that created the invite * - * See https://discord.com/developers/docs/resources/user#user-object + * @see {@link https://discord.com/developers/docs/resources/user#user-object} */ inviter?: APIUser; /** @@ -1013,13 +1180,13 @@ export interface GatewayInviteCreateDispatchData { /** * The type of target for this voice channel invite * - * See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types + * @see {@link https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types} */ target_type?: InviteTargetType; /** * The user whose stream to display for this voice channel stream invite * - * See https://discord.com/developers/docs/resources/user#user-object + * @see {@link https://discord.com/developers/docs/resources/user#user-object} */ target_user?: APIUser; /** @@ -1034,13 +1201,17 @@ export interface GatewayInviteCreateDispatchData { * How many times the invite has been used (always will be `0`) */ uses: 0; + /** + * The expiration date of this invite. + */ + expires_at: string | null; } /** - * https://discord.com/developers/docs/topics/gateway-events#invite-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#invite-delete} */ -export type GatewayInviteDeleteDispatch = DataPayload; +export type GatewayInviteDeleteDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#invite-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#invite-delete} */ export interface GatewayInviteDeleteDispatchData { /** @@ -1054,35 +1225,42 @@ export interface GatewayInviteDeleteDispatchData { /** * The unique invite code * - * See https://discord.com/developers/docs/resources/invite#invite-object + * @see {@link https://discord.com/developers/docs/resources/invite#invite-object} */ code: string; } /** - * https://discord.com/developers/docs/topics/gateway-events#message-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create} */ -export type GatewayMessageCreateDispatch = DataPayload; +export type GatewayMessageCreateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create} */ -export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit; +export interface GatewayMessageCreateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage { +} /** - * https://discord.com/developers/docs/topics/gateway-events#message-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update} */ -export type GatewayMessageUpdateDispatch = DataPayload; +export type GatewayMessageUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update} */ -export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & Omit, 'mentions'> & { +export interface GatewayMessageUpdateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage { +} +export interface APIGuildMemberNoUser extends APIBaseGuildMember, APIFlaggedGuildMember, APIGuildMemberAvatar, NonNullable, APIBaseVoiceGuildMember { +} +export interface APIUserWithMember extends APIUser { /** - * ID of the message + * The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events + * from text-based guild channels + * + * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object} */ - id: Snowflake; - /** - * ID of the channel the message was sent in - */ - channel_id: Snowflake; -}; + member?: APIGuildMemberNoUser; +} +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create-message-create-extra-fields} + */ export interface GatewayMessageEventExtraFields { /** * ID of the guild the message was sent in @@ -1094,28 +1272,22 @@ export interface GatewayMessageEventExtraFields { * The member object exists in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events * from text-based guild channels * - * See https://discord.com/developers/docs/resources/guild#guild-member-object + * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object} */ - member?: APIGuildMember; + member?: APIGuildMemberNoUser; /** * Users specifically mentioned in the message * - * The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events - * from text-based guild channels - * - * See https://discord.com/developers/docs/resources/user#user-object - * See https://discord.com/developers/docs/resources/guild#guild-member-object + * @see {@link https://discord.com/developers/docs/resources/user#user-object} */ - mentions: (APIUser & { - member?: Omit; - })[]; + mentions: APIUserWithMember[]; } /** - * https://discord.com/developers/docs/topics/gateway-events#message-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-delete} */ -export type GatewayMessageDeleteDispatch = DataPayload; +export type GatewayMessageDeleteDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-delete} */ export interface GatewayMessageDeleteDispatchData { /** @@ -1132,11 +1304,11 @@ export interface GatewayMessageDeleteDispatchData { guild_id?: Snowflake; } /** - * https://discord.com/developers/docs/topics/gateway-events#message-delete-bulk + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-delete-bulk} */ -export type GatewayMessageDeleteBulkDispatch = DataPayload; +export type GatewayMessageDeleteBulkDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-delete-bulk + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-delete-bulk} */ export interface GatewayMessageDeleteBulkDispatchData { /** @@ -1153,116 +1325,162 @@ export interface GatewayMessageDeleteBulkDispatchData { guild_id?: Snowflake; } /** - * https://discord.com/developers/docs/topics/gateway-events#message-reaction-add + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add} */ -export type GatewayMessageReactionAddDispatch = ReactionData; +export interface GatewayMessageReactionAddDispatchData extends GatewayMessageReactionRemoveDispatchData { + /** + * The member who reacted if this happened in a guild + * + * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object} + */ + member?: APIGuildMember; + /** + * The id of the user that posted the message that was reacted to + */ + message_author_id?: Snowflake; + /** + * Colors used for super-reaction animation in "#rrggbb" format + */ + burst_colors?: string[]; +} /** - * https://discord.com/developers/docs/topics/gateway-events#message-reaction-add + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add} */ -export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDispatch['d']; +export type GatewayMessageReactionAddDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove} */ -export type GatewayMessageReactionRemoveDispatch = ReactionData; +export interface GatewayMessageReactionRemoveDispatchData { + /** + * The id of the user + */ + user_id: Snowflake; + /** + * The id of the channel + */ + channel_id: Snowflake; + /** + * The id of the message + */ + message_id: Snowflake; + /** + * The id of the guild + */ + guild_id?: Snowflake; + /** + * The emoji used to react + * + * @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object} + */ + emoji: APIEmoji; + /** + * True if this is a super-reaction + */ + burst: boolean; + /** + * The type of reaction + */ + type: ReactionType; +} /** - * https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove} */ -export type GatewayMessageReactionRemoveDispatchData = GatewayMessageReactionRemoveDispatch['d']; +export type GatewayMessageReactionRemoveDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all} */ -export type GatewayMessageReactionRemoveAllDispatch = DataPayload; +export type GatewayMessageReactionRemoveAllDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all} */ -export type GatewayMessageReactionRemoveAllDispatchData = MessageReactionRemoveData; +export type GatewayMessageReactionRemoveAllDispatchData = GatewayMessageReactionRemoveData; /** - * https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-emoji + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-emoji} */ -export type GatewayMessageReactionRemoveEmojiDispatch = DataPayload; +export type GatewayMessageReactionRemoveEmojiDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-emoji + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-emoji} */ -export interface GatewayMessageReactionRemoveEmojiDispatchData extends MessageReactionRemoveData { +export interface GatewayMessageReactionRemoveEmojiDispatchData extends GatewayMessageReactionRemoveData { /** * The emoji that was removed */ emoji: APIEmoji; } /** - * https://discord.com/developers/docs/topics/gateway-events#presence-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update} */ -export type GatewayPresenceUpdateDispatch = DataPayload; +export type GatewayPresenceUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#presence-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update} */ -export type GatewayPresenceUpdateDispatchData = RawGatewayPresenceUpdate; +export type GatewayPresenceUpdateDispatchData = GatewayPresenceUpdate; /** - * https://discord.com/developers/docs/topics/gateway-events#stage-instance-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-create} */ -export type GatewayStageInstanceCreateDispatch = DataPayload; +export type GatewayStageInstanceCreateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#stage-instance-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-create} */ export type GatewayStageInstanceCreateDispatchData = APIStageInstance; /** - * https://discord.com/developers/docs/topics/gateway-events#stage-instance-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-delete} */ -export type GatewayStageInstanceDeleteDispatch = DataPayload; +export type GatewayStageInstanceDeleteDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#stage-instance-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-delete} */ export type GatewayStageInstanceDeleteDispatchData = APIStageInstance; /** - * https://discord.com/developers/docs/topics/gateway-events#stage-instance-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-update} */ -export type GatewayStageInstanceUpdateDispatch = DataPayload; +export type GatewayStageInstanceUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#stage-instance-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-update} */ export type GatewayStageInstanceUpdateDispatchData = APIStageInstance; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-list-sync + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-list-sync} */ -export type GatewayThreadListSyncDispatch = DataPayload; +export type GatewayThreadListSyncDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-list-sync + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-list-sync} */ -export type GatewayThreadListSyncDispatchData = RawGatewayThreadListSync; +export type GatewayThreadListSyncDispatchData = GatewayThreadListSync; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-members-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-members-update} */ -export type GatewayThreadMembersUpdateDispatch = DataPayload; +export type GatewayThreadMembersUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-members-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-members-update} */ export type GatewayThreadMembersUpdateDispatchData = RawGatewayThreadMembersUpdate; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-member-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-member-update} */ -export type GatewayThreadMemberUpdateDispatch = DataPayload; +export type GatewayThreadMemberUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-member-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-member-update} */ export type GatewayThreadMemberUpdateDispatchData = APIThreadMember & { guild_id: Snowflake; }; /** * @deprecated This type doesn't accurately reflect the Discord API. - * Use {@apilink GatewayThreadCreateDispatch}, - * {@apilink GatewayThreadUpdateDispatch}, or - * {@apilink GatewayThreadDeleteDispatch} instead. - * https://discord.com/developers/docs/topics/gateway-events#thread-create - * https://discord.com/developers/docs/topics/gateway-events#thread-update - * https://discord.com/developers/docs/topics/gateway-events#thread-delete + * Use {@link GatewayThreadCreateDispatch}, + * {@link GatewayThreadUpdateDispatch}, or + * {@link GatewayThreadDeleteDispatch} instead. + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-delete} */ -export type GatewayThreadModifyDispatch = DataPayload; +export type GatewayThreadModifyDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-create} */ -export type GatewayThreadCreateDispatch = DataPayload; +export type GatewayThreadCreateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-create} */ export interface GatewayThreadCreateDispatchData extends APIThreadChannel { /** @@ -1271,19 +1489,19 @@ export interface GatewayThreadCreateDispatchData extends APIThreadChannel { newly_created?: true; } /** - * https://discord.com/developers/docs/topics/gateway-events#thread-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-update} */ -export type GatewayThreadUpdateDispatch = DataPayload; +export type GatewayThreadUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-update} */ export type GatewayThreadUpdateDispatchData = APIThreadChannel; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-delete} */ -export type GatewayThreadDeleteDispatch = DataPayload; +export type GatewayThreadDeleteDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-delete} */ export interface GatewayThreadDeleteDispatchData { /** @@ -1301,16 +1519,16 @@ export interface GatewayThreadDeleteDispatchData { /** * The type of the channel * - * See https://discord.com/developers/docs/resources/channel#channel-object-channel-types + * @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-types} */ type: ChannelType; } /** - * https://discord.com/developers/docs/topics/gateway-events#typing-start + * @see {@link https://discord.com/developers/docs/topics/gateway-events#typing-start} */ -export type GatewayTypingStartDispatch = DataPayload; +export type GatewayTypingStartDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#typing-start + * @see {@link https://discord.com/developers/docs/topics/gateway-events#typing-start} */ export interface GatewayTypingStartDispatchData { /** @@ -1332,32 +1550,86 @@ export interface GatewayTypingStartDispatchData { /** * The member who started typing if this happened in a guild * - * See https://discord.com/developers/docs/resources/guild#guild-member-object + * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object} */ member?: APIGuildMember; } /** - * https://discord.com/developers/docs/topics/gateway-events#user-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#user-update} */ -export type GatewayUserUpdateDispatch = DataPayload; +export type GatewayUserUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#user-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#user-update} */ export type GatewayUserUpdateDispatchData = APIUser; /** - * https://discord.com/developers/docs/topics/gateway-events#voice-state-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send} */ -export type GatewayVoiceStateUpdateDispatch = DataPayload; +export type GatewayVoiceChannelEffectSendDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#voice-state-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send} */ -export type GatewayVoiceStateUpdateDispatchData = GatewayVoiceState; +export interface GatewayVoiceChannelEffectSendDispatchData { + /** + * ID of the channel the effect was sent in + */ + channel_id: Snowflake; + /** + * ID of the guild the effect was sent in + */ + guild_id: Snowflake; + /** + * ID of the user who sent the effect + */ + user_id: Snowflake; + /** + * The emoji sent, for emoji reaction and soundboard effects + */ + emoji?: APIEmoji | null; + /** + * The type of emoji animation, for emoji reaction and soundboard effects + */ + animation_type?: VoiceChannelEffectSendAnimationType | null; + /** + * The ID of the emoji animation, for emoji reaction and soundboard effects + */ + animation_id?: number; + /** + * The ID of the soundboard sound, for soundboard effects + */ + sound_id?: Snowflake | number; + /** + * The volume of the soundboard sound, from 0 to 1, for soundboard effects + */ + sound_volume?: number; +} /** - * https://discord.com/developers/docs/topics/gateway-events#voice-server-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send-animation-types} */ -export type GatewayVoiceServerUpdateDispatch = DataPayload; +export declare enum VoiceChannelEffectSendAnimationType { + /** + * A fun animation, sent by a Nitro subscriber + */ + Premium = 0, + /** + * The standard animation + */ + Basic = 1 +} /** - * https://discord.com/developers/docs/topics/gateway-events#voice-server-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-state-update} + */ +export type GatewayVoiceStateUpdateDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-state-update} + */ +export type GatewayVoiceStateUpdateDispatchData = APIVoiceState; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-server-update} + */ +export type GatewayVoiceServerUpdateDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-server-update} */ export interface GatewayVoiceServerUpdateDispatchData { /** @@ -1378,11 +1650,11 @@ export interface GatewayVoiceServerUpdateDispatchData { endpoint: string | null; } /** - * https://discord.com/developers/docs/topics/gateway-events#webhooks-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#webhooks-update} */ -export type GatewayWebhooksUpdateDispatch = DataPayload; +export type GatewayWebhooksUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#webhooks-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#webhooks-update} */ export interface GatewayWebhooksUpdateDispatchData { /** @@ -1395,11 +1667,11 @@ export interface GatewayWebhooksUpdateDispatchData { channel_id: Snowflake; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create} */ -export type GatewayGuildAuditLogEntryCreateDispatch = DataPayload; +export type GatewayGuildAuditLogEntryCreateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create} */ export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLogEntry { /** @@ -1408,13 +1680,17 @@ export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLog guild_id: Snowflake; } /** - * https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add} */ -export type GatewayMessagePollVoteAddDispatch = DataPayload; +export type GatewayMessagePollVoteAddDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove} + */ +export type GatewayMessagePollVoteRemoveDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove} */ -export type GatewayMessagePollVoteRemoveDispatch = DataPayload; export interface GatewayMessagePollVoteDispatchData { /** * ID of the user @@ -1438,25 +1714,79 @@ export interface GatewayMessagePollVoteDispatchData { answer_id: number; } /** - * https://discord.com/developers/docs/topics/gateway#sending-heartbeats + * @see {@link https://discord.com/developers/docs/events/gateway-events#rate-limited} + */ +export type GatewayRateLimitedDispatch = _DataPayload>; +/** + * @see {@link https://discord.com/developers/docs/events/gateway-events#rate-limited} + */ +export type GatewayRateLimitedRequestGuildMembersDispatch = GatewayRateLimitedDispatch; +/** + * @see {@link https://discord.com/developers/docs/events/gateway-events#rate-limited} + */ +export interface GatewayRateLimitedDispatchData { + /** + * {@link GatewayOpcodes | Gateway opcode} of the event that was rate limited + */ + opcode: Opcode; + /** + * The number of seconds to wait before submitting another request + */ + retry_after: number; + /** + * Metadata for the event that was rate limited + */ + meta: GatewayOpcodeRateLimitMetadataMap[Opcode]; +} +/** + * @see {@link https://discord.com/developers/docs/events/gateway-events#rate-limited} + */ +export type GatewayRateLimitedRequestGuildMembersDispatchData = GatewayRateLimitedDispatchData; +/** + * Map of gateway opcodes to their rate limit metadata types + * + * @see {@link https://discord.com/developers/docs/events/gateway-events#rate-limited-rate-limit-metadata-for-opcode-structure} + */ +export interface GatewayOpcodeRateLimitMetadataMap { + [GatewayOpcodes.RequestGuildMembers]: GatewayRequestGuildMemberRateLimitMetadata; +} +/** + * Types of metadata that can be received in a {@link GatewayRateLimitedDispatchData.meta} field + */ +export type GatewayRateLimitedMetadata = GatewayOpcodeRateLimitMetadataMap[keyof GatewayOpcodeRateLimitMetadataMap]; +/** + * Rate limit metadata for the {@link GatewayOpcodes.RequestGuildMembers} opcode + */ +export interface GatewayRequestGuildMemberRateLimitMetadata { + /** + * Id of the guild members were requested for + */ + guild_id: Snowflake; + /** + * Nonce used to identify the {@link GatewayGuildMembersChunkDispatch} response + */ + nonce?: string; +} +/** + * @see {@link https://discord.com/developers/docs/topics/gateway#sending-heartbeats} */ export interface GatewayHeartbeat { op: GatewayOpcodes.Heartbeat; d: GatewayHeartbeatData; } /** - * https://discord.com/developers/docs/topics/gateway#sending-heartbeats + * @see {@link https://discord.com/developers/docs/topics/gateway#sending-heartbeats} */ export type GatewayHeartbeatData = number | null; /** - * https://discord.com/developers/docs/topics/gateway-events#identify + * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify} */ export interface GatewayIdentify { op: GatewayOpcodes.Identify; d: GatewayIdentifyData; } /** - * https://discord.com/developers/docs/topics/gateway-events#identify + * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify} */ export interface GatewayIdentifyData { /** @@ -1466,43 +1796,43 @@ export interface GatewayIdentifyData { /** * Connection properties * - * See https://discord.com/developers/docs/topics/gateway-events#identify-identify-connection-properties + * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify-identify-connection-properties} */ properties: GatewayIdentifyProperties; /** * Whether this connection supports compression of packets * - * @default false + * @defaultValue `false` */ compress?: boolean; /** * Value between 50 and 250, total number of members where the gateway will stop sending * offline members in the guild member list * - * @default 50 + * @defaultValue `50` */ large_threshold?: number; /** * Used for Guild Sharding * - * See https://discord.com/developers/docs/topics/gateway#sharding + * @see {@link https://discord.com/developers/docs/topics/gateway#sharding} */ shard?: [shard_id: number, shard_count: number]; /** * Presence structure for initial presence information * - * See https://discord.com/developers/docs/topics/gateway-events#update-presence + * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence} */ presence?: GatewayPresenceUpdateData; /** * The Gateway Intents you wish to receive * - * See https://discord.com/developers/docs/topics/gateway#gateway-intents + * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents} */ intents: number; } /** - * https://discord.com/developers/docs/topics/gateway-events#identify-identify-connection-properties + * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify-identify-connection-properties} */ export interface GatewayIdentifyProperties { /** @@ -1519,14 +1849,14 @@ export interface GatewayIdentifyProperties { device: string; } /** - * https://discord.com/developers/docs/topics/gateway-events#resume + * @see {@link https://discord.com/developers/docs/topics/gateway-events#resume} */ export interface GatewayResume { op: GatewayOpcodes.Resume; d: GatewayResumeData; } /** - * https://discord.com/developers/docs/topics/gateway-events#resume + * @see {@link https://discord.com/developers/docs/topics/gateway-events#resume} */ export interface GatewayResumeData { /** @@ -1543,12 +1873,15 @@ export interface GatewayResumeData { seq: number; } /** - * https://discord.com/developers/docs/topics/gateway-events#request-guild-members + * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members} */ export interface GatewayRequestGuildMembers { op: GatewayOpcodes.RequestGuildMembers; d: GatewayRequestGuildMembersData; } +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members} + */ export interface GatewayRequestGuildMembersDataBase { /** * ID of the guild to get members for @@ -1563,16 +1896,22 @@ export interface GatewayRequestGuildMembersDataBase { * * Nonce can only be up to 32 bytes. If you send an invalid nonce it will be ignored and the reply member_chunk(s) will not have a `nonce` set. * - * See https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk} */ nonce?: string; } +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members} + */ export interface GatewayRequestGuildMembersDataWithUserIds extends GatewayRequestGuildMembersDataBase { /** * Used to specify which users you wish to fetch */ user_ids: Snowflake | Snowflake[]; } +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members} + */ export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestGuildMembersDataBase { /** * String that username starts with, or an empty string to return all members @@ -1585,18 +1924,34 @@ export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestG limit: number; } /** - * https://discord.com/developers/docs/topics/gateway-events#request-guild-members + * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members} */ export type GatewayRequestGuildMembersData = GatewayRequestGuildMembersDataWithQuery | GatewayRequestGuildMembersDataWithUserIds; /** - * https://discord.com/developers/docs/topics/gateway-events#update-voice-state + * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds} + */ +export interface GatewayRequestSoundboardSounds { + op: GatewayOpcodes.RequestSoundboardSounds; + d: GatewayRequestSoundboardSoundsData; +} +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds} + */ +export interface GatewayRequestSoundboardSoundsData { + /** + * The ids of the guilds to get soundboard sounds for + */ + guild_ids: Snowflake[]; +} +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-voice-state} */ export interface GatewayVoiceStateUpdate { op: GatewayOpcodes.VoiceStateUpdate; d: GatewayVoiceStateUpdateData; } /** - * https://discord.com/developers/docs/topics/gateway-events#update-voice-state + * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-voice-state} */ export interface GatewayVoiceStateUpdateData { /** @@ -1617,14 +1972,14 @@ export interface GatewayVoiceStateUpdateData { self_deaf: boolean; } /** - * https://discord.com/developers/docs/topics/gateway-events#update-presence + * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence} */ export interface GatewayUpdatePresence { op: GatewayOpcodes.PresenceUpdate; d: GatewayPresenceUpdateData; } /** - * https://discord.com/developers/docs/topics/gateway-events#update-presence-gateway-presence-update-structure + * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence-gateway-presence-update-structure} */ export interface GatewayPresenceUpdateData { /** @@ -1634,13 +1989,13 @@ export interface GatewayPresenceUpdateData { /** * The user's activities * - * See https://discord.com/developers/docs/topics/gateway-events#activity-object + * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object} */ activities: GatewayActivityUpdateData[]; /** * The user's new status * - * See https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types + * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types} */ status: PresenceUpdateStatus; /** @@ -1649,10 +2004,10 @@ export interface GatewayPresenceUpdateData { afk: boolean; } /** - * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure + * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure} */ export type GatewayActivityUpdateData = Pick; -interface BasePayload { +export interface _BaseBasePayload { /** * Opcode for the payload */ @@ -1661,6 +2016,8 @@ interface BasePayload { * Event data */ d?: unknown; +} +export interface _BasePayload { /** * Sequence number, used for resuming sessions and heartbeats */ @@ -1670,50 +2027,17 @@ interface BasePayload { */ t?: string; } -type NonDispatchPayload = Omit & { +export interface _NonDispatchPayload extends _BaseBasePayload { t: null; s: null; -}; -interface DataPayload extends BasePayload { +} +export interface _DataPayload extends _BasePayload { op: GatewayOpcodes.Dispatch; t: Event; d: D; } -type ReactionData = DataPayload>; -interface MessageReactionRemoveData { +export type GatewayMessageReactionData = _DataPayload>; +export interface GatewayMessageReactionRemoveData { /** * The id of the channel */ diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.d.ts.map b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.d.ts.map index f3da1f3..5402362 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.d.ts.map +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"v10.d.ts","sourceRoot":"","sources":["v10.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EACX,cAAc,EACd,+BAA+B,EAC/B,qBAAqB,EACrB,uBAAuB,EACvB,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,cAAc,EACd,UAAU,EACV,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,qBAAqB,IAAI,wBAAwB,EACjD,qBAAqB,IAAI,wBAAwB,EACjD,0BAA0B,IAAI,6BAA6B,EAC3D,iBAAiB,EACjB,gBAAgB,EAChB,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AC,CACD,CACD,CAAC;AAEF,UAAU,yBAAyB;IAClC;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB"} \ No newline at end of file +{"version":3,"file":"v10.d.ts","sourceRoot":"","sources":["v10.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EACX,cAAc,EACd,+BAA+B,EAC/B,qBAAqB,EACrB,uBAAuB,EACvB,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,IAAI,6BAA6B,EAC3D,gBAAgB,EAChB,oBAAoB,EACpB,6BAA6B,EAC7B,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,gCAAgC,EAChC,cAAc,EACd,aAAa,EACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,mBAAmB,UAAU,CAAC;AAE9B,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC;;GAEG;AACH,oBAAY,cAAc;IACzB;;OAEG;IACH,QAAQ,IAAA;IACR;;;OAGG;IACH,SAAS,IAAA;IACT;;OAEG;IACH,QAAQ,IAAA;IACR;;OAEG;IACH,cAAc,IAAA;IACd;;OAEG;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nG,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC;IAC5B,CAAC,EAAE,KAAK,CAAC;IACT,CAAC,EAAE,CAAC,CAAC;CACL;AAGD,MAAM,MAAM,0BAA0B,CAAC,CAAC,SAAS,qBAAqB,EAAE,CAAC,SAAS,MAAM,GAAG,KAAK,IAAI,YAAY,CAC/G,CAAC,EACD,IAAI,CAAC,qCAAqC,EAAE,CAAC,CAAC,CAC9C,CAAC;AAEF,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB"} \ No newline at end of file diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.js b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.js index a9b16d1..505706c 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.js +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.js @@ -2,26 +2,11 @@ /** * Types extracted from https://discord.com/developers/docs/topics/gateway */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; Object.defineProperty(exports, "__esModule", { value: true }); -exports.GatewayDispatchEvents = exports.GatewayIntentBits = exports.GatewayCloseCodes = exports.GatewayOpcodes = exports.GatewayVersion = void 0; -__exportStar(require("./common"), exports); +exports.VoiceChannelEffectSendAnimationType = exports.GatewayDispatchEvents = exports.GatewayIntentBits = exports.GatewayCloseCodes = exports.GatewayOpcodes = exports.GatewayVersion = void 0; exports.GatewayVersion = '10'; /** - * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes + * @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes} */ var GatewayOpcodes; (function (GatewayOpcodes) { @@ -70,9 +55,13 @@ var GatewayOpcodes; * Sent in response to receiving a heartbeat to acknowledge that it has been received */ GatewayOpcodes[GatewayOpcodes["HeartbeatAck"] = 11] = "HeartbeatAck"; + /** + * Request information about soundboard sounds in a set of guilds + */ + GatewayOpcodes[GatewayOpcodes["RequestSoundboardSounds"] = 31] = "RequestSoundboardSounds"; })(GatewayOpcodes || (exports.GatewayOpcodes = GatewayOpcodes = {})); /** - * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes + * @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes} */ var GatewayCloseCodes; (function (GatewayCloseCodes) { @@ -83,25 +72,25 @@ var GatewayCloseCodes; /** * You sent an invalid Gateway opcode or an invalid payload for an opcode. Don't do that! * - * See https://discord.com/developers/docs/topics/gateway-events#payload-structure + * @see {@link https://discord.com/developers/docs/topics/gateway-events#payload-structure} */ GatewayCloseCodes[GatewayCloseCodes["UnknownOpcode"] = 4001] = "UnknownOpcode"; /** * You sent an invalid payload to us. Don't do that! * - * See https://discord.com/developers/docs/topics/gateway#sending-events + * @see {@link https://discord.com/developers/docs/topics/gateway#sending-events} */ GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError"; /** * You sent us a payload prior to identifying * - * See https://discord.com/developers/docs/topics/gateway-events#identify + * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify} */ GatewayCloseCodes[GatewayCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated"; /** * The account token sent with your identify payload is incorrect * - * See https://discord.com/developers/docs/topics/gateway-events#identify + * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify} */ GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed"; /** @@ -111,7 +100,7 @@ var GatewayCloseCodes; /** * The sequence sent when resuming the session was invalid. Reconnect and start a new session * - * See https://discord.com/developers/docs/topics/gateway-events#resume + * @see {@link https://discord.com/developers/docs/topics/gateway-events#resume} */ GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq"; /** @@ -125,13 +114,13 @@ var GatewayCloseCodes; /** * You sent us an invalid shard when identifying * - * See https://discord.com/developers/docs/topics/gateway#sharding + * @see {@link https://discord.com/developers/docs/topics/gateway#sharding} */ GatewayCloseCodes[GatewayCloseCodes["InvalidShard"] = 4010] = "InvalidShard"; /** * The session would have handled too many guilds - you are required to shard your connection in order to connect * - * See https://discord.com/developers/docs/topics/gateway#sharding + * @see {@link https://discord.com/developers/docs/topics/gateway#sharding} */ GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired"; /** @@ -141,21 +130,20 @@ var GatewayCloseCodes; /** * You sent an invalid intent for a Gateway Intent. You may have incorrectly calculated the bitwise value * - * See https://discord.com/developers/docs/topics/gateway#gateway-intents + * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents} */ GatewayCloseCodes[GatewayCloseCodes["InvalidIntents"] = 4013] = "InvalidIntents"; /** * You sent a disallowed intent for a Gateway Intent. You may have tried to specify an intent that you have not * enabled or are not whitelisted for * - * See https://discord.com/developers/docs/topics/gateway#gateway-intents - * - * See https://discord.com/developers/docs/topics/gateway#privileged-intents + * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents} + * @see {@link https://discord.com/developers/docs/topics/gateway#privileged-intents} */ GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents"; })(GatewayCloseCodes || (exports.GatewayCloseCodes = GatewayCloseCodes = {})); /** - * https://discord.com/developers/docs/topics/gateway#list-of-intents + * @see {@link https://discord.com/developers/docs/topics/gateway#list-of-intents} */ var GatewayIntentBits; (function (GatewayIntentBits) { @@ -163,9 +151,13 @@ var GatewayIntentBits; GatewayIntentBits[GatewayIntentBits["GuildMembers"] = 2] = "GuildMembers"; GatewayIntentBits[GatewayIntentBits["GuildModeration"] = 4] = "GuildModeration"; /** - * @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration} + * @deprecated This is the old name for {@link GatewayIntentBits.GuildModeration} */ GatewayIntentBits[GatewayIntentBits["GuildBans"] = 4] = "GuildBans"; + GatewayIntentBits[GatewayIntentBits["GuildExpressions"] = 8] = "GuildExpressions"; + /** + * @deprecated This is the old name for {@link GatewayIntentBits.GuildExpressions} + */ GatewayIntentBits[GatewayIntentBits["GuildEmojisAndStickers"] = 8] = "GuildEmojisAndStickers"; GatewayIntentBits[GatewayIntentBits["GuildIntegrations"] = 16] = "GuildIntegrations"; GatewayIntentBits[GatewayIntentBits["GuildWebhooks"] = 32] = "GuildWebhooks"; @@ -186,15 +178,23 @@ var GatewayIntentBits; GatewayIntentBits[GatewayIntentBits["DirectMessagePolls"] = 33554432] = "DirectMessagePolls"; })(GatewayIntentBits || (exports.GatewayIntentBits = GatewayIntentBits = {})); /** - * https://discord.com/developers/docs/topics/gateway-events#receive-events + * @see {@link https://discord.com/developers/docs/topics/gateway-events#receive-events} */ var GatewayDispatchEvents; (function (GatewayDispatchEvents) { GatewayDispatchEvents["ApplicationCommandPermissionsUpdate"] = "APPLICATION_COMMAND_PERMISSIONS_UPDATE"; + GatewayDispatchEvents["AutoModerationActionExecution"] = "AUTO_MODERATION_ACTION_EXECUTION"; + GatewayDispatchEvents["AutoModerationRuleCreate"] = "AUTO_MODERATION_RULE_CREATE"; + GatewayDispatchEvents["AutoModerationRuleDelete"] = "AUTO_MODERATION_RULE_DELETE"; + GatewayDispatchEvents["AutoModerationRuleUpdate"] = "AUTO_MODERATION_RULE_UPDATE"; GatewayDispatchEvents["ChannelCreate"] = "CHANNEL_CREATE"; GatewayDispatchEvents["ChannelDelete"] = "CHANNEL_DELETE"; GatewayDispatchEvents["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE"; GatewayDispatchEvents["ChannelUpdate"] = "CHANNEL_UPDATE"; + GatewayDispatchEvents["EntitlementCreate"] = "ENTITLEMENT_CREATE"; + GatewayDispatchEvents["EntitlementDelete"] = "ENTITLEMENT_DELETE"; + GatewayDispatchEvents["EntitlementUpdate"] = "ENTITLEMENT_UPDATE"; + GatewayDispatchEvents["GuildAuditLogEntryCreate"] = "GUILD_AUDIT_LOG_ENTRY_CREATE"; GatewayDispatchEvents["GuildBanAdd"] = "GUILD_BAN_ADD"; GatewayDispatchEvents["GuildBanRemove"] = "GUILD_BAN_REMOVE"; GatewayDispatchEvents["GuildCreate"] = "GUILD_CREATE"; @@ -208,6 +208,16 @@ var GatewayDispatchEvents; GatewayDispatchEvents["GuildRoleCreate"] = "GUILD_ROLE_CREATE"; GatewayDispatchEvents["GuildRoleDelete"] = "GUILD_ROLE_DELETE"; GatewayDispatchEvents["GuildRoleUpdate"] = "GUILD_ROLE_UPDATE"; + GatewayDispatchEvents["GuildScheduledEventCreate"] = "GUILD_SCHEDULED_EVENT_CREATE"; + GatewayDispatchEvents["GuildScheduledEventDelete"] = "GUILD_SCHEDULED_EVENT_DELETE"; + GatewayDispatchEvents["GuildScheduledEventUpdate"] = "GUILD_SCHEDULED_EVENT_UPDATE"; + GatewayDispatchEvents["GuildScheduledEventUserAdd"] = "GUILD_SCHEDULED_EVENT_USER_ADD"; + GatewayDispatchEvents["GuildScheduledEventUserRemove"] = "GUILD_SCHEDULED_EVENT_USER_REMOVE"; + GatewayDispatchEvents["GuildSoundboardSoundCreate"] = "GUILD_SOUNDBOARD_SOUND_CREATE"; + GatewayDispatchEvents["GuildSoundboardSoundDelete"] = "GUILD_SOUNDBOARD_SOUND_DELETE"; + GatewayDispatchEvents["GuildSoundboardSoundsUpdate"] = "GUILD_SOUNDBOARD_SOUNDS_UPDATE"; + GatewayDispatchEvents["GuildSoundboardSoundUpdate"] = "GUILD_SOUNDBOARD_SOUND_UPDATE"; + GatewayDispatchEvents["SoundboardSounds"] = "SOUNDBOARD_SOUNDS"; GatewayDispatchEvents["GuildStickersUpdate"] = "GUILD_STICKERS_UPDATE"; GatewayDispatchEvents["GuildUpdate"] = "GUILD_UPDATE"; GatewayDispatchEvents["IntegrationCreate"] = "INTEGRATION_CREATE"; @@ -219,17 +229,23 @@ var GatewayDispatchEvents; GatewayDispatchEvents["MessageCreate"] = "MESSAGE_CREATE"; GatewayDispatchEvents["MessageDelete"] = "MESSAGE_DELETE"; GatewayDispatchEvents["MessageDeleteBulk"] = "MESSAGE_DELETE_BULK"; + GatewayDispatchEvents["MessagePollVoteAdd"] = "MESSAGE_POLL_VOTE_ADD"; + GatewayDispatchEvents["MessagePollVoteRemove"] = "MESSAGE_POLL_VOTE_REMOVE"; GatewayDispatchEvents["MessageReactionAdd"] = "MESSAGE_REACTION_ADD"; GatewayDispatchEvents["MessageReactionRemove"] = "MESSAGE_REACTION_REMOVE"; GatewayDispatchEvents["MessageReactionRemoveAll"] = "MESSAGE_REACTION_REMOVE_ALL"; GatewayDispatchEvents["MessageReactionRemoveEmoji"] = "MESSAGE_REACTION_REMOVE_EMOJI"; GatewayDispatchEvents["MessageUpdate"] = "MESSAGE_UPDATE"; GatewayDispatchEvents["PresenceUpdate"] = "PRESENCE_UPDATE"; + GatewayDispatchEvents["RateLimited"] = "RATE_LIMITED"; + GatewayDispatchEvents["Ready"] = "READY"; + GatewayDispatchEvents["Resumed"] = "RESUMED"; GatewayDispatchEvents["StageInstanceCreate"] = "STAGE_INSTANCE_CREATE"; GatewayDispatchEvents["StageInstanceDelete"] = "STAGE_INSTANCE_DELETE"; GatewayDispatchEvents["StageInstanceUpdate"] = "STAGE_INSTANCE_UPDATE"; - GatewayDispatchEvents["Ready"] = "READY"; - GatewayDispatchEvents["Resumed"] = "RESUMED"; + GatewayDispatchEvents["SubscriptionCreate"] = "SUBSCRIPTION_CREATE"; + GatewayDispatchEvents["SubscriptionDelete"] = "SUBSCRIPTION_DELETE"; + GatewayDispatchEvents["SubscriptionUpdate"] = "SUBSCRIPTION_UPDATE"; GatewayDispatchEvents["ThreadCreate"] = "THREAD_CREATE"; GatewayDispatchEvents["ThreadDelete"] = "THREAD_DELETE"; GatewayDispatchEvents["ThreadListSync"] = "THREAD_LIST_SYNC"; @@ -238,24 +254,24 @@ var GatewayDispatchEvents; GatewayDispatchEvents["ThreadUpdate"] = "THREAD_UPDATE"; GatewayDispatchEvents["TypingStart"] = "TYPING_START"; GatewayDispatchEvents["UserUpdate"] = "USER_UPDATE"; + GatewayDispatchEvents["VoiceChannelEffectSend"] = "VOICE_CHANNEL_EFFECT_SEND"; GatewayDispatchEvents["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE"; GatewayDispatchEvents["VoiceStateUpdate"] = "VOICE_STATE_UPDATE"; GatewayDispatchEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE"; - GatewayDispatchEvents["MessagePollVoteAdd"] = "MESSAGE_POLL_VOTE_ADD"; - GatewayDispatchEvents["MessagePollVoteRemove"] = "MESSAGE_POLL_VOTE_REMOVE"; - GatewayDispatchEvents["GuildScheduledEventCreate"] = "GUILD_SCHEDULED_EVENT_CREATE"; - GatewayDispatchEvents["GuildScheduledEventUpdate"] = "GUILD_SCHEDULED_EVENT_UPDATE"; - GatewayDispatchEvents["GuildScheduledEventDelete"] = "GUILD_SCHEDULED_EVENT_DELETE"; - GatewayDispatchEvents["GuildScheduledEventUserAdd"] = "GUILD_SCHEDULED_EVENT_USER_ADD"; - GatewayDispatchEvents["GuildScheduledEventUserRemove"] = "GUILD_SCHEDULED_EVENT_USER_REMOVE"; - GatewayDispatchEvents["AutoModerationRuleCreate"] = "AUTO_MODERATION_RULE_CREATE"; - GatewayDispatchEvents["AutoModerationRuleUpdate"] = "AUTO_MODERATION_RULE_UPDATE"; - GatewayDispatchEvents["AutoModerationRuleDelete"] = "AUTO_MODERATION_RULE_DELETE"; - GatewayDispatchEvents["AutoModerationActionExecution"] = "AUTO_MODERATION_ACTION_EXECUTION"; - GatewayDispatchEvents["GuildAuditLogEntryCreate"] = "GUILD_AUDIT_LOG_ENTRY_CREATE"; - GatewayDispatchEvents["EntitlementCreate"] = "ENTITLEMENT_CREATE"; - GatewayDispatchEvents["EntitlementUpdate"] = "ENTITLEMENT_UPDATE"; - GatewayDispatchEvents["EntitlementDelete"] = "ENTITLEMENT_DELETE"; })(GatewayDispatchEvents || (exports.GatewayDispatchEvents = GatewayDispatchEvents = {})); +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send-animation-types} + */ +var VoiceChannelEffectSendAnimationType; +(function (VoiceChannelEffectSendAnimationType) { + /** + * A fun animation, sent by a Nitro subscriber + */ + VoiceChannelEffectSendAnimationType[VoiceChannelEffectSendAnimationType["Premium"] = 0] = "Premium"; + /** + * The standard animation + */ + VoiceChannelEffectSendAnimationType[VoiceChannelEffectSendAnimationType["Basic"] = 1] = "Basic"; +})(VoiceChannelEffectSendAnimationType || (exports.VoiceChannelEffectSendAnimationType = VoiceChannelEffectSendAnimationType = {})); // #endregion Shared //# sourceMappingURL=v10.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.js.map b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.js.map index 25fed4f..d1ed5ac 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.js.map +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.js.map @@ -1 +1 @@ -{"version":3,"file":"v10.js","sourceRoot":"","sources":["v10.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AAsCH,2CAAyB;AAEZ,QAAA,cAAc,GAAG,IAAI,CAAC;AAEnC;;GAEG;AACH,IAAY,cA8CX;AA9CD,WAAY,cAAc;IACzB;;OAEG;IACH,2DAAQ,C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EAA6C,CAAA;IAC7C,oEAA2C,CAAA;IAC3C,uDAA8B,CAAA;IAC9B,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,kEAAyC,CAAA;IACzC,gEAAuC,CAAA;IACvC,2DAAkC,CAAA;IAClC,qEAA4C,CAAA;IAC5C,2EAAkD,CAAA;IAClD,mFAA0D,CAAA;IAC1D,mFAA0D,CAAA;IAC1D,mFAA0D,CAAA;IAC1D,sFAA6D,CAAA;IAC7D,4FAAmE,CAAA;IACnE,iFAAwD,CAAA;IACxD,iFAAwD,CAAA;IACxD,iFAAwD,CAAA;IACxD,2FAAkE,CAAA;IAClE,kFAAyD,CAAA;IACzD,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;AACzC,CAAC,EAnEW,qBAAqB,qCAArB,qBAAqB,QAmEhC;AAm3DD,oBAAoB"} \ No newline at end of file +{"version":3,"file":"v10.js","sourceRoot":"","sources":["v10.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAqDU,QAAA,cAAc,GAAG,IAAI,CAAC;AAEnC;;GAEG;AACH,IAAY,cAkDX;AAlDD,WAAY,cAAc;IACzB;;OAEG;IACH,2DAAQ,CAAA;IACR;;;OAGG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,2DAAQ,CAAA;IACR;;OAEG;IACH,uEAAc,CAAA;IACd;;OAEG;IACH,2EAAgB,CAAA;IAChB;;OAEG;IACH,uDAAU,CAAA;IACV;;OAEG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,iFAAmB,CAAA;IACnB;;OAEG;IACH,uEAAc,CAAA;IACd;;OAEG;IACH,sDAAK,CAAA;IACL;;OAEG;IACH,oEAAY,CAAA;IACZ;;OAEG;IACH,0FAA4B,CAAA;AAC7B,CAAC,EAlDW,cAAc,8BAAd,cAAc,QAkDzB;AAED;;GAEG;AACH,IAAY,iBA6EX;AA7ED,WAAY,iBAAiB;IAC5B;;OAEG;IACH,4EAAoB,CAAA;IACpB;;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EAA0C,CAAA;IAC1C,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,4DAAmC,CAAA;IACnC,sEAA6C,CAAA;IAC7C,oEAA2C,CAAA;IAC3C,uDAA8B,CAAA;IAC9B,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,6EAAoD,CAAA;IACpD,kEAAyC,CAAA;IACzC,gEAAuC,CAAA;IACvC,2DAAkC,CAAA;AACnC,CAAC,EA7EW,qBAAqB,qCAArB,qBAAqB,QA6EhC;AA4uDD;;GAEG;AACH,IAAY,mCASX;AATD,WAAY,mCAAmC;IAC9C;;OAEG;IACH,mGAAO,CAAA;IACP;;OAEG;IACH,+FAAK,CAAA;AACN,CAAC,EATW,mCAAmC,mDAAnC,mCAAmC,QAS9C;AAogBD,oBAAoB"} \ No newline at end of file diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.mjs b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.mjs index 0ee554f..c35163a 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.mjs +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v10.mjs @@ -6,3 +6,4 @@ export const GatewayDispatchEvents = mod.GatewayDispatchEvents; export const GatewayIntentBits = mod.GatewayIntentBits; export const GatewayOpcodes = mod.GatewayOpcodes; export const GatewayVersion = mod.GatewayVersion; +export const VoiceChannelEffectSendAnimationType = mod.VoiceChannelEffectSendAnimationType; diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v6.d.ts b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v6.d.ts index cfc6a3b..c0c5c08 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v6.d.ts +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v6.d.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/topics/gateway */ import type { APIChannel, APIEmoji, APIGuild, APIGuildMember, APIMessage, APIRole, APIUnavailableGuild, APIUser, GatewayActivity, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayVoiceState, InviteTargetUserType, PresenceUpdateStatus } from '../payloads/v6/index'; -export * from './common'; +export type * from './common'; /** * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. */ diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v6.d.ts.map b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v6.d.ts.map index f1a644e..a1504e0 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v6.d.ts.map +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v6.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"v6.d.ts","sourceRoot":"","sources":["v6.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACX,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,UAAU,EACV,OAAO,EACP,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,qBAAqB,IAAI,wBAAwB,EACjD,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,MAAM,sBAAsB,CAAC;AAE9B,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;;;GAIG;AACH,oBAAY,cAAc;IACzB,QAAQ,IAAA;IACR,SAAS,IAAA;IACT,QAAQ,IAAA;IACR,cAAc,IAAA;IACd,gBAAgB,IAAA;IAEhB,MAAM,IAAI;IACV,SAAS,IAAA;IACT,mBAAmB,IAAA;IACnB,cAAc,IAAA;IACd,KAAK,KAAA;IACL,YAAY,KAAA;CACZ;AAED;;;;GAIG;AACH,oBAAY,iBAAiB;IAC5B,YAAY,OAAQ;IACpB,aAAa,OAAA;IACb,WAAW,OAAA;IACX,gBAAgB,OAAA;IAChB,oBAAoB,OAAA;IACpB,oBAAoB,OAAA;IAEpB,UAAU,OAAQ;IAClB,WAAW,OAAA;IACX,eAA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AAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,QAAQ,CAAC;CAChB,EACD,CAAC,CACD,CACD,CAAC;AAEF;;GAEG;AACH,UAAU,yBAAyB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB"} \ No newline at end of file diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v6.js b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v6.js index 20e2d1a..23be104 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v6.js +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v6.js @@ -2,23 +2,8 @@ /** * Types extracted from https://discord.com/developers/docs/topics/gateway */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; Object.defineProperty(exports, "__esModule", { value: true }); exports.GatewayDispatchEvents = exports.GatewayIntentBits = exports.VoiceCloseCodes = exports.VoiceOPCodes = exports.GatewayCloseCodes = exports.GatewayOPCodes = exports.GatewayVersion = void 0; -__exportStar(require("./common"), exports); /** * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. */ diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v6.js.map b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v6.js.map index c6659b4..f50ece0 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v6.js.map +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v6.js.map @@ -1 +1 @@ -{"version":3,"file":"v6.js","sourceRoot":"","sources":["v6.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AAkBH,2CAAyB;AAEzB;;GAEG;AACU,QAAA,cAAc,GAAG,GAAG,CAAC;AAElC;;;;GAIG;AACH,IAAY,cAaX;AAbD,WAAY,cAAc;IACzB,2DAAQ,CAAA;IACR,6DAAS,CAAA;IACT,2DAAQ,CAAA;IACR,uEAAc,CAAA;IACd,2EAAgB,CAAA;IAEhB,uDAAU,CAAA;IACV,6DAAS,CAAA;IACT,iFAAmB,CAAA;IACnB,uEAAc,CAAA;IACd,sDAAK,CAAA;IACL,oEAAY,CAAA;AACb,CAAC,EAbW,cAAc,8BAAd,cAAc,QAazB;AAED;;;;GAIG;AACH,IAAY,iBAgBX;AAhBD,WAAY,iBAAiB;IAC5B,4EAAoB,CAAA;IACpB,8EAAa,CAAA;IACb,0EAAW,CAAA;IACX,oFAAgB,CAAA;IAChB,4FAAoB,CAAA;IACpB,4FAAoB,CAAA;IAEpB,wEAAkB,CAAA;IAClB,0EAAW,CAAA;IACX,kFAAe,CAAA;IACf,4EAAY,CAAA;IACZ,oFAAgB,CAAA;IAChB,sFAAiB,CAAA;IACjB,gFAAc,CAAA;IACd,sFAAiB,CAAA;AAClB,CAAC,EAhBW,iBAAiB,iCAAjB,iBAAiB,QAgB5B;AAED;;;;GAIG;AACH,IAAY,YAaX;AAbD,WAAY,YAAY;IACvB,uDAAQ,CAAA;IACR,mEAAc,CAAA;IACd,iDAAK,CAAA;IACL,yDAAS,CAAA;IACT,2EAAkB,CAAA;IAClB,uDAAQ,CAAA;IACR,+DAAY,CAAA;IACZ,mDAAM,CAAA;IACN,iDAAK,CAAA;IACL,qDAAO,CAAA;IAEP,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,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,oEAA2C,CAAA;IAC3C,0EAAiD,CAAA;IACjD,iFAAwD,CAAA;IACxD,qFAA4D,CAAA;IAC5D,2DAAkC,CAAA;IAClC,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,gEAAuC,CAAA;IACvC,kEAAyC,CAAA;IACzC,2DAAkC,CAAA;AACnC,CAAC,EArCW,qBAAqB,qCAArB,qBAAqB,QAqChC;AAmrBD,oBAAoB"} \ No newline at end of file +{"version":3,"file":"v6.js","sourceRoot":"","sources":["v6.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAoBH;;GAEG;AACU,QAAA,cAAc,GAAG,GAAG,CAAC;AAElC;;;;GAIG;AACH,IAAY,cAaX;AAbD,WAAY,cAAc;IACzB,2DAAQ,CAAA;IACR,6DAAS,CAAA;IACT,2DAAQ,CAAA;IACR,uEAAc,CAAA;IACd,2EAAgB,CAAA;IAEhB,uDAAU,CAAA;IACV,6DAAS,CAAA;IACT,iFAAmB,CAAA;IACnB,uEAAc,CAAA;IACd,sDAAK,CAAA;IACL,oEAAY,CAAA;AACb,CAAC,EAbW,cAAc,8BAAd,cAAc,QAazB;AAED;;;;GAIG;AACH,IAAY,iBAgBX;AAhBD,WAAY,iBAAiB;IAC5B,4EAAoB,CAAA;IACpB,8EAAa,CAAA;IACb,0EAAW,CAAA;IACX,oFAAgB,CAAA;IAChB,4FAAoB,CAAA;IACpB,4FAAoB,CAAA;IAEpB,wEAAkB,CAAA;IAClB,0EAAW,CAAA;IACX,kFAAe,CAAA;IACf,4EAAY,CAAA;IACZ,oFAAgB,CAAA;IAChB,sFAAiB,CAAA;IACjB,gFAAc,CAAA;IACd,sFAAiB,CAAA;AAClB,CAAC,EAhBW,iBAAiB,iC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AyC,CAAA;IACzC,qDAA4B,CAAA;IAC5B,qDAA4B,CAAA;IAC5B,qDAA4B,CAAA;IAC5B,sDAA6B,CAAA;IAC7B,4DAAmC,CAAA;IACnC,kEAAyC,CAAA;IACzC,8EAAqD,CAAA;IACrD,4DAAmC,CAAA;IACnC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,oEAA2C,CAAA;IAC3C,0EAAiD,CAAA;IACjD,iFAAwD,CAAA;IACxD,qFAA4D,CAAA;IAC5D,2DAAkC,CAAA;IAClC,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,gEAAuC,CAAA;IACvC,kEAAyC,CAAA;IACzC,2DAAkC,CAAA;AACnC,CAAC,EArCW,qBAAqB,qCAArB,qBAAqB,QAqChC;AAirBD,oBAAoB"} \ No newline at end of file diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v8.d.ts b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v8.d.ts index 43223fc..7e4129e 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v8.d.ts +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v8.d.ts @@ -3,8 +3,8 @@ */ import type { Snowflake } from '../globals'; import type { APIApplication, APIChannel, APIEmoji, APIGuild, APIGuildIntegration, APIGuildMember, APIGuildScheduledEvent, APIInteraction, APIMessage, APIRole, APIStageInstance, APISticker, APIUnavailableGuild, APIUser, GatewayActivity, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayVoiceState, InviteTargetType, PresenceUpdateStatus } from '../payloads/v8/index'; -import type { Nullable } from '../utils/internals'; -export * from './common'; +import type { _Nullable } from '../utils/internals'; +export type * from './common'; /** * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ @@ -641,7 +641,7 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload> & Omit & Partial> & Required> & { +export type GatewayGuildMemberUpdateDispatchData = _Nullable> & Omit & Partial> & Required> & { /** * The id of the guild */ diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v8.d.ts.map b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v8.d.ts.map index bd4594e..aa5803b 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v8.d.ts.map +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v8.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"v8.d.ts","sourceRoot":"","sources":["v8.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EACX,cAAc,EACd,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,cAAc,EACd,UAAU,EACV,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,qBAAqB,IAAI,wBAAwB,EACjD,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;;;GAIG;AACH,oBAAY,cAAc;IACzB;;OAEG;IACH,QAAQ,IAAA;IACR;;;OAGG;IACH,SAAS,IAAA;IACT;;OAEG;IACH,QAAQ,IAAA;IACR;;OAEG;IACH,cAAc,IAAA;IACd;;OAEG;IACH,gBAAgB,IAAA;IAChB;;OAEG;IACH,MAAM,IAAI;IACV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 No newline at end of file +{"version":3,"file":"v8.d.ts","sourceRoot":"","sources":["v8.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EACX,cAAc,EACd,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,cAAc,EACd,UAAU,EACV,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,qBAAqB,IAAI,wBAAwB,EACjD,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,mBAAmB,UAAU,CAAC;AAE9B;;GAEG;AACH,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;;;GAIG;AACH,oBAAY,cAAc;IACzB;;OAEG;IACH,QAAQ,IAAA;IACR;;;OAGG;IACH,SAAS,IAAA;IACT;;OAEG;IACH,QAAQ,IAAA;IACR;;OAEG;IACH,cAAc,IAAA;IACd;;OAEG;IACH,gBAAgB,IAAA;IAChB;;OAEG;IACH,MAAM,IAAI;IACV;;OAEG;IACH,SAAS,IAAA;IACT;;OAEG;IACH,mBAAmB,IAAA;IACnB;;OAEG;IACH,cAAc,IAAA;IACd;;OAEG;IACH,KAAK,KAAA;IACL;;OAEG;IACH,YAAY,KAAA;CACZ;AAED;;;;GAIG;AACH,oBAAY,iBAAiB;IAC5B;;OAEG;IACH,YAAY,OAAQ;IACpB;;;;OAIG;IACH,aAAa,OAAA;IACb;;;;OAIG;IACH,WAAW,OAAA;IACX;;;;OAIG;IACH,gBAAgB,OAAA;IAChB;;;;OAIG;IACH,oBAAoB,OAAA;IACpB;;OAEG;IACH,oBAAoB,OAAA;IACpB;;;;OAIG;IACH,UAAU,OAAQ;IAClB;;OAEG;IACH,WAAW,OAAA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AU,WAAW,CAAC,KAAK,SAAS,qBAAqB,EAAE,CAAC,GAAG,OAAO,CAAE,SAAQ,WAAW;IAC1F,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC;IAC5B,CAAC,EAAE,KAAK,CAAC;IACT,CAAC,EAAE,CAAC,CAAC;CACL;AAED,KAAK,YAAY,CAAC,CAAC,SAAS,qBAAqB,EAAE,CAAC,SAAS,MAAM,GAAG,KAAK,IAAI,WAAW,CACzF,CAAC,EACD,IAAI,CACH;IACC;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;;;OAIG;IACH,KAAK,EAAE,QAAQ,CAAC;CAChB,EACD,CAAC,CACD,CACD,CAAC;AAEF;;GAEG;AACH,UAAU,yBAAyB;IAClC;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB"} \ No newline at end of file diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v8.js b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v8.js index 56b95b2..dbbd32c 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v8.js +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v8.js @@ -2,23 +2,8 @@ /** * Types extracted from https://discord.com/developers/docs/topics/gateway */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; Object.defineProperty(exports, "__esModule", { value: true }); exports.GatewayDispatchEvents = exports.GatewayIntentBits = exports.GatewayCloseCodes = exports.GatewayOpcodes = exports.GatewayVersion = void 0; -__exportStar(require("./common"), exports); /** * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v8.js.map b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v8.js.map index 594acd2..4a9a999 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v8.js.map +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v8.js.map @@ -1 +1 @@ -{"version":3,"file":"v8.js","sourceRoot":"","sources":["v8.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AA0BH,2CAAyB;AAEzB;;GAEG;AACU,QAAA,cAAc,GAAG,GAAG,CAAC;AAElC;;;;GAIG;AACH,IAAY,cA8CX;AA9CD,WAAY,cAAc;IACzB;;OAEG;IACH,2DAAQ,CAAA;IACR;;;OAGG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,2DAAQ,CAAA;IACR;;OAEG;IACH,uEAAc,CAAA;IACd;;OAEG;IACH,2EAAgB,CAAA;IAChB;;OAEG;IACH,uDAAU,CAAA;IACV;;OAEG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,iFAAmB,CAAA;IACnB;;OAEG;IACH,uEAAc,CAAA;IACd;;OAEG;IACH,sDAAK,CAAA;IACL;;OAEG;IACH,oEAAY,CAAA;AACb,CAAC,EA9CW,cAAc,8BAAd,cAAc,QA8CzB;AAED;;;;GAIG;AACH,IAAY,iBA8EX;AA9ED,W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BAAiB,QAiB5B;AAED;;;;GAIG;AACH,IAAY,qBAkDX;AAlDD,WAAY,qBAAqB;IAChC,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,yDAAgC,CAAA;IAChC,sDAA6B,CAAA;IAC7B,4DAAmC,CAAA;IACnC,qDAA4B,CAAA;IAC5B,qDAA4B,CAAA;IAC5B,kEAAyC,CAAA;IACzC,8EAAqD,CAAA;IACrD,4DAAmC,CAAA;IACnC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,sEAA6C,CAAA;IAC7C,qDAA4B,CAAA;IAC5B,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,oEAA2C,CAAA;IAC3C,0EAAiD,CAAA;IACjD,iFAAwD,CAAA;IACxD,qFAA4D,CAAA;IAC5D,yDAAgC,CAAA;IAChC,2DAAkC,CAAA;IAClC,sEAA6C,CAAA;IAC7C,sEAA6C,CAAA;IAC7C,sEAA6C,CAAA;IAC7C,wCAAe,CAAA;IACf,4CAAmB,CAAA;IACnB,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,kEAAyC,CAAA;IACzC,gEAAuC,CAAA;IACvC,2DAAkC,CAAA;IAClC,mFAA0D,CAAA;IAC1D,mFAA0D,CAAA;IAC1D,mFAA0D,CAAA;IAC1D,sFAA6D,CAAA;IAC7D,4FAAmE,CAAA;AACpE,CAAC,EAlDW,qBAAqB,qCAArB,qBAAqB,QAkDhC;AAgoDD,oBAAoB"} \ No newline at end of file diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.d.ts b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.d.ts index 9a31cd5..11ea1c5 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.d.ts +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.d.ts @@ -2,14 +2,12 @@ * Types extracted from https://discord.com/developers/docs/topics/gateway */ import type { Snowflake } from '../globals'; -import type { GatewayPresenceUpdate } from '../payloads/v9/gateway'; -import type { APIApplication, APIApplicationCommandPermission, APIAutoModerationRule, APIAutoModerationAction, APIChannel, APIEmoji, APIGuild, APIGuildIntegration, APIGuildMember, APIGuildScheduledEvent, APIInteraction, APIMessage, APIRole, APIStageInstance, APISticker, APIThreadChannel, APIThreadMember, APIUnavailableGuild, APIUser, GatewayActivity, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayThreadListSync as RawGatewayThreadListSync, GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate, GatewayVoiceState, InviteTargetType, PresenceUpdateStatus, AutoModerationRuleTriggerType, APIAuditLogEntry, ChannelType } from '../payloads/v9/index'; -import type { Nullable } from '../utils/internals'; -import type { APIEntitlement } from '../v10'; -export * from './common'; +import type { APIApplication, APIApplicationCommandPermission, APIAutoModerationRule, APIAutoModerationAction, APIChannel, APIEmoji, APIGuild, APIGuildIntegration, APIGuildMember, APIGuildScheduledEvent, APIInteraction, APIRole, APIStageInstance, APISticker, APIThreadChannel, APIThreadMember, APIUnavailableGuild, APIUser, GatewayActivity, GatewayPresenceUpdate, GatewayThreadListSync, GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate, InviteTargetType, PresenceUpdateStatus, AutoModerationRuleTriggerType, APIAuditLogEntry, ChannelType, APISubscription, APISoundboardSound, GuildChannelType, ThreadChannelType, APIEntitlement, APIBaseGuild, APIBaseGuildMember, APIBaseVoiceState, APIBaseVoiceGuildMember, APIFlaggedGuildMember, APIGuildMemberUser, APIGuildMemberAvatar, GatewayGuildMembersChunkPresence, APIBaseMessage, APIGuildMemberJoined, APIVoiceState } from '../payloads/v9/index'; +import type { ReactionType } from '../rest/v9/index'; +export type * from './common'; export declare const GatewayVersion = "9"; /** - * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes + * @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes} */ export declare enum GatewayOpcodes { /** @@ -56,10 +54,14 @@ export declare enum GatewayOpcodes { /** * Sent in response to receiving a heartbeat to acknowledge that it has been received */ - HeartbeatAck = 11 + HeartbeatAck = 11, + /** + * Request information about soundboard sounds in a set of guilds + */ + RequestSoundboardSounds = 31 } /** - * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes + * @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes} */ export declare enum GatewayCloseCodes { /** @@ -69,25 +71,25 @@ export declare enum GatewayCloseCodes { /** * You sent an invalid Gateway opcode or an invalid payload for an opcode. Don't do that! * - * See https://discord.com/developers/docs/topics/gateway-events#payload-structure + * @see {@link https://discord.com/developers/docs/topics/gateway-events#payload-structure} */ UnknownOpcode = 4001, /** * You sent an invalid payload to us. Don't do that! * - * See https://discord.com/developers/docs/topics/gateway#sending-events + * @see {@link https://discord.com/developers/docs/topics/gateway#sending-events} */ DecodeError = 4002, /** * You sent us a payload prior to identifying * - * See https://discord.com/developers/docs/topics/gateway-events#identify + * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify} */ NotAuthenticated = 4003, /** * The account token sent with your identify payload is incorrect * - * See https://discord.com/developers/docs/topics/gateway-events#identify + * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify} */ AuthenticationFailed = 4004, /** @@ -97,7 +99,7 @@ export declare enum GatewayCloseCodes { /** * The sequence sent when resuming the session was invalid. Reconnect and start a new session * - * See https://discord.com/developers/docs/topics/gateway-events#resume + * @see {@link https://discord.com/developers/docs/topics/gateway-events#resume} */ InvalidSeq = 4007, /** @@ -111,13 +113,13 @@ export declare enum GatewayCloseCodes { /** * You sent us an invalid shard when identifying * - * See https://discord.com/developers/docs/topics/gateway#sharding + * @see {@link https://discord.com/developers/docs/topics/gateway#sharding} */ InvalidShard = 4010, /** * The session would have handled too many guilds - you are required to shard your connection in order to connect * - * See https://discord.com/developers/docs/topics/gateway#sharding + * @see {@link https://discord.com/developers/docs/topics/gateway#sharding} */ ShardingRequired = 4011, /** @@ -127,30 +129,33 @@ export declare enum GatewayCloseCodes { /** * You sent an invalid intent for a Gateway Intent. You may have incorrectly calculated the bitwise value * - * See https://discord.com/developers/docs/topics/gateway#gateway-intents + * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents} */ InvalidIntents = 4013, /** * You sent a disallowed intent for a Gateway Intent. You may have tried to specify an intent that you have not * enabled or are not whitelisted for * - * See https://discord.com/developers/docs/topics/gateway#gateway-intents - * - * See https://discord.com/developers/docs/topics/gateway#privileged-intents + * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents} + * @see {@link https://discord.com/developers/docs/topics/gateway#privileged-intents} */ DisallowedIntents = 4014 } /** - * https://discord.com/developers/docs/topics/gateway#list-of-intents + * @see {@link https://discord.com/developers/docs/topics/gateway#list-of-intents} */ export declare enum GatewayIntentBits { Guilds = 1, GuildMembers = 2, GuildModeration = 4, /** - * @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration} + * @deprecated This is the old name for {@link GatewayIntentBits.GuildModeration} */ GuildBans = 4, + GuildExpressions = 8, + /** + * @deprecated This is the old name for {@link GatewayIntentBits.GuildExpressions} + */ GuildEmojisAndStickers = 8, GuildIntegrations = 16, GuildWebhooks = 32, @@ -170,14 +175,22 @@ export declare enum GatewayIntentBits { DirectMessagePolls = 33554432 } /** - * https://discord.com/developers/docs/topics/gateway-events#receive-events + * @see {@link https://discord.com/developers/docs/topics/gateway-events#receive-events} */ export declare enum GatewayDispatchEvents { ApplicationCommandPermissionsUpdate = "APPLICATION_COMMAND_PERMISSIONS_UPDATE", + AutoModerationActionExecution = "AUTO_MODERATION_ACTION_EXECUTION", + AutoModerationRuleCreate = "AUTO_MODERATION_RULE_CREATE", + AutoModerationRuleDelete = "AUTO_MODERATION_RULE_DELETE", + AutoModerationRuleUpdate = "AUTO_MODERATION_RULE_UPDATE", ChannelCreate = "CHANNEL_CREATE", ChannelDelete = "CHANNEL_DELETE", ChannelPinsUpdate = "CHANNEL_PINS_UPDATE", ChannelUpdate = "CHANNEL_UPDATE", + EntitlementCreate = "ENTITLEMENT_CREATE", + EntitlementDelete = "ENTITLEMENT_DELETE", + EntitlementUpdate = "ENTITLEMENT_UPDATE", + GuildAuditLogEntryCreate = "GUILD_AUDIT_LOG_ENTRY_CREATE", GuildBanAdd = "GUILD_BAN_ADD", GuildBanRemove = "GUILD_BAN_REMOVE", GuildCreate = "GUILD_CREATE", @@ -191,6 +204,16 @@ export declare enum GatewayDispatchEvents { GuildRoleCreate = "GUILD_ROLE_CREATE", GuildRoleDelete = "GUILD_ROLE_DELETE", GuildRoleUpdate = "GUILD_ROLE_UPDATE", + GuildScheduledEventCreate = "GUILD_SCHEDULED_EVENT_CREATE", + GuildScheduledEventDelete = "GUILD_SCHEDULED_EVENT_DELETE", + GuildScheduledEventUpdate = "GUILD_SCHEDULED_EVENT_UPDATE", + GuildScheduledEventUserAdd = "GUILD_SCHEDULED_EVENT_USER_ADD", + GuildScheduledEventUserRemove = "GUILD_SCHEDULED_EVENT_USER_REMOVE", + GuildSoundboardSoundCreate = "GUILD_SOUNDBOARD_SOUND_CREATE", + GuildSoundboardSoundDelete = "GUILD_SOUNDBOARD_SOUND_DELETE", + GuildSoundboardSoundsUpdate = "GUILD_SOUNDBOARD_SOUNDS_UPDATE", + GuildSoundboardSoundUpdate = "GUILD_SOUNDBOARD_SOUND_UPDATE", + SoundboardSounds = "SOUNDBOARD_SOUNDS", GuildStickersUpdate = "GUILD_STICKERS_UPDATE", GuildUpdate = "GUILD_UPDATE", IntegrationCreate = "INTEGRATION_CREATE", @@ -202,17 +225,23 @@ export declare enum GatewayDispatchEvents { MessageCreate = "MESSAGE_CREATE", MessageDelete = "MESSAGE_DELETE", MessageDeleteBulk = "MESSAGE_DELETE_BULK", + MessagePollVoteAdd = "MESSAGE_POLL_VOTE_ADD", + MessagePollVoteRemove = "MESSAGE_POLL_VOTE_REMOVE", MessageReactionAdd = "MESSAGE_REACTION_ADD", MessageReactionRemove = "MESSAGE_REACTION_REMOVE", MessageReactionRemoveAll = "MESSAGE_REACTION_REMOVE_ALL", MessageReactionRemoveEmoji = "MESSAGE_REACTION_REMOVE_EMOJI", MessageUpdate = "MESSAGE_UPDATE", PresenceUpdate = "PRESENCE_UPDATE", + RateLimited = "RATE_LIMITED", + Ready = "READY", + Resumed = "RESUMED", StageInstanceCreate = "STAGE_INSTANCE_CREATE", StageInstanceDelete = "STAGE_INSTANCE_DELETE", StageInstanceUpdate = "STAGE_INSTANCE_UPDATE", - Ready = "READY", - Resumed = "RESUMED", + SubscriptionCreate = "SUBSCRIPTION_CREATE", + SubscriptionDelete = "SUBSCRIPTION_DELETE", + SubscriptionUpdate = "SUBSCRIPTION_UPDATE", ThreadCreate = "THREAD_CREATE", ThreadDelete = "THREAD_DELETE", ThreadListSync = "THREAD_LIST_SYNC", @@ -221,37 +250,23 @@ export declare enum GatewayDispatchEvents { ThreadUpdate = "THREAD_UPDATE", TypingStart = "TYPING_START", UserUpdate = "USER_UPDATE", + VoiceChannelEffectSend = "VOICE_CHANNEL_EFFECT_SEND", VoiceServerUpdate = "VOICE_SERVER_UPDATE", VoiceStateUpdate = "VOICE_STATE_UPDATE", - WebhooksUpdate = "WEBHOOKS_UPDATE", - MessagePollVoteAdd = "MESSAGE_POLL_VOTE_ADD", - MessagePollVoteRemove = "MESSAGE_POLL_VOTE_REMOVE", - GuildScheduledEventCreate = "GUILD_SCHEDULED_EVENT_CREATE", - GuildScheduledEventUpdate = "GUILD_SCHEDULED_EVENT_UPDATE", - GuildScheduledEventDelete = "GUILD_SCHEDULED_EVENT_DELETE", - GuildScheduledEventUserAdd = "GUILD_SCHEDULED_EVENT_USER_ADD", - GuildScheduledEventUserRemove = "GUILD_SCHEDULED_EVENT_USER_REMOVE", - AutoModerationRuleCreate = "AUTO_MODERATION_RULE_CREATE", - AutoModerationRuleUpdate = "AUTO_MODERATION_RULE_UPDATE", - AutoModerationRuleDelete = "AUTO_MODERATION_RULE_DELETE", - AutoModerationActionExecution = "AUTO_MODERATION_ACTION_EXECUTION", - GuildAuditLogEntryCreate = "GUILD_AUDIT_LOG_ENTRY_CREATE", - EntitlementCreate = "ENTITLEMENT_CREATE", - EntitlementUpdate = "ENTITLEMENT_UPDATE", - EntitlementDelete = "ENTITLEMENT_DELETE" + WebhooksUpdate = "WEBHOOKS_UPDATE" } -export type GatewaySendPayload = GatewayHeartbeat | GatewayIdentify | GatewayRequestGuildMembers | GatewayResume | GatewayUpdatePresence | GatewayVoiceStateUpdate; +export type GatewaySendPayload = GatewayHeartbeat | GatewayIdentify | GatewayRequestGuildMembers | GatewayRequestSoundboardSounds | GatewayResume | GatewayUpdatePresence | GatewayVoiceStateUpdate; export type GatewayReceivePayload = GatewayDispatchPayload | GatewayHeartbeatAck | GatewayHeartbeatRequest | GatewayHello | GatewayInvalidSession | GatewayReconnect; -export type GatewayDispatchPayload = GatewayApplicationCommandPermissionsUpdateDispatch | GatewayAutoModerationActionExecutionDispatch | GatewayAutoModerationRuleCreateDispatch | GatewayAutoModerationRuleDeleteDispatch | GatewayAutoModerationRuleModifyDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayEntitlementModifyDispatch | GatewayGuildAuditLogEntryCreateDispatch | GatewayGuildBanModifyDispatch | GatewayGuildCreateDispatch | GatewayGuildDeleteDispatch | GatewayGuildEmojisUpdateDispatch | GatewayGuildIntegrationsUpdateDispatch | GatewayGuildMemberAddDispatch | GatewayGuildMemberRemoveDispatch | GatewayGuildMembersChunkDispatch | GatewayGuildMemberUpdateDispatch | GatewayGuildModifyDispatch | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildScheduledEventCreateDispatch | GatewayGuildScheduledEventDeleteDispatch | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventUserAddDispatch | GatewayGuildScheduledEventUserRemoveDispatch | GatewayGuildStickersUpdateDispatch | GatewayIntegrationCreateDispatch | GatewayIntegrationDeleteDispatch | GatewayIntegrationUpdateDispatch | GatewayInteractionCreateDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch | GatewayMessageCreateDispatch | GatewayMessageDeleteBulkDispatch | GatewayMessageDeleteDispatch | GatewayMessagePollVoteAddDispatch | GatewayMessagePollVoteRemoveDispatch | GatewayMessageReactionAddDispatch | GatewayMessageReactionRemoveAllDispatch | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch | GatewayReadyDispatch | GatewayResumedDispatch | GatewayStageInstanceCreateDispatch | GatewayStageInstanceDeleteDispatch | GatewayStageInstanceUpdateDispatch | GatewayThreadCreateDispatch | GatewayThreadDeleteDispatch | GatewayThreadListSyncDispatch | GatewayThreadMembersUpdateDispatch | GatewayThreadMemberUpdateDispatch | GatewayThreadUpdateDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceServerUpdateDispatch | GatewayVoiceStateUpdateDispatch | GatewayWebhooksUpdateDispatch; +export type GatewayDispatchPayload = GatewayApplicationCommandPermissionsUpdateDispatch | GatewayAutoModerationActionExecutionDispatch | GatewayAutoModerationRuleCreateDispatch | GatewayAutoModerationRuleDeleteDispatch | GatewayAutoModerationRuleModifyDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayEntitlementModifyDispatch | GatewayGuildAuditLogEntryCreateDispatch | GatewayGuildBanModifyDispatch | GatewayGuildCreateDispatch | GatewayGuildDeleteDispatch | GatewayGuildEmojisUpdateDispatch | GatewayGuildIntegrationsUpdateDispatch | GatewayGuildMemberAddDispatch | GatewayGuildMemberRemoveDispatch | GatewayGuildMembersChunkDispatch | GatewayGuildMemberUpdateDispatch | GatewayGuildModifyDispatch | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildScheduledEventCreateDispatch | GatewayGuildScheduledEventDeleteDispatch | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventUserAddDispatch | GatewayGuildScheduledEventUserRemoveDispatch | GatewayGuildSoundboardSoundCreateDispatch | GatewayGuildSoundboardSoundDeleteDispatch | GatewayGuildSoundboardSoundsUpdateDispatch | GatewayGuildSoundboardSoundUpdateDispatch | GatewayGuildStickersUpdateDispatch | GatewayIntegrationCreateDispatch | GatewayIntegrationDeleteDispatch | GatewayIntegrationUpdateDispatch | GatewayInteractionCreateDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch | GatewayMessageCreateDispatch | GatewayMessageDeleteBulkDispatch | GatewayMessageDeleteDispatch | GatewayMessagePollVoteAddDispatch | GatewayMessagePollVoteRemoveDispatch | GatewayMessageReactionAddDispatch | GatewayMessageReactionRemoveAllDispatch | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch | GatewayRateLimitedDispatch | GatewayReadyDispatch | GatewayResumedDispatch | GatewaySoundboardSoundsDispatch | GatewayStageInstanceCreateDispatch | GatewayStageInstanceDeleteDispatch | GatewayStageInstanceUpdateDispatch | GatewaySubscriptionModifyDispatch | GatewayThreadCreateDispatch | GatewayThreadDeleteDispatch | GatewayThreadListSyncDispatch | GatewayThreadMembersUpdateDispatch | GatewayThreadMemberUpdateDispatch | GatewayThreadUpdateDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceChannelEffectSendDispatch | GatewayVoiceServerUpdateDispatch | GatewayVoiceStateUpdateDispatch | GatewayWebhooksUpdateDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#hello + * @see {@link https://discord.com/developers/docs/topics/gateway-events#hello} */ -export interface GatewayHello extends NonDispatchPayload { +export interface GatewayHello extends _NonDispatchPayload { op: GatewayOpcodes.Hello; d: GatewayHelloData; } /** - * https://discord.com/developers/docs/topics/gateway-events#hello + * @see {@link https://discord.com/developers/docs/topics/gateway-events#hello} */ export interface GatewayHelloData { /** @@ -260,61 +275,61 @@ export interface GatewayHelloData { heartbeat_interval: number; } /** - * https://discord.com/developers/docs/topics/gateway#sending-heartbeats + * @see {@link https://discord.com/developers/docs/topics/gateway#sending-heartbeats} */ -export interface GatewayHeartbeatRequest extends NonDispatchPayload { +export interface GatewayHeartbeatRequest extends _NonDispatchPayload { op: GatewayOpcodes.Heartbeat; d: never; } /** - * https://discord.com/developers/docs/topics/gateway-events#heartbeat + * @see {@link https://discord.com/developers/docs/topics/gateway-events#heartbeat} */ -export interface GatewayHeartbeatAck extends NonDispatchPayload { +export interface GatewayHeartbeatAck extends _NonDispatchPayload { op: GatewayOpcodes.HeartbeatAck; d: never; } /** - * https://discord.com/developers/docs/topics/gateway-events#invalid-session + * @see {@link https://discord.com/developers/docs/topics/gateway-events#invalid-session} */ -export interface GatewayInvalidSession extends NonDispatchPayload { +export interface GatewayInvalidSession extends _NonDispatchPayload { op: GatewayOpcodes.InvalidSession; d: GatewayInvalidSessionData; } /** - * https://discord.com/developers/docs/topics/gateway-events#invalid-session + * @see {@link https://discord.com/developers/docs/topics/gateway-events#invalid-session} */ export type GatewayInvalidSessionData = boolean; /** - * https://discord.com/developers/docs/topics/gateway-events#reconnect + * @see {@link https://discord.com/developers/docs/topics/gateway-events#reconnect} */ -export interface GatewayReconnect extends NonDispatchPayload { +export interface GatewayReconnect extends _NonDispatchPayload { op: GatewayOpcodes.Reconnect; d: never; } /** - * https://discord.com/developers/docs/topics/gateway-events#ready + * @see {@link https://discord.com/developers/docs/topics/gateway-events#ready} */ -export type GatewayReadyDispatch = DataPayload; +export type GatewayReadyDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#ready + * @see {@link https://discord.com/developers/docs/topics/gateway-events#ready} */ export interface GatewayReadyDispatchData { /** * Gateway version * - * See https://discord.com/developers/docs/reference#api-versioning + * @see {@link https://discord.com/developers/docs/reference#api-versioning} */ v: number; /** * Information about the user including email * - * See https://discord.com/developers/docs/resources/user#user-object + * @see {@link https://discord.com/developers/docs/resources/user#user-object} */ user: APIUser; /** * The guilds the user is in * - * See https://discord.com/developers/docs/resources/guild#unavailable-guild-object + * @see {@link https://discord.com/developers/docs/resources/guild#unavailable-guild-object} */ guilds: APIUnavailableGuild[]; /** @@ -328,62 +343,62 @@ export interface GatewayReadyDispatchData { /** * The shard information associated with this session, if sent when identifying * - * See https://discord.com/developers/docs/topics/gateway#sharding + * @see {@link https://discord.com/developers/docs/topics/gateway#sharding} */ shard?: [shard_id: number, shard_count: number]; /** * Contains `id` and `flags` * - * See https://discord.com/developers/docs/resources/application#application-object + * @see {@link https://discord.com/developers/docs/resources/application#application-object} */ application: Pick; } /** - * https://discord.com/developers/docs/topics/gateway-events#resumed + * @see {@link https://discord.com/developers/docs/topics/gateway-events#resumed} */ -export type GatewayResumedDispatch = DataPayload; +export type GatewayResumedDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete} */ -export type GatewayAutoModerationRuleModifyDispatch = DataPayload; +export type GatewayAutoModerationRuleModifyDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete} */ export type GatewayAutoModerationRuleModifyDispatchData = APIAutoModerationRule; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create} */ export type GatewayAutoModerationRuleCreateDispatch = GatewayAutoModerationRuleModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create} */ export type GatewayAutoModerationRuleCreateDispatchData = GatewayAutoModerationRuleModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update} */ export type GatewayAutoModerationRuleUpdateDispatch = GatewayAutoModerationRuleModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update} */ export type GatewayAutoModerationRuleUpdateDispatchData = GatewayAutoModerationRuleModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete} */ export type GatewayAutoModerationRuleDeleteDispatch = GatewayAutoModerationRuleModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete} */ export type GatewayAutoModerationRuleDeleteDispatchData = GatewayAutoModerationRuleModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-action-execution + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-action-execution} */ -export type GatewayAutoModerationActionExecutionDispatch = DataPayload; +export type GatewayAutoModerationActionExecutionDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#auto-moderation-action-execution + * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-action-execution} */ export interface GatewayAutoModerationActionExecutionDispatchData { /** @@ -440,11 +455,11 @@ export interface GatewayAutoModerationActionExecutionDispatchData { matched_content: string | null; } /** - * https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update} */ -export type GatewayApplicationCommandPermissionsUpdateDispatch = DataPayload; +export type GatewayApplicationCommandPermissionsUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update} */ export interface GatewayApplicationCommandPermissionsUpdateDispatchData { /** @@ -465,47 +480,86 @@ export interface GatewayApplicationCommandPermissionsUpdateDispatchData { permissions: APIApplicationCommandPermission[]; } /** - * https://discord.com/developers/docs/topics/gateway-events#channel-create - * https://discord.com/developers/docs/topics/gateway-events#channel-update - * https://discord.com/developers/docs/topics/gateway-events#channel-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-delete} */ -export type GatewayChannelModifyDispatch = DataPayload; +export type GatewaySubscriptionModifyDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-create - * https://discord.com/developers/docs/topics/gateway-events#channel-update - * https://discord.com/developers/docs/topics/gateway-events#channel-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-delete} */ -export type GatewayChannelModifyDispatchData = APIChannel; +export type GatewaySubscriptionModifyDispatchData = APISubscription; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-create} + */ +export type GatewaySubscriptionCreateDispatch = GatewaySubscriptionModifyDispatch; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-create} + */ +export type GatewaySubscriptionCreateDispatchData = GatewaySubscriptionModifyDispatchData; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-update} + */ +export type GatewaySubscriptionUpdateDispatch = GatewaySubscriptionModifyDispatch; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-update} + */ +export type GatewaySubscriptionUpdateDispatchData = GatewaySubscriptionModifyDispatchData; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-delete} + */ +export type GatewaySubscriptionDeleteDispatch = GatewaySubscriptionModifyDispatch; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-delete} + */ +export type GatewaySubscriptionDeleteDispatchData = GatewaySubscriptionModifyDispatchData; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-delete} + */ +export type GatewayChannelModifyDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-delete} + */ +export type GatewayChannelModifyDispatchData = APIChannel & { + type: Exclude; + guild_id: Snowflake; +}; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-create} */ export type GatewayChannelCreateDispatch = GatewayChannelModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-create} */ export type GatewayChannelCreateDispatchData = GatewayChannelModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-update} */ export type GatewayChannelUpdateDispatch = GatewayChannelModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-update} */ export type GatewayChannelUpdateDispatchData = GatewayChannelModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-delete} */ export type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-delete} */ export type GatewayChannelDeleteDispatchData = GatewayChannelModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-pins-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-pins-update} */ -export type GatewayChannelPinsUpdateDispatch = DataPayload; +export type GatewayChannelPinsUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#channel-pins-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-pins-update} */ export interface GatewayChannelPinsUpdateDispatchData { /** @@ -522,68 +576,68 @@ export interface GatewayChannelPinsUpdateDispatchData { last_pin_timestamp?: string | null; } /** - * https://discord.com/developers/docs/topics/gateway-events#entitlement-create - * https://discord.com/developers/docs/topics/gateway-events#entitlement-update - * https://discord.com/developers/docs/topics/gateway-events#entitlement-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-delete} */ export type GatewayEntitlementModifyDispatchData = APIEntitlement; /** - * https://discord.com/developers/docs/topics/gateway-events#entitlement-create - * https://discord.com/developers/docs/topics/gateway-events#entitlement-update - * https://discord.com/developers/docs/topics/gateway-events#entitlement-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-delete} */ -export type GatewayEntitlementModifyDispatch = DataPayload; +export type GatewayEntitlementModifyDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#entitlement-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create} */ export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#entitlement-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create} */ export type GatewayEntitlementCreateDispatch = GatewayEntitlementModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#entitlement-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-update} */ export type GatewayEntitlementUpdateDispatchData = GatewayEntitlementModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#entitlement-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-update} */ export type GatewayEntitlementUpdateDispatch = GatewayEntitlementModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#entitlement-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-delete} */ export type GatewayEntitlementDeleteDispatchData = GatewayEntitlementModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#entitlement-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-delete} */ export type GatewayEntitlementDeleteDispatch = GatewayEntitlementModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-update} */ -export type GatewayGuildModifyDispatch = DataPayload; +export type GatewayGuildModifyDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-update} */ export type GatewayGuildModifyDispatchData = APIGuild; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-create} */ -export type GatewayGuildCreateDispatch = DataPayload; +export type GatewayGuildCreateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-create - * https://discord.com/developers/docs/topics/gateway-events#guild-create-guild-create-extra-fields + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-create-guild-create-extra-fields} */ export interface GatewayGuildCreateDispatchData extends APIGuild { /** * When this guild was joined at * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** */ joined_at: string; /** * `true` if this is considered a large guild * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** */ large: boolean; /** @@ -593,90 +647,109 @@ export interface GatewayGuildCreateDispatchData extends APIGuild { /** * Total number of members in this guild * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** */ member_count: number; /** * States of members currently in voice channels; lacks the `guild_id` key * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** * - * See https://discord.com/developers/docs/resources/voice#voice-state-object + * @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object} */ - voice_states: Omit[]; + voice_states: APIBaseVoiceState[]; /** * Users in the guild * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** * - * See https://discord.com/developers/docs/resources/guild#guild-member-object + * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object} */ members: APIGuildMember[]; /** * Channels in the guild * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** * - * See https://discord.com/developers/docs/resources/channel#channel-object + * @see {@link https://discord.com/developers/docs/resources/channel#channel-object} */ - channels: APIChannel[]; + channels: (APIChannel & { + type: Exclude; + })[]; /** * Threads in the guild * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** * - * See https://discord.com/developers/docs/resources/channel#channel-object + * @see {@link https://discord.com/developers/docs/resources/channel#channel-object} */ - threads: APIChannel[]; + threads: (APIChannel & { + type: ThreadChannelType; + })[]; /** * Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold` * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** * - * See https://discord.com/developers/docs/topics/gateway-events#presence-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update} */ presences: GatewayPresenceUpdate[]; /** * The stage instances in the guild * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** * - * See https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure + * @see {@link https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure} */ stage_instances: APIStageInstance[]; /** * The scheduled events in the guild * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event** + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** * - * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object + * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object} */ guild_scheduled_events: APIGuildScheduledEvent[]; + /** + * The soundboard sounds in the guild + * + * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event** + * + * @see {@link https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object} + */ + soundboard_sounds: APISoundboardSound[]; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-update} */ export type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-update} */ export type GatewayGuildUpdateDispatchData = GatewayGuildModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-delete} */ -export type GatewayGuildDeleteDispatch = DataPayload; +export type GatewayGuildDeleteDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-delete} */ -export type GatewayGuildDeleteDispatchData = APIUnavailableGuild; +export interface GatewayGuildDeleteDispatchData extends APIBaseGuild { + /** + * `true` if this guild is unavailable due to an outage + * + * If the field is not set, the user was removed from the guild. + */ + unavailable?: true; +} /** - * https://discord.com/developers/docs/topics/gateway-events#guild-ban-add - * https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-add} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove} */ -export type GatewayGuildBanModifyDispatch = DataPayload; +export type GatewayGuildBanModifyDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-ban-add - * https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-add} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove} */ export interface GatewayGuildBanModifyDispatchData { /** @@ -686,32 +759,32 @@ export interface GatewayGuildBanModifyDispatchData { /** * The banned user * - * See https://discord.com/developers/docs/resources/user#user-object + * @see {@link https://discord.com/developers/docs/resources/user#user-object} */ user: APIUser; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-ban-add + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-add} */ export type GatewayGuildBanAddDispatch = GatewayGuildBanModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-ban-add + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-add} */ export type GatewayGuildBanAddDispatchData = GatewayGuildBanModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove} */ export type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove} */ export type GatewayGuildBanRemoveDispatchData = GatewayGuildBanModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-emojis-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-emojis-update} */ -export type GatewayGuildEmojisUpdateDispatch = DataPayload; +export type GatewayGuildEmojisUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-emojis-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-emojis-update} */ export interface GatewayGuildEmojisUpdateDispatchData { /** @@ -721,16 +794,16 @@ export interface GatewayGuildEmojisUpdateDispatchData { /** * Array of emojis * - * See https://discord.com/developers/docs/resources/emoji#emoji-object + * @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object} */ emojis: APIEmoji[]; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-stickers-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-stickers-update} */ -export type GatewayGuildStickersUpdateDispatch = DataPayload; +export type GatewayGuildStickersUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-stickers-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-stickers-update} */ export interface GatewayGuildStickersUpdateDispatchData { /** @@ -740,16 +813,16 @@ export interface GatewayGuildStickersUpdateDispatchData { /** * Array of stickers * - * See https://discord.com/developers/docs/resources/sticker#sticker-object + * @see {@link https://discord.com/developers/docs/resources/sticker#sticker-object} */ stickers: APISticker[]; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-integrations-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-integrations-update} */ -export type GatewayGuildIntegrationsUpdateDispatch = DataPayload; +export type GatewayGuildIntegrationsUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-integrations-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-integrations-update} */ export interface GatewayGuildIntegrationsUpdateDispatchData { /** @@ -758,11 +831,11 @@ export interface GatewayGuildIntegrationsUpdateDispatchData { guild_id: Snowflake; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-member-add + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-add} */ -export type GatewayGuildMemberAddDispatch = DataPayload; +export type GatewayGuildMemberAddDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-member-add + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-add} */ export interface GatewayGuildMemberAddDispatchData extends APIGuildMember { /** @@ -771,11 +844,11 @@ export interface GatewayGuildMemberAddDispatchData extends APIGuildMember { guild_id: Snowflake; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-member-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-remove} */ -export type GatewayGuildMemberRemoveDispatch = DataPayload; +export type GatewayGuildMemberRemoveDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-member-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-remove} */ export interface GatewayGuildMemberRemoveDispatchData { /** @@ -785,33 +858,29 @@ export interface GatewayGuildMemberRemoveDispatchData { /** * The user who was removed * - * See https://discord.com/developers/docs/resources/user#user-object + * @see {@link https://discord.com/developers/docs/resources/user#user-object} */ user: APIUser; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-member-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-update} */ -export type GatewayGuildMemberUpdateDispatch = DataPayload; +export type GatewayGuildMemberUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-member-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-update} */ -export type GatewayGuildMemberUpdateDispatchData = Nullable> & Omit & Partial> & Required> & { +export interface GatewayGuildMemberUpdateDispatchData extends APIGuildMemberJoined, APIBaseGuildMember, Partial, Partial, Required, Required { /** * The id of the guild */ guild_id: Snowflake; -}; +} /** - * https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk} */ -export type GatewayGuildMembersChunkDispatch = DataPayload; +export type GatewayGuildMembersChunkDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#update-presence - */ -export type GatewayGuildMembersChunkPresence = Omit; -/** - * https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk} */ export interface GatewayGuildMembersChunkDispatchData { /** @@ -821,7 +890,7 @@ export interface GatewayGuildMembersChunkDispatchData { /** * Set of guild members * - * See https://discord.com/developers/docs/resources/guild#guild-member-object + * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object} */ members: APIGuildMember[]; /** @@ -839,24 +908,24 @@ export interface GatewayGuildMembersChunkDispatchData { /** * If passing true to `REQUEST_GUILD_MEMBERS`, presences of the returned members will be here * - * See https://discord.com/developers/docs/topics/gateway-events#update-presence + * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence} */ presences?: GatewayGuildMembersChunkPresence[]; /** * The nonce used in the Guild Members Request * - * See https://discord.com/developers/docs/topics/gateway-events#request-guild-members + * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members} */ nonce?: string; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-role-create - * https://discord.com/developers/docs/topics/gateway-events#guild-role-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-update} */ -export type GatewayGuildRoleModifyDispatch = DataPayload; +export type GatewayGuildRoleModifyDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-role-create - * https://discord.com/developers/docs/topics/gateway-events#guild-role-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-update} */ export interface GatewayGuildRoleModifyDispatchData { /** @@ -866,32 +935,32 @@ export interface GatewayGuildRoleModifyDispatchData { /** * The role created or updated * - * See https://discord.com/developers/docs/topics/permissions#role-object + * @see {@link https://discord.com/developers/docs/topics/permissions#role-object} */ role: APIRole; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-role-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-create} */ export type GatewayGuildRoleCreateDispatch = GatewayGuildRoleModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-role-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-create} */ export type GatewayGuildRoleCreateDispatchData = GatewayGuildRoleModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-role-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-update} */ export type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-role-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-update} */ export type GatewayGuildRoleUpdateDispatchData = GatewayGuildRoleModifyDispatchData; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-role-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-delete} */ -export type GatewayGuildRoleDeleteDispatch = DataPayload; +export type GatewayGuildRoleDeleteDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-role-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-delete} */ export interface GatewayGuildRoleDeleteDispatchData { /** @@ -903,50 +972,147 @@ export interface GatewayGuildRoleDeleteDispatchData { */ role_id: Snowflake; } -export type GatewayGuildScheduledEventCreateDispatch = DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-create} + */ +export type GatewayGuildScheduledEventCreateDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-create} + */ export type GatewayGuildScheduledEventCreateDispatchData = APIGuildScheduledEvent; -export type GatewayGuildScheduledEventUpdateDispatch = DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-update} + */ +export type GatewayGuildScheduledEventUpdateDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-update} + */ export type GatewayGuildScheduledEventUpdateDispatchData = APIGuildScheduledEvent; -export type GatewayGuildScheduledEventDeleteDispatch = DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-delete} + */ +export type GatewayGuildScheduledEventDeleteDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-delete} + */ export type GatewayGuildScheduledEventDeleteDispatchData = APIGuildScheduledEvent; -export type GatewayGuildScheduledEventUserAddDispatch = DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-add} + */ +export type GatewayGuildScheduledEventUserAddDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-add} + */ export interface GatewayGuildScheduledEventUserAddDispatchData { guild_scheduled_event_id: Snowflake; user_id: Snowflake; guild_id: Snowflake; } -export type GatewayGuildScheduledEventUserRemoveDispatch = DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-remove} + */ +export type GatewayGuildScheduledEventUserRemoveDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-remove} + */ export interface GatewayGuildScheduledEventUserRemoveDispatchData { guild_scheduled_event_id: Snowflake; user_id: Snowflake; guild_id: Snowflake; } /** - * https://discord.com/developers/docs/topics/gateway-events#integration-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create} */ -export type GatewayIntegrationCreateDispatch = DataPayload; +export type GatewayGuildSoundboardSoundCreateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#integration-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create} + */ +export type GatewayGuildSoundboardSoundCreateDispatchData = APISoundboardSound; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update} + */ +export type GatewayGuildSoundboardSoundUpdateDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update} + */ +export type GatewayGuildSoundboardSoundUpdateDispatchData = APISoundboardSound; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete} + */ +export type GatewayGuildSoundboardSoundDeleteDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete} + */ +export interface GatewayGuildSoundboardSoundDeleteDispatchData { + /** + * The id of the sound that was deleted + */ + sound_id: Snowflake; + /** + * The id of the guild the sound was in + */ + guild_id: Snowflake; +} +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update} + */ +export type GatewayGuildSoundboardSoundsUpdateDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update} + */ +export interface GatewayGuildSoundboardSoundsUpdateDispatchData { + /** + * The guild's soundboard sounds + */ + soundboard_sounds: APISoundboardSound[]; + /** + * The id of the guild + */ + guild_id: Snowflake; +} +/** + * @see {@link https://discord.com/developers/docs/events/gateway-events#soundboard-sounds} + */ +export type GatewaySoundboardSoundsDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/events/gateway-events#soundboard-sounds} + */ +export interface GatewaySoundboardSoundsDispatchData { + /** + * The guild's soundboard sounds + */ + soundboard_sounds: APISoundboardSound[]; + /** + * The id of the guild + */ + guild_id: Snowflake; +} +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-create} + */ +export type GatewayIntegrationCreateDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-create} */ export type GatewayIntegrationCreateDispatchData = APIGuildIntegration & { guild_id: Snowflake; }; /** - * https://discord.com/developers/docs/topics/gateway-events#integration-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-update} */ -export type GatewayIntegrationUpdateDispatch = DataPayload; +export type GatewayIntegrationUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#integration-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-update} */ export type GatewayIntegrationUpdateDispatchData = APIGuildIntegration & { guild_id: Snowflake; }; /** - * https://discord.com/developers/docs/topics/gateway-events#integration-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-update} */ -export type GatewayIntegrationDeleteDispatch = DataPayload; +export type GatewayIntegrationDeleteDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#integration-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-delete} */ export interface GatewayIntegrationDeleteDispatchData { /** @@ -963,19 +1129,19 @@ export interface GatewayIntegrationDeleteDispatchData { application_id?: Snowflake; } /** - * https://discord.com/developers/docs/topics/gateway-events#interaction-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#interaction-create} */ -export type GatewayInteractionCreateDispatch = DataPayload; +export type GatewayInteractionCreateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#interaction-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#interaction-create} */ export type GatewayInteractionCreateDispatchData = APIInteraction; /** - * https://discord.com/developers/docs/topics/gateway-events#invite-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#invite-create} */ -export type GatewayInviteCreateDispatch = DataPayload; +export type GatewayInviteCreateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#invite-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#invite-create} */ export interface GatewayInviteCreateDispatchData { /** @@ -985,7 +1151,7 @@ export interface GatewayInviteCreateDispatchData { /** * The unique invite code * - * See https://discord.com/developers/docs/resources/invite#invite-object + * @see {@link https://discord.com/developers/docs/resources/invite#invite-object} */ code: string; /** @@ -999,7 +1165,7 @@ export interface GatewayInviteCreateDispatchData { /** * The user that created the invite * - * See https://discord.com/developers/docs/resources/user#user-object + * @see {@link https://discord.com/developers/docs/resources/user#user-object} */ inviter?: APIUser; /** @@ -1013,13 +1179,13 @@ export interface GatewayInviteCreateDispatchData { /** * The type of target for this voice channel invite * - * See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types + * @see {@link https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types} */ target_type?: InviteTargetType; /** * The user whose stream to display for this voice channel stream invite * - * See https://discord.com/developers/docs/resources/user#user-object + * @see {@link https://discord.com/developers/docs/resources/user#user-object} */ target_user?: APIUser; /** @@ -1034,13 +1200,17 @@ export interface GatewayInviteCreateDispatchData { * How many times the invite has been used (always will be `0`) */ uses: 0; + /** + * The expiration date of this invite. + */ + expires_at: string | null; } /** - * https://discord.com/developers/docs/topics/gateway-events#invite-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#invite-delete} */ -export type GatewayInviteDeleteDispatch = DataPayload; +export type GatewayInviteDeleteDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#invite-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#invite-delete} */ export interface GatewayInviteDeleteDispatchData { /** @@ -1054,35 +1224,42 @@ export interface GatewayInviteDeleteDispatchData { /** * The unique invite code * - * See https://discord.com/developers/docs/resources/invite#invite-object + * @see {@link https://discord.com/developers/docs/resources/invite#invite-object} */ code: string; } /** - * https://discord.com/developers/docs/topics/gateway-events#message-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create} */ -export type GatewayMessageCreateDispatch = DataPayload; +export type GatewayMessageCreateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create} */ -export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit; +export interface GatewayMessageCreateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage { +} /** - * https://discord.com/developers/docs/topics/gateway-events#message-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update} */ -export type GatewayMessageUpdateDispatch = DataPayload; +export type GatewayMessageUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update} */ -export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & Omit, 'mentions'> & { +export interface GatewayMessageUpdateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage { +} +export interface APIGuildMemberNoUser extends APIBaseGuildMember, APIFlaggedGuildMember, APIGuildMemberAvatar, NonNullable, APIBaseVoiceGuildMember { +} +export interface APIUserWithMember extends APIUser { /** - * ID of the message + * The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events + * from text-based guild channels + * + * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object} */ - id: Snowflake; - /** - * ID of the channel the message was sent in - */ - channel_id: Snowflake; -}; + member?: APIGuildMemberNoUser; +} +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create-message-create-extra-fields} + */ export interface GatewayMessageEventExtraFields { /** * ID of the guild the message was sent in @@ -1094,28 +1271,22 @@ export interface GatewayMessageEventExtraFields { * The member object exists in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events * from text-based guild channels * - * See https://discord.com/developers/docs/resources/guild#guild-member-object + * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object} */ - member?: APIGuildMember; + member?: APIGuildMemberNoUser; /** * Users specifically mentioned in the message * - * The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events - * from text-based guild channels - * - * See https://discord.com/developers/docs/resources/user#user-object - * See https://discord.com/developers/docs/resources/guild#guild-member-object + * @see {@link https://discord.com/developers/docs/resources/user#user-object} */ - mentions: (APIUser & { - member?: Omit; - })[]; + mentions: APIUserWithMember[]; } /** - * https://discord.com/developers/docs/topics/gateway-events#message-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-delete} */ -export type GatewayMessageDeleteDispatch = DataPayload; +export type GatewayMessageDeleteDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-delete} */ export interface GatewayMessageDeleteDispatchData { /** @@ -1132,11 +1303,11 @@ export interface GatewayMessageDeleteDispatchData { guild_id?: Snowflake; } /** - * https://discord.com/developers/docs/topics/gateway-events#message-delete-bulk + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-delete-bulk} */ -export type GatewayMessageDeleteBulkDispatch = DataPayload; +export type GatewayMessageDeleteBulkDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-delete-bulk + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-delete-bulk} */ export interface GatewayMessageDeleteBulkDispatchData { /** @@ -1153,116 +1324,162 @@ export interface GatewayMessageDeleteBulkDispatchData { guild_id?: Snowflake; } /** - * https://discord.com/developers/docs/topics/gateway-events#message-reaction-add + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add} */ -export type GatewayMessageReactionAddDispatch = ReactionData; +export interface GatewayMessageReactionAddDispatchData extends GatewayMessageReactionRemoveDispatchData { + /** + * The member who reacted if this happened in a guild + * + * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object} + */ + member?: APIGuildMember; + /** + * The id of the user that posted the message that was reacted to + */ + message_author_id?: Snowflake; + /** + * Colors used for super-reaction animation in "#rrggbb" format + */ + burst_colors?: string[]; +} /** - * https://discord.com/developers/docs/topics/gateway-events#message-reaction-add + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add} */ -export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDispatch['d']; +export type GatewayMessageReactionAddDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove} */ -export type GatewayMessageReactionRemoveDispatch = ReactionData; +export interface GatewayMessageReactionRemoveDispatchData { + /** + * The id of the user + */ + user_id: Snowflake; + /** + * The id of the channel + */ + channel_id: Snowflake; + /** + * The id of the message + */ + message_id: Snowflake; + /** + * The id of the guild + */ + guild_id?: Snowflake; + /** + * The emoji used to react + * + * @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object} + */ + emoji: APIEmoji; + /** + * True if this is a super-reaction + */ + burst: boolean; + /** + * The type of reaction + */ + type: ReactionType; +} /** - * https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove} */ -export type GatewayMessageReactionRemoveDispatchData = GatewayMessageReactionRemoveDispatch['d']; +export type GatewayMessageReactionRemoveDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all} */ -export type GatewayMessageReactionRemoveAllDispatch = DataPayload; +export type GatewayMessageReactionRemoveAllDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all} */ -export type GatewayMessageReactionRemoveAllDispatchData = MessageReactionRemoveData; +export type GatewayMessageReactionRemoveAllDispatchData = GatewayMessageReactionRemoveData; /** - * https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-emoji + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-emoji} */ -export type GatewayMessageReactionRemoveEmojiDispatch = DataPayload; +export type GatewayMessageReactionRemoveEmojiDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-emoji + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-emoji} */ -export interface GatewayMessageReactionRemoveEmojiDispatchData extends MessageReactionRemoveData { +export interface GatewayMessageReactionRemoveEmojiDispatchData extends GatewayMessageReactionRemoveData { /** * The emoji that was removed */ emoji: APIEmoji; } /** - * https://discord.com/developers/docs/topics/gateway-events#presence-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update} */ -export type GatewayPresenceUpdateDispatch = DataPayload; +export type GatewayPresenceUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#presence-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update} */ -export type GatewayPresenceUpdateDispatchData = RawGatewayPresenceUpdate; +export type GatewayPresenceUpdateDispatchData = GatewayPresenceUpdate; /** - * https://discord.com/developers/docs/topics/gateway-events#stage-instance-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-create} */ -export type GatewayStageInstanceCreateDispatch = DataPayload; +export type GatewayStageInstanceCreateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#stage-instance-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-create} */ export type GatewayStageInstanceCreateDispatchData = APIStageInstance; /** - * https://discord.com/developers/docs/topics/gateway-events#stage-instance-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-delete} */ -export type GatewayStageInstanceDeleteDispatch = DataPayload; +export type GatewayStageInstanceDeleteDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#stage-instance-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-delete} */ export type GatewayStageInstanceDeleteDispatchData = APIStageInstance; /** - * https://discord.com/developers/docs/topics/gateway-events#stage-instance-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-update} */ -export type GatewayStageInstanceUpdateDispatch = DataPayload; +export type GatewayStageInstanceUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#stage-instance-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-update} */ export type GatewayStageInstanceUpdateDispatchData = APIStageInstance; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-list-sync + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-list-sync} */ -export type GatewayThreadListSyncDispatch = DataPayload; +export type GatewayThreadListSyncDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-list-sync + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-list-sync} */ -export type GatewayThreadListSyncDispatchData = RawGatewayThreadListSync; +export type GatewayThreadListSyncDispatchData = GatewayThreadListSync; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-members-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-members-update} */ -export type GatewayThreadMembersUpdateDispatch = DataPayload; +export type GatewayThreadMembersUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-members-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-members-update} */ export type GatewayThreadMembersUpdateDispatchData = RawGatewayThreadMembersUpdate; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-member-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-member-update} */ -export type GatewayThreadMemberUpdateDispatch = DataPayload; +export type GatewayThreadMemberUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-member-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-member-update} */ export type GatewayThreadMemberUpdateDispatchData = APIThreadMember & { guild_id: Snowflake; }; /** * @deprecated This type doesn't accurately reflect the Discord API. - * Use {@apilink GatewayThreadCreateDispatch}, - * {@apilink GatewayThreadUpdateDispatch}, or - * {@apilink GatewayThreadDeleteDispatch} instead. - * https://discord.com/developers/docs/topics/gateway-events#thread-create - * https://discord.com/developers/docs/topics/gateway-events#thread-update - * https://discord.com/developers/docs/topics/gateway-events#thread-delete + * Use {@link GatewayThreadCreateDispatch}, + * {@link GatewayThreadUpdateDispatch}, or + * {@link GatewayThreadDeleteDispatch} instead. + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-create} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-update} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-delete} */ -export type GatewayThreadModifyDispatch = DataPayload; +export type GatewayThreadModifyDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-create} */ -export type GatewayThreadCreateDispatch = DataPayload; +export type GatewayThreadCreateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-create} */ export interface GatewayThreadCreateDispatchData extends APIThreadChannel { /** @@ -1271,19 +1488,19 @@ export interface GatewayThreadCreateDispatchData extends APIThreadChannel { newly_created?: true; } /** - * https://discord.com/developers/docs/topics/gateway-events#thread-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-update} */ -export type GatewayThreadUpdateDispatch = DataPayload; +export type GatewayThreadUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-update} */ export type GatewayThreadUpdateDispatchData = APIThreadChannel; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-delete} */ -export type GatewayThreadDeleteDispatch = DataPayload; +export type GatewayThreadDeleteDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#thread-delete + * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-delete} */ export interface GatewayThreadDeleteDispatchData { /** @@ -1301,16 +1518,16 @@ export interface GatewayThreadDeleteDispatchData { /** * The type of the channel * - * See https://discord.com/developers/docs/resources/channel#channel-object-channel-types + * @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-types} */ type: ChannelType; } /** - * https://discord.com/developers/docs/topics/gateway-events#typing-start + * @see {@link https://discord.com/developers/docs/topics/gateway-events#typing-start} */ -export type GatewayTypingStartDispatch = DataPayload; +export type GatewayTypingStartDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#typing-start + * @see {@link https://discord.com/developers/docs/topics/gateway-events#typing-start} */ export interface GatewayTypingStartDispatchData { /** @@ -1332,32 +1549,86 @@ export interface GatewayTypingStartDispatchData { /** * The member who started typing if this happened in a guild * - * See https://discord.com/developers/docs/resources/guild#guild-member-object + * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object} */ member?: APIGuildMember; } /** - * https://discord.com/developers/docs/topics/gateway-events#user-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#user-update} */ -export type GatewayUserUpdateDispatch = DataPayload; +export type GatewayUserUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#user-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#user-update} */ export type GatewayUserUpdateDispatchData = APIUser; /** - * https://discord.com/developers/docs/topics/gateway-events#voice-state-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send} */ -export type GatewayVoiceStateUpdateDispatch = DataPayload; +export type GatewayVoiceChannelEffectSendDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#voice-state-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send} */ -export type GatewayVoiceStateUpdateDispatchData = GatewayVoiceState; +export interface GatewayVoiceChannelEffectSendDispatchData { + /** + * ID of the channel the effect was sent in + */ + channel_id: Snowflake; + /** + * ID of the guild the effect was sent in + */ + guild_id: Snowflake; + /** + * ID of the user who sent the effect + */ + user_id: Snowflake; + /** + * The emoji sent, for emoji reaction and soundboard effects + */ + emoji?: APIEmoji | null; + /** + * The type of emoji animation, for emoji reaction and soundboard effects + */ + animation_type?: VoiceChannelEffectSendAnimationType | null; + /** + * The ID of the emoji animation, for emoji reaction and soundboard effects + */ + animation_id?: number; + /** + * The ID of the soundboard sound, for soundboard effects + */ + sound_id?: Snowflake | number; + /** + * The volume of the soundboard sound, from 0 to 1, for soundboard effects + */ + sound_volume?: number; +} /** - * https://discord.com/developers/docs/topics/gateway-events#voice-server-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send-animation-types} */ -export type GatewayVoiceServerUpdateDispatch = DataPayload; +export declare enum VoiceChannelEffectSendAnimationType { + /** + * A fun animation, sent by a Nitro subscriber + */ + Premium = 0, + /** + * The standard animation + */ + Basic = 1 +} /** - * https://discord.com/developers/docs/topics/gateway-events#voice-server-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-state-update} + */ +export type GatewayVoiceStateUpdateDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-state-update} + */ +export type GatewayVoiceStateUpdateDispatchData = APIVoiceState; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-server-update} + */ +export type GatewayVoiceServerUpdateDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-server-update} */ export interface GatewayVoiceServerUpdateDispatchData { /** @@ -1378,11 +1649,11 @@ export interface GatewayVoiceServerUpdateDispatchData { endpoint: string | null; } /** - * https://discord.com/developers/docs/topics/gateway-events#webhooks-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#webhooks-update} */ -export type GatewayWebhooksUpdateDispatch = DataPayload; +export type GatewayWebhooksUpdateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#webhooks-update + * @see {@link https://discord.com/developers/docs/topics/gateway-events#webhooks-update} */ export interface GatewayWebhooksUpdateDispatchData { /** @@ -1395,11 +1666,11 @@ export interface GatewayWebhooksUpdateDispatchData { channel_id: Snowflake; } /** - * https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create} */ -export type GatewayGuildAuditLogEntryCreateDispatch = DataPayload; +export type GatewayGuildAuditLogEntryCreateDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create} */ export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLogEntry { /** @@ -1408,13 +1679,17 @@ export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLog guild_id: Snowflake; } /** - * https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add} */ -export type GatewayMessagePollVoteAddDispatch = DataPayload; +export type GatewayMessagePollVoteAddDispatch = _DataPayload; /** - * https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove} + */ +export type GatewayMessagePollVoteRemoveDispatch = _DataPayload; +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add} + * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove} */ -export type GatewayMessagePollVoteRemoveDispatch = DataPayload; export interface GatewayMessagePollVoteDispatchData { /** * ID of the user @@ -1438,25 +1713,79 @@ export interface GatewayMessagePollVoteDispatchData { answer_id: number; } /** - * https://discord.com/developers/docs/topics/gateway#sending-heartbeats + * @see {@link https://discord.com/developers/docs/events/gateway-events#rate-limited} + */ +export type GatewayRateLimitedDispatch = _DataPayload>; +/** + * @see {@link https://discord.com/developers/docs/events/gateway-events#rate-limited} + */ +export type GatewayRateLimitedRequestGuildMembersDispatch = GatewayRateLimitedDispatch; +/** + * @see {@link https://discord.com/developers/docs/events/gateway-events#rate-limited} + */ +export interface GatewayRateLimitedDispatchData { + /** + * {@link GatewayOpcodes | Gateway opcode} of the event that was rate limited + */ + opcode: Opcode; + /** + * The number of seconds to wait before submitting another request + */ + retry_after: number; + /** + * Metadata for the event that was rate limited + */ + meta: GatewayOpcodeRateLimitMetadataMap[Opcode]; +} +/** + * @see {@link https://discord.com/developers/docs/events/gateway-events#rate-limited} + */ +export type GatewayRateLimitedRequestGuildMembersDispatchData = GatewayRateLimitedDispatchData; +/** + * Map of gateway opcodes to their rate limit metadata types + * + * @see {@link https://discord.com/developers/docs/events/gateway-events#rate-limited-rate-limit-metadata-for-opcode-structure} + */ +export interface GatewayOpcodeRateLimitMetadataMap { + [GatewayOpcodes.RequestGuildMembers]: GatewayRequestGuildMemberRateLimitMetadata; +} +/** + * Types of metadata that can be received in a {@link GatewayRateLimitedDispatchData.meta} field + */ +export type GatewayRateLimitedMetadata = GatewayOpcodeRateLimitMetadataMap[keyof GatewayOpcodeRateLimitMetadataMap]; +/** + * Rate limit metadata for the {@link GatewayOpcodes.RequestGuildMembers} opcode + */ +export interface GatewayRequestGuildMemberRateLimitMetadata { + /** + * Id of the guild members were requested for + */ + guild_id: Snowflake; + /** + * Nonce used to identify the {@link GatewayGuildMembersChunkDispatch} response + */ + nonce?: string; +} +/** + * @see {@link https://discord.com/developers/docs/topics/gateway#sending-heartbeats} */ export interface GatewayHeartbeat { op: GatewayOpcodes.Heartbeat; d: GatewayHeartbeatData; } /** - * https://discord.com/developers/docs/topics/gateway#sending-heartbeats + * @see {@link https://discord.com/developers/docs/topics/gateway#sending-heartbeats} */ export type GatewayHeartbeatData = number | null; /** - * https://discord.com/developers/docs/topics/gateway-events#identify + * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify} */ export interface GatewayIdentify { op: GatewayOpcodes.Identify; d: GatewayIdentifyData; } /** - * https://discord.com/developers/docs/topics/gateway-events#identify + * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify} */ export interface GatewayIdentifyData { /** @@ -1466,43 +1795,43 @@ export interface GatewayIdentifyData { /** * Connection properties * - * See https://discord.com/developers/docs/topics/gateway-events#identify-identify-connection-properties + * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify-identify-connection-properties} */ properties: GatewayIdentifyProperties; /** * Whether this connection supports compression of packets * - * @default false + * @defaultValue `false` */ compress?: boolean; /** * Value between 50 and 250, total number of members where the gateway will stop sending * offline members in the guild member list * - * @default 50 + * @defaultValue `50` */ large_threshold?: number; /** * Used for Guild Sharding * - * See https://discord.com/developers/docs/topics/gateway#sharding + * @see {@link https://discord.com/developers/docs/topics/gateway#sharding} */ shard?: [shard_id: number, shard_count: number]; /** * Presence structure for initial presence information * - * See https://discord.com/developers/docs/topics/gateway-events#update-presence + * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence} */ presence?: GatewayPresenceUpdateData; /** * The Gateway Intents you wish to receive * - * See https://discord.com/developers/docs/topics/gateway#gateway-intents + * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents} */ intents: number; } /** - * https://discord.com/developers/docs/topics/gateway-events#identify-identify-connection-properties + * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify-identify-connection-properties} */ export interface GatewayIdentifyProperties { /** @@ -1519,14 +1848,14 @@ export interface GatewayIdentifyProperties { device: string; } /** - * https://discord.com/developers/docs/topics/gateway-events#resume + * @see {@link https://discord.com/developers/docs/topics/gateway-events#resume} */ export interface GatewayResume { op: GatewayOpcodes.Resume; d: GatewayResumeData; } /** - * https://discord.com/developers/docs/topics/gateway-events#resume + * @see {@link https://discord.com/developers/docs/topics/gateway-events#resume} */ export interface GatewayResumeData { /** @@ -1543,12 +1872,15 @@ export interface GatewayResumeData { seq: number; } /** - * https://discord.com/developers/docs/topics/gateway-events#request-guild-members + * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members} */ export interface GatewayRequestGuildMembers { op: GatewayOpcodes.RequestGuildMembers; d: GatewayRequestGuildMembersData; } +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members} + */ export interface GatewayRequestGuildMembersDataBase { /** * ID of the guild to get members for @@ -1563,16 +1895,22 @@ export interface GatewayRequestGuildMembersDataBase { * * Nonce can only be up to 32 bytes. If you send an invalid nonce it will be ignored and the reply member_chunk(s) will not have a `nonce` set. * - * See https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk + * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk} */ nonce?: string; } +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members} + */ export interface GatewayRequestGuildMembersDataWithUserIds extends GatewayRequestGuildMembersDataBase { /** * Used to specify which users you wish to fetch */ user_ids: Snowflake | Snowflake[]; } +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members} + */ export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestGuildMembersDataBase { /** * String that username starts with, or an empty string to return all members @@ -1585,18 +1923,34 @@ export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestG limit: number; } /** - * https://discord.com/developers/docs/topics/gateway-events#request-guild-members + * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members} */ export type GatewayRequestGuildMembersData = GatewayRequestGuildMembersDataWithQuery | GatewayRequestGuildMembersDataWithUserIds; /** - * https://discord.com/developers/docs/topics/gateway-events#update-voice-state + * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds} + */ +export interface GatewayRequestSoundboardSounds { + op: GatewayOpcodes.RequestSoundboardSounds; + d: GatewayRequestSoundboardSoundsData; +} +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds} + */ +export interface GatewayRequestSoundboardSoundsData { + /** + * The ids of the guilds to get soundboard sounds for + */ + guild_ids: Snowflake[]; +} +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-voice-state} */ export interface GatewayVoiceStateUpdate { op: GatewayOpcodes.VoiceStateUpdate; d: GatewayVoiceStateUpdateData; } /** - * https://discord.com/developers/docs/topics/gateway-events#update-voice-state + * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-voice-state} */ export interface GatewayVoiceStateUpdateData { /** @@ -1617,14 +1971,14 @@ export interface GatewayVoiceStateUpdateData { self_deaf: boolean; } /** - * https://discord.com/developers/docs/topics/gateway-events#update-presence + * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence} */ export interface GatewayUpdatePresence { op: GatewayOpcodes.PresenceUpdate; d: GatewayPresenceUpdateData; } /** - * https://discord.com/developers/docs/topics/gateway-events#update-presence-gateway-presence-update-structure + * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence-gateway-presence-update-structure} */ export interface GatewayPresenceUpdateData { /** @@ -1634,13 +1988,13 @@ export interface GatewayPresenceUpdateData { /** * The user's activities * - * See https://discord.com/developers/docs/topics/gateway-events#activity-object + * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object} */ activities: GatewayActivityUpdateData[]; /** * The user's new status * - * See https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types + * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types} */ status: PresenceUpdateStatus; /** @@ -1649,10 +2003,10 @@ export interface GatewayPresenceUpdateData { afk: boolean; } /** - * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure + * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure} */ export type GatewayActivityUpdateData = Pick; -interface BasePayload { +export interface _BaseBasePayload { /** * Opcode for the payload */ @@ -1661,6 +2015,8 @@ interface BasePayload { * Event data */ d?: unknown; +} +export interface _BasePayload extends _BaseBasePayload { /** * Sequence number, used for resuming sessions and heartbeats */ @@ -1670,50 +2026,17 @@ interface BasePayload { */ t?: string; } -type NonDispatchPayload = Omit & { +export interface _NonDispatchPayload extends _BaseBasePayload { t: null; s: null; -}; -interface DataPayload extends BasePayload { +} +export interface _DataPayload extends _BasePayload { op: GatewayOpcodes.Dispatch; t: Event; d: D; } -type ReactionData = DataPayload>; -interface MessageReactionRemoveData { +export type GatewayMessageReactionData = _DataPayload>; +export interface GatewayMessageReactionRemoveData { /** * The id of the channel */ diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.d.ts.map b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.d.ts.map index 02698e4..babc45d 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.d.ts.map +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"v9.d.ts","sourceRoot":"","sources":["v9.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EACX,cAAc,EACd,+BAA+B,EAC/B,qBAAqB,EACrB,uBAAuB,EACvB,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,cAAc,EACd,UAAU,EACV,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,qBAAqB,IAAI,wBAAwB,EACjD,qBAAqB,IAAI,wBAAwB,EACjD,0BAA0B,IAAI,6BAA6B,EAC3D,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,6BAA6B,EAC7B,gBAAgB,EAChB,WAAW,EACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,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CAAC;IACtB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB"} \ No newline at end of file +{"version":3,"file":"v9.d.ts","sourceRoot":"","sources":["v9.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EACX,cAAc,EACd,+BAA+B,EAC/B,qBAAqB,EACrB,uBAAuB,EACvB,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,IAAI,6BAA6B,EAC3D,gBAAgB,EAChB,oBAAoB,EACpB,6BAA6B,EAC7B,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,gCAAgC,EAChC,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,mBAAmB,UAAU,CAAC;AAE9B,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;GAEG;AACH,oBAAY,cAAc;IACzB;;OAEG;IACH,QAAQ,IAAA;IACR;;;OAGG;IACH,SAAS,IAAA;IACT;;OAEG;IACH,QAAQ,IAAA;IACR;;OAEG;IACH,cAAc,IAAA;IACd;;OAEG;IACH,gBAAgB,IAAA;IAChB;;OAEG;IACH,MAAM,IAAI;IACV;;OAEG;IACH,SAAS,IAAA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C,EAAE,CAAC,CAAC;CACL;AAGD,MAAM,MAAM,0BAA0B,CAAC,CAAC,SAAS,qBAAqB,EAAE,CAAC,SAAS,MAAM,GAAG,KAAK,IAAI,YAAY,CAC/G,CAAC,EACD,IAAI,CAAC,qCAAqC,EAAE,CAAC,CAAC,CAC9C,CAAC;AAEF,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB"} \ No newline at end of file diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.js b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.js index 9bcc597..0fd94a6 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.js +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.js @@ -2,26 +2,11 @@ /** * Types extracted from https://discord.com/developers/docs/topics/gateway */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; Object.defineProperty(exports, "__esModule", { value: true }); -exports.GatewayDispatchEvents = exports.GatewayIntentBits = exports.GatewayCloseCodes = exports.GatewayOpcodes = exports.GatewayVersion = void 0; -__exportStar(require("./common"), exports); +exports.VoiceChannelEffectSendAnimationType = exports.GatewayDispatchEvents = exports.GatewayIntentBits = exports.GatewayCloseCodes = exports.GatewayOpcodes = exports.GatewayVersion = void 0; exports.GatewayVersion = '9'; /** - * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes + * @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes} */ var GatewayOpcodes; (function (GatewayOpcodes) { @@ -70,9 +55,13 @@ var GatewayOpcodes; * Sent in response to receiving a heartbeat to acknowledge that it has been received */ GatewayOpcodes[GatewayOpcodes["HeartbeatAck"] = 11] = "HeartbeatAck"; + /** + * Request information about soundboard sounds in a set of guilds + */ + GatewayOpcodes[GatewayOpcodes["RequestSoundboardSounds"] = 31] = "RequestSoundboardSounds"; })(GatewayOpcodes || (exports.GatewayOpcodes = GatewayOpcodes = {})); /** - * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes + * @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes} */ var GatewayCloseCodes; (function (GatewayCloseCodes) { @@ -83,25 +72,25 @@ var GatewayCloseCodes; /** * You sent an invalid Gateway opcode or an invalid payload for an opcode. Don't do that! * - * See https://discord.com/developers/docs/topics/gateway-events#payload-structure + * @see {@link https://discord.com/developers/docs/topics/gateway-events#payload-structure} */ GatewayCloseCodes[GatewayCloseCodes["UnknownOpcode"] = 4001] = "UnknownOpcode"; /** * You sent an invalid payload to us. Don't do that! * - * See https://discord.com/developers/docs/topics/gateway#sending-events + * @see {@link https://discord.com/developers/docs/topics/gateway#sending-events} */ GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError"; /** * You sent us a payload prior to identifying * - * See https://discord.com/developers/docs/topics/gateway-events#identify + * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify} */ GatewayCloseCodes[GatewayCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated"; /** * The account token sent with your identify payload is incorrect * - * See https://discord.com/developers/docs/topics/gateway-events#identify + * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify} */ GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed"; /** @@ -111,7 +100,7 @@ var GatewayCloseCodes; /** * The sequence sent when resuming the session was invalid. Reconnect and start a new session * - * See https://discord.com/developers/docs/topics/gateway-events#resume + * @see {@link https://discord.com/developers/docs/topics/gateway-events#resume} */ GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq"; /** @@ -125,13 +114,13 @@ var GatewayCloseCodes; /** * You sent us an invalid shard when identifying * - * See https://discord.com/developers/docs/topics/gateway#sharding + * @see {@link https://discord.com/developers/docs/topics/gateway#sharding} */ GatewayCloseCodes[GatewayCloseCodes["InvalidShard"] = 4010] = "InvalidShard"; /** * The session would have handled too many guilds - you are required to shard your connection in order to connect * - * See https://discord.com/developers/docs/topics/gateway#sharding + * @see {@link https://discord.com/developers/docs/topics/gateway#sharding} */ GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired"; /** @@ -141,21 +130,20 @@ var GatewayCloseCodes; /** * You sent an invalid intent for a Gateway Intent. You may have incorrectly calculated the bitwise value * - * See https://discord.com/developers/docs/topics/gateway#gateway-intents + * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents} */ GatewayCloseCodes[GatewayCloseCodes["InvalidIntents"] = 4013] = "InvalidIntents"; /** * You sent a disallowed intent for a Gateway Intent. You may have tried to specify an intent that you have not * enabled or are not whitelisted for * - * See https://discord.com/developers/docs/topics/gateway#gateway-intents - * - * See https://discord.com/developers/docs/topics/gateway#privileged-intents + * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents} + * @see {@link https://discord.com/developers/docs/topics/gateway#privileged-intents} */ GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents"; })(GatewayCloseCodes || (exports.GatewayCloseCodes = GatewayCloseCodes = {})); /** - * https://discord.com/developers/docs/topics/gateway#list-of-intents + * @see {@link https://discord.com/developers/docs/topics/gateway#list-of-intents} */ var GatewayIntentBits; (function (GatewayIntentBits) { @@ -163,9 +151,13 @@ var GatewayIntentBits; GatewayIntentBits[GatewayIntentBits["GuildMembers"] = 2] = "GuildMembers"; GatewayIntentBits[GatewayIntentBits["GuildModeration"] = 4] = "GuildModeration"; /** - * @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration} + * @deprecated This is the old name for {@link GatewayIntentBits.GuildModeration} */ GatewayIntentBits[GatewayIntentBits["GuildBans"] = 4] = "GuildBans"; + GatewayIntentBits[GatewayIntentBits["GuildExpressions"] = 8] = "GuildExpressions"; + /** + * @deprecated This is the old name for {@link GatewayIntentBits.GuildExpressions} + */ GatewayIntentBits[GatewayIntentBits["GuildEmojisAndStickers"] = 8] = "GuildEmojisAndStickers"; GatewayIntentBits[GatewayIntentBits["GuildIntegrations"] = 16] = "GuildIntegrations"; GatewayIntentBits[GatewayIntentBits["GuildWebhooks"] = 32] = "GuildWebhooks"; @@ -185,15 +177,23 @@ var GatewayIntentBits; GatewayIntentBits[GatewayIntentBits["DirectMessagePolls"] = 33554432] = "DirectMessagePolls"; })(GatewayIntentBits || (exports.GatewayIntentBits = GatewayIntentBits = {})); /** - * https://discord.com/developers/docs/topics/gateway-events#receive-events + * @see {@link https://discord.com/developers/docs/topics/gateway-events#receive-events} */ var GatewayDispatchEvents; (function (GatewayDispatchEvents) { GatewayDispatchEvents["ApplicationCommandPermissionsUpdate"] = "APPLICATION_COMMAND_PERMISSIONS_UPDATE"; + GatewayDispatchEvents["AutoModerationActionExecution"] = "AUTO_MODERATION_ACTION_EXECUTION"; + GatewayDispatchEvents["AutoModerationRuleCreate"] = "AUTO_MODERATION_RULE_CREATE"; + GatewayDispatchEvents["AutoModerationRuleDelete"] = "AUTO_MODERATION_RULE_DELETE"; + GatewayDispatchEvents["AutoModerationRuleUpdate"] = "AUTO_MODERATION_RULE_UPDATE"; GatewayDispatchEvents["ChannelCreate"] = "CHANNEL_CREATE"; GatewayDispatchEvents["ChannelDelete"] = "CHANNEL_DELETE"; GatewayDispatchEvents["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE"; GatewayDispatchEvents["ChannelUpdate"] = "CHANNEL_UPDATE"; + GatewayDispatchEvents["EntitlementCreate"] = "ENTITLEMENT_CREATE"; + GatewayDispatchEvents["EntitlementDelete"] = "ENTITLEMENT_DELETE"; + GatewayDispatchEvents["EntitlementUpdate"] = "ENTITLEMENT_UPDATE"; + GatewayDispatchEvents["GuildAuditLogEntryCreate"] = "GUILD_AUDIT_LOG_ENTRY_CREATE"; GatewayDispatchEvents["GuildBanAdd"] = "GUILD_BAN_ADD"; GatewayDispatchEvents["GuildBanRemove"] = "GUILD_BAN_REMOVE"; GatewayDispatchEvents["GuildCreate"] = "GUILD_CREATE"; @@ -207,6 +207,16 @@ var GatewayDispatchEvents; GatewayDispatchEvents["GuildRoleCreate"] = "GUILD_ROLE_CREATE"; GatewayDispatchEvents["GuildRoleDelete"] = "GUILD_ROLE_DELETE"; GatewayDispatchEvents["GuildRoleUpdate"] = "GUILD_ROLE_UPDATE"; + GatewayDispatchEvents["GuildScheduledEventCreate"] = "GUILD_SCHEDULED_EVENT_CREATE"; + GatewayDispatchEvents["GuildScheduledEventDelete"] = "GUILD_SCHEDULED_EVENT_DELETE"; + GatewayDispatchEvents["GuildScheduledEventUpdate"] = "GUILD_SCHEDULED_EVENT_UPDATE"; + GatewayDispatchEvents["GuildScheduledEventUserAdd"] = "GUILD_SCHEDULED_EVENT_USER_ADD"; + GatewayDispatchEvents["GuildScheduledEventUserRemove"] = "GUILD_SCHEDULED_EVENT_USER_REMOVE"; + GatewayDispatchEvents["GuildSoundboardSoundCreate"] = "GUILD_SOUNDBOARD_SOUND_CREATE"; + GatewayDispatchEvents["GuildSoundboardSoundDelete"] = "GUILD_SOUNDBOARD_SOUND_DELETE"; + GatewayDispatchEvents["GuildSoundboardSoundsUpdate"] = "GUILD_SOUNDBOARD_SOUNDS_UPDATE"; + GatewayDispatchEvents["GuildSoundboardSoundUpdate"] = "GUILD_SOUNDBOARD_SOUND_UPDATE"; + GatewayDispatchEvents["SoundboardSounds"] = "SOUNDBOARD_SOUNDS"; GatewayDispatchEvents["GuildStickersUpdate"] = "GUILD_STICKERS_UPDATE"; GatewayDispatchEvents["GuildUpdate"] = "GUILD_UPDATE"; GatewayDispatchEvents["IntegrationCreate"] = "INTEGRATION_CREATE"; @@ -218,17 +228,23 @@ var GatewayDispatchEvents; GatewayDispatchEvents["MessageCreate"] = "MESSAGE_CREATE"; GatewayDispatchEvents["MessageDelete"] = "MESSAGE_DELETE"; GatewayDispatchEvents["MessageDeleteBulk"] = "MESSAGE_DELETE_BULK"; + GatewayDispatchEvents["MessagePollVoteAdd"] = "MESSAGE_POLL_VOTE_ADD"; + GatewayDispatchEvents["MessagePollVoteRemove"] = "MESSAGE_POLL_VOTE_REMOVE"; GatewayDispatchEvents["MessageReactionAdd"] = "MESSAGE_REACTION_ADD"; GatewayDispatchEvents["MessageReactionRemove"] = "MESSAGE_REACTION_REMOVE"; GatewayDispatchEvents["MessageReactionRemoveAll"] = "MESSAGE_REACTION_REMOVE_ALL"; GatewayDispatchEvents["MessageReactionRemoveEmoji"] = "MESSAGE_REACTION_REMOVE_EMOJI"; GatewayDispatchEvents["MessageUpdate"] = "MESSAGE_UPDATE"; GatewayDispatchEvents["PresenceUpdate"] = "PRESENCE_UPDATE"; + GatewayDispatchEvents["RateLimited"] = "RATE_LIMITED"; + GatewayDispatchEvents["Ready"] = "READY"; + GatewayDispatchEvents["Resumed"] = "RESUMED"; GatewayDispatchEvents["StageInstanceCreate"] = "STAGE_INSTANCE_CREATE"; GatewayDispatchEvents["StageInstanceDelete"] = "STAGE_INSTANCE_DELETE"; GatewayDispatchEvents["StageInstanceUpdate"] = "STAGE_INSTANCE_UPDATE"; - GatewayDispatchEvents["Ready"] = "READY"; - GatewayDispatchEvents["Resumed"] = "RESUMED"; + GatewayDispatchEvents["SubscriptionCreate"] = "SUBSCRIPTION_CREATE"; + GatewayDispatchEvents["SubscriptionDelete"] = "SUBSCRIPTION_DELETE"; + GatewayDispatchEvents["SubscriptionUpdate"] = "SUBSCRIPTION_UPDATE"; GatewayDispatchEvents["ThreadCreate"] = "THREAD_CREATE"; GatewayDispatchEvents["ThreadDelete"] = "THREAD_DELETE"; GatewayDispatchEvents["ThreadListSync"] = "THREAD_LIST_SYNC"; @@ -237,24 +253,24 @@ var GatewayDispatchEvents; GatewayDispatchEvents["ThreadUpdate"] = "THREAD_UPDATE"; GatewayDispatchEvents["TypingStart"] = "TYPING_START"; GatewayDispatchEvents["UserUpdate"] = "USER_UPDATE"; + GatewayDispatchEvents["VoiceChannelEffectSend"] = "VOICE_CHANNEL_EFFECT_SEND"; GatewayDispatchEvents["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE"; GatewayDispatchEvents["VoiceStateUpdate"] = "VOICE_STATE_UPDATE"; GatewayDispatchEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE"; - GatewayDispatchEvents["MessagePollVoteAdd"] = "MESSAGE_POLL_VOTE_ADD"; - GatewayDispatchEvents["MessagePollVoteRemove"] = "MESSAGE_POLL_VOTE_REMOVE"; - GatewayDispatchEvents["GuildScheduledEventCreate"] = "GUILD_SCHEDULED_EVENT_CREATE"; - GatewayDispatchEvents["GuildScheduledEventUpdate"] = "GUILD_SCHEDULED_EVENT_UPDATE"; - GatewayDispatchEvents["GuildScheduledEventDelete"] = "GUILD_SCHEDULED_EVENT_DELETE"; - GatewayDispatchEvents["GuildScheduledEventUserAdd"] = "GUILD_SCHEDULED_EVENT_USER_ADD"; - GatewayDispatchEvents["GuildScheduledEventUserRemove"] = "GUILD_SCHEDULED_EVENT_USER_REMOVE"; - GatewayDispatchEvents["AutoModerationRuleCreate"] = "AUTO_MODERATION_RULE_CREATE"; - GatewayDispatchEvents["AutoModerationRuleUpdate"] = "AUTO_MODERATION_RULE_UPDATE"; - GatewayDispatchEvents["AutoModerationRuleDelete"] = "AUTO_MODERATION_RULE_DELETE"; - GatewayDispatchEvents["AutoModerationActionExecution"] = "AUTO_MODERATION_ACTION_EXECUTION"; - GatewayDispatchEvents["GuildAuditLogEntryCreate"] = "GUILD_AUDIT_LOG_ENTRY_CREATE"; - GatewayDispatchEvents["EntitlementCreate"] = "ENTITLEMENT_CREATE"; - GatewayDispatchEvents["EntitlementUpdate"] = "ENTITLEMENT_UPDATE"; - GatewayDispatchEvents["EntitlementDelete"] = "ENTITLEMENT_DELETE"; })(GatewayDispatchEvents || (exports.GatewayDispatchEvents = GatewayDispatchEvents = {})); +/** + * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send-animation-types} + */ +var VoiceChannelEffectSendAnimationType; +(function (VoiceChannelEffectSendAnimationType) { + /** + * A fun animation, sent by a Nitro subscriber + */ + VoiceChannelEffectSendAnimationType[VoiceChannelEffectSendAnimationType["Premium"] = 0] = "Premium"; + /** + * The standard animation + */ + VoiceChannelEffectSendAnimationType[VoiceChannelEffectSendAnimationType["Basic"] = 1] = "Basic"; +})(VoiceChannelEffectSendAnimationType || (exports.VoiceChannelEffectSendAnimationType = VoiceChannelEffectSendAnimationType = {})); // #endregion Shared //# sourceMappingURL=v9.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.js.map b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.js.map index e54b6af..27ab93a 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.js.map +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.js.map @@ -1 +1 @@ -{"version":3,"file":"v9.js","sourceRoot":"","sources":["v9.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AAsCH,2CAAyB;AAEZ,QAAA,cAAc,GAAG,GAAG,CAAC;AAElC;;GAEG;AACH,IAAY,cA8CX;AA9CD,WAAY,cAAc;IACzB;;OAEG;IACH,2DAAQ,CAAA;IACR;;;OAGG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,2DAAQ,CAAA;IACR;;OAEG;IAC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C1B,kEAAyC,CAAA;IACzC,gEAAuC,CAAA;IACvC,2DAAkC,CAAA;IAClC,qEAA4C,CAAA;IAC5C,2EAAkD,CAAA;IAClD,mFAA0D,CAAA;IAC1D,mFAA0D,CAAA;IAC1D,mFAA0D,CAAA;IAC1D,sFAA6D,CAAA;IAC7D,4FAAmE,CAAA;IACnE,iFAAwD,CAAA;IACxD,iFAAwD,CAAA;IACxD,iFAAwD,CAAA;IACxD,2FAAkE,CAAA;IAClE,kFAAyD,CAAA;IACzD,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;AACzC,CAAC,EAnEW,qBAAqB,qCAArB,qBAAqB,QAmEhC;AAm3DD,oBAAoB"} \ No newline at end of file +{"version":3,"file":"v9.js","sourceRoot":"","sources":["v9.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAqDU,QAAA,cAAc,GAAG,GAAG,CAAC;AAElC;;GAEG;AACH,IAAY,cAkDX;AAlDD,WAAY,cAAc;IACzB;;OAEG;IACH,2DAAQ,CAAA;IACR;;;OAGG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,2DAAQ,CAAA;IACR;;OAEG;IACH,uEAAc,CAAA;IACd;;OAEG;IACH,2EAAgB,CAAA;IAChB;;OAEG;IACH,uDAAU,CAAA;IACV;;OAEG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,iFAAmB,CAAA;IACnB;;OAEG;IACH,uEAAc,CAAA;IACd;;OAEG;IACH,sDAAK,CAAA;IACL;;OAEG;IACH,oEAAY,CAAA;IACZ;;OAEG;IACH,0FAA4B,CAAA;AAC7B,CAAC,EAlDW,cAAc,8BAAd,cAAc,QAkDzB;AAED;;GAEG;AACH,IAAY,iBA6EX;AA7ED,WAAY,iBAAiB;IAC5B;;OAEG;IACH,4EAAoB,CAAA;IACpB;;;;OAIG;IACH,8EAAa,CAAA;IACb;;;;OAIG;IACH,0EAAW,CAAA;IACX;;;;OAIG;IACH,oFAAgB,CAAA;IAChB;;;;O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3C,uDAA8B,CAAA;IAC9B,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,6EAAoD,CAAA;IACpD,kEAAyC,CAAA;IACzC,gEAAuC,CAAA;IACvC,2DAAkC,CAAA;AACnC,CAAC,EA7EW,qBAAqB,qCAArB,qBAAqB,QA6EhC;AA4uDD;;GAEG;AACH,IAAY,mCASX;AATD,WAAY,mCAAmC;IAC9C;;OAEG;IACH,mGAAO,CAAA;IACP;;OAEG;IACH,+FAAK,CAAA;AACN,CAAC,EATW,mCAAmC,mDAAnC,mCAAmC,QAS9C;AAogBD,oBAAoB"} \ No newline at end of file diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.mjs b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.mjs index 27b1baf..64ad13c 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.mjs +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/gateway/v9.mjs @@ -6,3 +6,4 @@ export const GatewayDispatchEvents = mod.GatewayDispatchEvents; export const GatewayIntentBits = mod.GatewayIntentBits; export const GatewayOpcodes = mod.GatewayOpcodes; export const GatewayVersion = mod.GatewayVersion; +export const VoiceChannelEffectSendAnimationType = mod.VoiceChannelEffectSendAnimationType; diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/globals.d.ts b/node_modules/@discordjs/voice/node_modules/discord-api-types/globals.d.ts index bd4145c..c080ba0 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/globals.d.ts +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/globals.d.ts @@ -1,15 +1,13 @@ /** - * https://discord.com/developers/docs/reference#snowflakes + * @see {@link https://discord.com/developers/docs/reference#snowflakes} */ export type Snowflake = string; /** - * https://discord.com/developers/docs/topics/permissions - * - * @internal + * @see {@link https://discord.com/developers/docs/topics/permissions} */ export type Permissions = string; /** - * https://discord.com/developers/docs/reference#message-formatting-formats + * @see {@link https://discord.com/developers/docs/reference#message-formatting-formats} */ export declare const FormattingPatterns: { /** @@ -88,5 +86,17 @@ export declare const FormattingPatterns: { * The `timestamp` and `style` group properties are present on the `exec` result of this expression */ readonly StyledTimestamp: RegExp; + /** + * Regular expression for matching a guild navigation mention + * + * The `type` group property is present on the `exec` result of this expression + */ + readonly GuildNavigation: RegExp; + /** + * Regular expression for matching a linked role mention + * + * The `id` group property is present on the `exec` result of this expression + */ + readonly LinkedRole: RegExp; }; //# sourceMappingURL=globals.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/globals.d.ts.map b/node_modules/@discordjs/voice/node_modules/discord-api-types/globals.d.ts.map index 1a81c64..e2f9e2e 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/globals.d.ts.map +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/globals.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["globals.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,kBAAkB;IAC9B;;;;OAIG;;IAEH;;;;;;OAMG;;IAEH;;;;;;OAMG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAIH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAGH;;;;OAIG;;IAEH;;;;OAIG;;CAEM,CAAC"} \ No newline at end of file +{"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["globals.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,kBAAkB;IAC9B;;;;OAIG;;IAEH;;;;;;OAMG;;IAEH;;;;;;OAMG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAGH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAGH;;;;OAIG;;IAEH;;;;OAIG;;IAGH;;;;OAIG;;IAEH;;;;OAIG;;CAEM,CAAC"} \ No newline at end of file diff --git a/node_modules/@discordjs/voice/node_modules/discord-api-types/globals.js b/node_modules/@discordjs/voice/node_modules/discord-api-types/globals.js index 636db41..6cd2a05 100644 --- a/node_modules/@discordjs/voice/node_modules/discord-api-types/globals.js +++ b/node_modules/@discordjs/voice/node_modules/discord-api-types/globals.js @@ -2,7 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.FormattingPatterns = void 0; /** - * https://discord.com/developers/docs/reference#message-formatting-formats + * @see {@link https://discord.com/developers/docs/reference#message-formatting-formats} */ exports.FormattingPatterns = { /** @@ -44,9 +44,7 @@ exports.FormattingPatterns = { * * The `fullName` (possibly including `name`, `subcommandOrGroup` and `subcommand`) and `id` group properties are present on the `exec` result of this expression */ - SlashCommand: - // eslint-disable-next-line unicorn/no-unsafe-regex - /<\/(?(?[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32})(?: (?[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?(?: (?[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?):(?\d{17,20})>/u, + SlashCommand: /<\/(?(?[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32})(?: (?[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?(?: (?[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?):(?\d{17,20})>/u, /** * Regular expression for matching a custom emoji, either static or animated * @@ -70,8 +68,8 @@ exports.FormattingPatterns = { * * The `timestamp` and `style` group properties are present on the `exec` result of this expression */ - // eslint-disable-next-line prefer-named-capture-group - Timestamp: /-?\d{1,13})(:(? + + +

+ ${sidebar} +
+

Waehle eine Guild aus

+
Nur Guilds, auf denen der Bot ist.
+
+
+
+ + + + `); + return; + } + res.send(` @@ -12,91 +151,2233 @@ router.get('/', (_req, res) => { Papo Dashboard -
-

Papo Control

- Live Overview & Tickets -
-
-
-

Tickets offen

-

-

-

in-progress / geschlossen: - / -

-
-
-

Neueste Tickets

-
-
-
-

Einstellungen speichern

-
- - - - - - -

+
+ ${sidebar} +
+
+
+

Guild Dashboard

+
Dashboard & Guild-Config
+
+
+

Guild

+ +
+
+
+
+
+
+ icon +
+

Guild

+

ID: -

+
+
+
Bot aktiv
+
+
+
+

Guild Infos

+
+
Owner
-
+
Erstellt
-
+
Member
-
+
Channels
-
+
Tickets offen
-
+
Tickets IP / Closed
- / -
+
+
+
+

Activity

+
+
Messages (24h)
-
+
Commands (24h)
-
+
Automod (24h)
-
+
+
+
+

Guild Logs

+
    +
    +
    +
    +
    +
    +
    +
    +

    Tickets

    +

    Links auswaehlen, Details im Modal. Plus oeffnet Panel-Erstellung.

    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +

    Support-Login Status

    +

    Aktive Supporter und letzte Sessions.

    +
    + +
    +
    +
    +

    Aktiv

    +
    +
    +
    +

    Letzte Sessions

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Automod Einstellungen

    +

    Automod pro Guild aktivieren und Regeln konfigurieren.

    +
    +
    + Automod aktivieren +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +

    Diese Woerter werden zusaetzlich zum Standard-Filter geblockt.

    +
    +
    + + +

    Nachrichten von diesen Rollen werden nicht gefiltert.

    +
    +
    +
    + +
    +

    + +
    +
    +
    +
    +
    +
    +

    Willkommensnachrichten

    +

    Embed konfigurieren und Feature aktivieren.

    +
    +
    + Aktivieren +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    +
    + + + +
    +
    + + + +
    +
    +
    +
    +
    +
    Willkommen!
    +
    Schön, dass du da bist.
    + + +
    +
    +
    + +
    +

    +
    +
    +
    +
    +
    +
    +
    +

    Dynamic Voice

    +

    Lobby waehlen, Channel-Namen & Limits setzen.

    +
    +
    + Aktivieren +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +

    {user} wird durch den Mitgliedsnamen ersetzt.

    +
    +
    + + +
    +
    + + +
    +
    +
    + +
    +

    +
    +
    +
    +
    +
    +

    Module

    +
    +
    +
    +
    +
    +
    +
    +

    Birthday

    +

    Automatische Glueckwuensche je Guild.

    +
    +
    + + + + +
    +
    +
    +
    + + +

    Nutze {user} als Platzhalter.

    +
    +
    + +
    +

    +
    +
    +
    +
    +

    Gespeicherte Geburtstage

    +

    Eintraege werden per /birthday angelegt.

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Reaction Roles

    +

    Reaktionen verteilen oder entfernen Rollen.

    +
    +
    +
    +
    + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    + + +

    Eine Zeile pro Zuordnung. Label/Beschreibung optional.

    +
    +
    + + +
    +
    +
    +
    +
    +
    +

    Reaction Role Nachrichten

    +

    Bestehende Setups bearbeiten oder syncen.

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Statuspage

    +

    Services verwalten und Checks steuern.

    +
    +
    + + + + +
    +
    +
    +
    +
    +
    +
    +

    Services

    +

    Status, Uptime, letzter Check

    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +

    Events

    +

    Termine planen und Erinnerungen senden.

    +
    + +
    +
    +
    +
    +
    +
    +
    +

    Guilds

    +

    -

    +

    aktiv (24h): -

    +
    +
    +

    Uptime

    +

    -

    +

    Start: -

    +
    +
    +
    +
    +
    +

    Aktivität (letzte 24h)

    +

    Events/Commands pro Stunde

    +
    +
    +
    +
    +
    +
    +
    +

    Logs

    +

    Neueste Einträge

    +
    +
    +
      +
      +
      +
      +
      +

      Einstellungen speichern

      +
      + + + + +

      +
      +
      +
      +

      Logging

      +
      +
      + + +

      Falls leer, wird der allgemeine Log Channel genutzt.

      +
      +
      +
      +
      👋 User Join / Leave
      +
      ✏️ Message Edit
      +
      🗑️ Message Delete
      +
      🛡️ Automod Actions
      +
      🎫 Ticket Actions
      +
      🎵 Musik-Events
      +
      ⚙️ System / Channels
      +
      +
      + +
      +

      +
      +
      +
      +
      +
      + + + + + +
      -
      + + + + + + + + +
      @@ -104,7 +2385,8 @@ router.get('/', (_req, res) => { }); router.get('/settings', (_req, res) => { - res.json({ settings: Array.from(settings.entries()) }); + res.json({ settings: [] }); }); export default router; + diff --git a/src/web/server.ts b/src/web/server.ts index e7b03bf..eeba68d 100644 --- a/src/web/server.ts +++ b/src/web/server.ts @@ -2,14 +2,17 @@ import express from 'express'; import session from 'express-session'; import cookieParser from 'cookie-parser'; import path from 'path'; -import authRouter from './routes/auth.js'; -import dashboardRouter from './routes/dashboard.js'; -import apiRouter from './routes/api.js'; -import { env } from '../config/env.js'; +import authRouter from './routes/auth'; +import dashboardRouter from './routes/dashboard'; +import apiRouter from './routes/api'; +import { env } from '../config/env'; export function createWebServer() { const app = express(); - app.use(express.json()); + const basePath = env.webBasePath || '/ucp'; + const dashboardPath = `${basePath}/dashboard`; + const apiPath = `${basePath}/api`; + app.use(express.json({ limit: '5mb' })); app.use(cookieParser()); app.use( session({ @@ -19,14 +22,52 @@ export function createWebServer() { }) ); - app.use('/auth', authRouter); - app.use('/dashboard', dashboardRouter); - app.use('/api', apiRouter); + const mount = (suffix: string) => (basePath ? `${basePath}${suffix}` : suffix); + app.use(mount('/auth'), authRouter); + app.use(dashboardPath, dashboardRouter); + app.use(mount('/api'), apiRouter); + // fallback mounts if proxy strips base path + if (basePath) { + app.use('/api', apiRouter); + app.use('/dashboard', dashboardRouter); + } - app.get('/', (_req, res) => { - res.send(`

      Papo Dashboard

      Zum Dashboard

      `); + // Redirect bare auth calls to the prefixed path when a base path is set + if (basePath) { + app.use('/auth', (_req, res) => res.redirect(`${basePath}${_req.originalUrl}`)); + } + + // Landing pages + app.get('/', (_req, res) => res.redirect(dashboardPath)); + app.get(basePath || '/', (_req, res) => { + res.send(` + + + + + + Papo Dashboard + + + +
      +

      Papo Dashboard

      +

      Verwalte Tickets, Module und Automod.

      + Zum Dashboard +
      + + + `); }); - app.use('/static', express.static(path.join(process.cwd(), 'static'))); + app.use(mount('/static'), express.static(path.join(process.cwd(), 'static'))); return app; } diff --git a/tmp_check.py b/tmp_check.py new file mode 100644 index 0000000..2ee0744 --- /dev/null +++ b/tmp_check.py @@ -0,0 +1,9 @@ +from pathlib import Path +raw = Path('src/services/ticketService.ts').read_bytes() +print('len', len(raw)) +try: + raw.decode('utf-8') + print('utf8 ok') +except Exception as e: + print('decode error', e) + print(raw[e.start:e.start+12]) diff --git a/tmp_head.txt b/tmp_head.txt new file mode 100644 index 0000000..af1c5bd --- /dev/null +++ b/tmp_head.txt @@ -0,0 +1,40 @@ +import { Router } from 'express'; + +const router = Router(); + +router.get('/', (req, res) => { + if (!req.session?.user) { + return res.redirect('/auth/discord'); + } + + const guildId = typeof req.query.guildId === 'string' ? req.query.guildId : ''; + + // TODO: TICKETS: Dashboard-Layout neu aufsetzen (Filter/Status/Live-Ansicht) statt statischem Inline-HTML. + // TODO: MODULE: Musik-Modul im Dashboard als toggelbares Modul mit Status/Queue-Ansicht abbilden. + // TODO: AUTOMOD: Konfiguration (Schwellenwerte, Filter, Logging) im Dashboard editierbar machen. + const sidebar = ` + + `; + + if (!guildId) { + res.send(` + + + + + + Papo Dashboard - Auswahl +