* health check

* Update Dockerfile

* simplifying the deployment

* Update Bot.js

makes the find team command public

* test (#9)

* Dev (#7)

* health check

* Update Dockerfile

* simplifying the deployment

* Dev (#8)

* health check

* Update Dockerfile

* simplifying the deployment

* Update Bot.js

makes the find team command public

* Update PlayerService.js

* massive update????

could break stuff

* Update Bot.js

update
This commit is contained in:
VinceC
2025-07-07 21:38:19 -05:00
committed by GitHub
parent 0c86148835
commit 3453be6947
1742 changed files with 28844 additions and 67711 deletions

View File

@@ -0,0 +1,9 @@
---
description:
globs:
---
# Your rule content
- You can @ files here
- You can use markdown but dont have to

View File

@@ -5,6 +5,22 @@ const commands = [
new SlashCommandBuilder()
.setName("ping")
.setDescription("Replies with Pong!"),
new SlashCommandBuilder()
.setName("help")
.setDescription("Get help with BattleBot commands and features")
.addStringOption((option) =>
option
.setName("category")
.setDescription("Choose a help category")
.setRequired(false)
.addChoices(
{ name: "🏠 Getting Started", value: "getting_started" },
{ name: "🔍 Search Commands", value: "search" },
{ name: "⚙️ Admin & Setup", value: "admin" },
{ name: "🔔 Notifications", value: "notifications" },
{ name: "❓ Troubleshooting", value: "troubleshooting" }
)
),
new SlashCommandBuilder()
.setName("finduser")
.setDescription("Find a user by username")
@@ -13,16 +29,7 @@ const commands = [
.setName("game")
.setDescription("Select the game")
.setRequired(true)
.addChoices(
{ name: "Big Ballers VR", value: "Big Ballers VR" },
{ name: "Blacktop Hoops", value: "Blacktop Hoops" },
{ name: "Breachers", value: "Breachers" },
{ name: "Echo Arena", value: "Echo Arena" },
{ name: "Echo Combat", value: "Echo Combat" },
{ name: "Gun Raiders", value: "Gun Raiders" },
{ name: "Nock", value: "Nock" },
{ name: "VAIL", value: "VAIL" }
)
.setAutocomplete(true)
)
.addStringOption((option) =>
option
@@ -40,7 +47,7 @@ const commands = [
.setRequired(true)
)
.addStringOption((option) =>
option.setName("game").setDescription("Filter by game").setRequired(false)
option.setName("game").setDescription("Filter by game").setRequired(false).setAutocomplete(true)
),
new SlashCommandBuilder()
.setName("subscribe")
@@ -51,16 +58,7 @@ const commands = [
.setName("game")
.setDescription("Game to subscribe to")
.setRequired(true)
.addChoices(
{ name: "Big Ballers VR", value: "Big Ballers VR" },
{ name: "Blacktop Hoops", value: "Blacktop Hoops" },
{ name: "Breachers", value: "Breachers" },
{ name: "Echo Arena", value: "Echo Arena" },
{ name: "Echo Combat", value: "Echo Combat" },
{ name: "Gun Raiders", value: "Gun Raiders" },
{ name: "Nock", value: "Nock" },
{ name: "VAIL", value: "VAIL" }
)
.setAutocomplete(true)
)
.addChannelOption((option) =>
option
@@ -77,16 +75,7 @@ const commands = [
.setName("game")
.setDescription("Game to unsubscribe from")
.setRequired(true)
.addChoices(
{ name: "Big Ballers VR", value: "Big Ballers VR" },
{ name: "Blacktop Hoops", value: "Blacktop Hoops" },
{ name: "Breachers", value: "Breachers" },
{ name: "Echo Arena", value: "Echo Arena" },
{ name: "Echo Combat", value: "Echo Combat" },
{ name: "Gun Raiders", value: "Gun Raiders" },
{ name: "Nock", value: "Nock" },
{ name: "VAIL", value: "VAIL" }
)
.setAutocomplete(true)
),
new SlashCommandBuilder()
.setName("register_server")
@@ -104,16 +93,7 @@ const commands = [
.setName("game")
.setDescription("Select the game")
.setRequired(true)
.addChoices(
{ name: "Big Ballers VR", value: "Big Ballers VR" },
{ name: "Blacktop Hoops", value: "Blacktop Hoops" },
{ name: "Breachers", value: "Breachers" },
{ name: "Echo Arena", value: "Echo Arena" },
{ name: "Echo Combat", value: "Echo Combat" },
{ name: "Gun Raiders", value: "Gun Raiders" },
{ name: "Nock", value: "Nock" },
{ name: "VAIL", value: "VAIL" }
)
.setAutocomplete(true)
)
.addStringOption((option) =>
option

View File

@@ -3,6 +3,13 @@ const { createClient } = require('@supabase/supabase-js');
const Bot = require('./src/Bot');
require('dotenv').config();
// Import Express and create an app for health checks and webhooks
const express = require('express');
const app = express();
// Middleware for parsing JSON
app.use(express.json());
// Initialize logger
const logger = winston.createLogger({
level: 'debug',
@@ -26,8 +33,30 @@ const supabase = createClient(
process.env.SUPABASE_KEY
);
// Initialize and start bot
// Initialize bot
const bot = new Bot(process.env.DISCORD_TOKEN, supabase, logger);
// Add health check endpoint
app.get('/health', (req, res) => {
res.status(200).json({ status: 'healthy' });
});
// Add notification webhook endpoint (this will be used by the NotificationService)
app.post('/api/match-notification', async (req, res) => {
if (bot.notificationService && bot.notificationService.handleMatchNotification) {
await bot.notificationService.handleMatchNotification(req, res);
} else {
res.status(503).json({ error: 'Notification service not ready' });
}
});
// Start the server
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
logger.info(`Health check server listening on port ${PORT}`);
});
// Initialize and start bot
bot.start().catch(error => {
console.error('Failed to start bot:', error);
process.exit(1);

243
node_modules/.package-lock.json generated vendored
View File

@@ -25,21 +25,21 @@
}
},
"node_modules/@discordjs/builders": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.9.0.tgz",
"integrity": "sha512-0zx8DePNVvQibh5ly5kCEei5wtPBIUbSoE9n+91Rlladz4tgtFbJ36PZMxxZrTEOQ7AHMZ/b0crT/0fCy6FTKg==",
"version": "1.11.2",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.11.2.tgz",
"integrity": "sha512-F1WTABdd8/R9D1icJzajC4IuLyyS8f3rTOz66JsSI3pKvpCAtsMBweu8cyNYsIyvcrKAVn9EPK+Psoymq+XC0A==",
"license": "Apache-2.0",
"dependencies": {
"@discordjs/formatters": "^0.5.0",
"@discordjs/formatters": "^0.6.1",
"@discordjs/util": "^1.1.1",
"@sapphire/shapeshift": "^4.0.0",
"discord-api-types": "0.37.97",
"discord-api-types": "^0.38.1",
"fast-deep-equal": "^3.1.3",
"ts-mixer": "^6.0.4",
"tslib": "^2.6.3"
},
"engines": {
"node": ">=18"
"node": ">=16.11.0"
},
"funding": {
"url": "https://github.com/discordjs/discord.js?sponsor"
@@ -55,24 +55,24 @@
}
},
"node_modules/@discordjs/formatters": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.5.0.tgz",
"integrity": "sha512-98b3i+Y19RFq1Xke4NkVY46x8KjJQjldHUuEbCqMvp1F5Iq9HgnGpu91jOi/Ufazhty32eRsKnnzS8n4c+L93g==",
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.6.1.tgz",
"integrity": "sha512-5cnX+tASiPCqCWtFcFslxBVUaCetB0thvM/JyavhbXInP1HJIEU+Qv/zMrnuwSsX3yWH2lVXNJZeDK3EiP4HHg==",
"license": "Apache-2.0",
"dependencies": {
"discord-api-types": "0.37.97"
"discord-api-types": "^0.38.1"
},
"engines": {
"node": ">=18"
"node": ">=16.11.0"
},
"funding": {
"url": "https://github.com/discordjs/discord.js?sponsor"
}
},
"node_modules/@discordjs/rest": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.4.0.tgz",
"integrity": "sha512-Xb2irDqNcq+O8F0/k/NaDp7+t091p+acb51iA4bCKfIn+WFWd6HrNvcsSbMMxIR9NjcMZS6NReTKygqiQN+ntw==",
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.5.1.tgz",
"integrity": "sha512-Tg9840IneBcbrAjcGaQzHUJWFNq1MMWZjTdjJ0WS/89IffaNKc++iOvffucPxQTF/gviO9+9r8kEPea1X5J2Dw==",
"license": "Apache-2.0",
"dependencies": {
"@discordjs/collection": "^2.1.1",
@@ -80,10 +80,10 @@
"@sapphire/async-queue": "^1.5.3",
"@sapphire/snowflake": "^3.5.3",
"@vladfrangu/async_event_emitter": "^2.4.6",
"discord-api-types": "0.37.97",
"discord-api-types": "^0.38.1",
"magic-bytes.js": "^1.10.0",
"tslib": "^2.6.3",
"undici": "6.19.8"
"undici": "6.21.3"
},
"engines": {
"node": ">=18"
@@ -117,20 +117,20 @@
}
},
"node_modules/@discordjs/ws": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.1.1.tgz",
"integrity": "sha512-PZ+vLpxGCRtmr2RMkqh8Zp+BenUaJqlS6xhgWKEZcgC/vfHLEzpHtKkB0sl3nZWpwtcKk6YWy+pU3okL2I97FA==",
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.2.3.tgz",
"integrity": "sha512-wPlQDxEmlDg5IxhJPuxXr3Vy9AjYq5xCvFWGJyD7w7Np8ZGu+Mc+97LCoEc/+AYCo2IDpKioiH0/c/mj5ZR9Uw==",
"license": "Apache-2.0",
"dependencies": {
"@discordjs/collection": "^2.1.0",
"@discordjs/rest": "^2.3.0",
"@discordjs/rest": "^2.5.1",
"@discordjs/util": "^1.1.0",
"@sapphire/async-queue": "^1.5.2",
"@types/ws": "^8.5.10",
"@vladfrangu/async_event_emitter": "^2.2.4",
"discord-api-types": "0.37.83",
"discord-api-types": "^0.38.1",
"tslib": "^2.6.2",
"ws": "^8.16.0"
"ws": "^8.17.0"
},
"engines": {
"node": ">=16.11.0"
@@ -151,16 +151,10 @@
"url": "https://github.com/discordjs/discord.js?sponsor"
}
},
"node_modules/@discordjs/ws/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"
},
"node_modules/@sapphire/async-queue": {
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.3.tgz",
"integrity": "sha512-x7zadcfJGxFka1Q3f8gCts1F0xMwCKbZweM85xECGI0hBTeIZJGGCrHgLggihBoprlQ/hBmDR5LKfIPqnmHM3w==",
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.5.tgz",
"integrity": "sha512-cvGzxbba6sav2zZkH8GPf2oGk9yYoD5qrNWdu9fRehifgnFZJMV+nuy2nON2roRO4yQQ+v7MK/Pktl/HgfsUXg==",
"license": "MIT",
"engines": {
"node": ">=v14.0.0",
@@ -191,18 +185,18 @@
}
},
"node_modules/@supabase/auth-js": {
"version": "2.65.1",
"resolved": "https://registry.npmjs.org/@supabase/auth-js/-/auth-js-2.65.1.tgz",
"integrity": "sha512-IA7i2Xq2SWNCNMKxwmPlHafBQda0qtnFr8QnyyBr+KaSxoXXqEzFCnQ1dGTy6bsZjVBgXu++o3qrDypTspaAPw==",
"version": "2.70.0",
"resolved": "https://registry.npmjs.org/@supabase/auth-js/-/auth-js-2.70.0.tgz",
"integrity": "sha512-BaAK/tOAZFJtzF1sE3gJ2FwTjLf4ky3PSvcvLGEgEmO4BSBkwWKu8l67rLLIBZPDnCyV7Owk2uPyKHa0kj5QGg==",
"license": "MIT",
"dependencies": {
"@supabase/node-fetch": "^2.6.14"
}
},
"node_modules/@supabase/functions-js": {
"version": "2.4.3",
"resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.4.3.tgz",
"integrity": "sha512-sOLXy+mWRyu4LLv1onYydq+10mNRQ4rzqQxNhbrKLTLTcdcmS9hbWif0bGz/NavmiQfPs4ZcmQJp4WqOXlR4AQ==",
"version": "2.4.5",
"resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.4.5.tgz",
"integrity": "sha512-v5GSqb9zbosquTo6gBwIiq7W9eQ7rE5QazsK/ezNiQXdCbY+bH8D9qEaBIkhVvX4ZRW5rP03gEfw5yw9tiq4EQ==",
"license": "MIT",
"dependencies": {
"@supabase/node-fetch": "^2.6.14"
@@ -221,24 +215,25 @@
}
},
"node_modules/@supabase/postgrest-js": {
"version": "1.16.3",
"resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.16.3.tgz",
"integrity": "sha512-HI6dsbW68AKlOPofUjDTaosiDBCtW4XAm0D18pPwxoW3zKOE2Ru13Z69Wuys9fd6iTpfDViNco5sgrtnP0666A==",
"version": "1.19.4",
"resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.19.4.tgz",
"integrity": "sha512-O4soKqKtZIW3olqmbXXbKugUtByD2jPa8kL2m2c1oozAO11uCcGrRhkZL0kVxjBLrXHE0mdSkFsMj7jDSfyNpw==",
"license": "MIT",
"dependencies": {
"@supabase/node-fetch": "^2.6.14"
}
},
"node_modules/@supabase/realtime-js": {
"version": "2.10.7",
"resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.10.7.tgz",
"integrity": "sha512-OLI0hiSAqQSqRpGMTUwoIWo51eUivSYlaNBgxsXZE7PSoWh12wPRdVt0psUMaUzEonSB85K21wGc7W5jHnT6uA==",
"version": "2.11.15",
"resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.11.15.tgz",
"integrity": "sha512-HQKRnwAqdVqJW/P9TjKVK+/ETpW4yQ8tyDPPtRMKOH4Uh3vQD74vmj353CYs8+YwVBKubeUOOEpI9CT8mT4obw==",
"license": "MIT",
"dependencies": {
"@supabase/node-fetch": "^2.6.14",
"@types/phoenix": "^1.5.4",
"@types/ws": "^8.5.10",
"ws": "^8.14.2"
"@supabase/node-fetch": "^2.6.13",
"@types/phoenix": "^1.6.6",
"@types/ws": "^8.18.1",
"isows": "^1.0.7",
"ws": "^8.18.2"
}
},
"node_modules/@supabase/storage-js": {
@@ -251,32 +246,32 @@
}
},
"node_modules/@supabase/supabase-js": {
"version": "2.46.1",
"resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.46.1.tgz",
"integrity": "sha512-HiBpd8stf7M6+tlr+/82L8b2QmCjAD8ex9YdSAKU+whB/SHXXJdus1dGlqiH9Umy9ePUuxaYmVkGd9BcvBnNvg==",
"version": "2.50.3",
"resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.50.3.tgz",
"integrity": "sha512-Ld42AbfSXKnbCE2ObRvrGC5wj9OrfTOzswQZg0OcGQGx+QqcWYN/IqsLqrt4gCFrD57URbNRfGESSWzchzKAuQ==",
"license": "MIT",
"dependencies": {
"@supabase/auth-js": "2.65.1",
"@supabase/functions-js": "2.4.3",
"@supabase/auth-js": "2.70.0",
"@supabase/functions-js": "2.4.5",
"@supabase/node-fetch": "2.6.15",
"@supabase/postgrest-js": "1.16.3",
"@supabase/realtime-js": "2.10.7",
"@supabase/postgrest-js": "1.19.4",
"@supabase/realtime-js": "2.11.15",
"@supabase/storage-js": "2.7.1"
}
},
"node_modules/@types/node": {
"version": "22.5.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.5.tgz",
"integrity": "sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==",
"version": "24.0.7",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.7.tgz",
"integrity": "sha512-YIEUUr4yf8q8oQoXPpSlnvKNVKDQlPMWrmOcgzoduo7kvA2UF0/BwJ/eMKFTiTtkNL17I0M6Xe2tvwFU7be6iw==",
"license": "MIT",
"dependencies": {
"undici-types": "~6.19.2"
"undici-types": "~7.8.0"
}
},
"node_modules/@types/phoenix": {
"version": "1.6.5",
"resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.6.5.tgz",
"integrity": "sha512-xegpDuR+z0UqG9fwHqNoy3rI7JDlvaPh2TY47Fl80oq6g+hXT+c/LEuE43X48clZ6lOfANl5WrPur9fYO1RJ/w==",
"version": "1.6.6",
"resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.6.6.tgz",
"integrity": "sha512-PIzZZlEppgrpoT2QgbnDU+MMzuR6BbCjllj0bM70lWoejMeNJAxCchxnv7J3XFkI8MpygtRpzXrIlmWUBclP5A==",
"license": "MIT"
},
"node_modules/@types/triple-beam": {
@@ -286,9 +281,9 @@
"license": "MIT"
},
"node_modules/@types/ws": {
"version": "8.5.12",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz",
"integrity": "sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==",
"version": "8.18.1",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz",
"integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==",
"license": "MIT",
"dependencies": {
"@types/node": "*"
@@ -350,9 +345,9 @@
"license": "MIT"
},
"node_modules/axios": {
"version": "1.7.7",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz",
"integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==",
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.10.0.tgz",
"integrity": "sha512-/1xYAC4MP/HEG+3duIhFr4ZQXR4sQXOIe+o6sdqzeykGLx6Upp/1p8MHqhINOvGeP7xyNHe7tsiJByc4SSVUxw==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.6",
@@ -405,9 +400,9 @@
}
},
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"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": {
@@ -636,29 +631,33 @@
}
},
"node_modules/discord-api-types": {
"version": "0.37.97",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.97.tgz",
"integrity": "sha512-No1BXPcVkyVD4ZVmbNgDKaBoqgeQ+FJpzZ8wqHkfmBnTZig1FcH3iPPersiK1TUIAzgClh2IvOuVUYfcWLQAOA==",
"license": "MIT"
"version": "0.38.13",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.38.13.tgz",
"integrity": "sha512-FELWJRgLVQuR7Az8RhdEZE0k6QNjSW9PCUcU1iyP2Gke8HrJmnMceSS9pD93UM64s3tvZzJPajpPLjWZJylf4g==",
"license": "MIT",
"workspaces": [
"scripts/actions/documentation"
]
},
"node_modules/discord.js": {
"version": "14.16.2",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.16.2.tgz",
"integrity": "sha512-VGNi9WE2dZIxYM8/r/iatQQ+3LT8STW4hhczJOwm+DBeHq66vsKDCk8trChNCB01sMO9crslYuEMeZl2d7r3xw==",
"version": "14.21.0",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.21.0.tgz",
"integrity": "sha512-U5w41cEmcnSfwKYlLv5RJjB8Joa+QJyRwIJz5i/eg+v2Qvv6EYpCRhN9I2Rlf0900LuqSDg8edakUATrDZQncQ==",
"license": "Apache-2.0",
"dependencies": {
"@discordjs/builders": "^1.9.0",
"@discordjs/builders": "^1.11.2",
"@discordjs/collection": "1.5.3",
"@discordjs/formatters": "^0.5.0",
"@discordjs/rest": "^2.4.0",
"@discordjs/formatters": "^0.6.1",
"@discordjs/rest": "^2.5.1",
"@discordjs/util": "^1.1.1",
"@discordjs/ws": "1.1.1",
"@discordjs/ws": "^1.2.3",
"@sapphire/snowflake": "3.5.3",
"discord-api-types": "0.37.97",
"discord-api-types": "^0.38.1",
"fast-deep-equal": "3.1.3",
"lodash.snakecase": "4.1.1",
"magic-bytes.js": "^1.10.0",
"tslib": "^2.6.3",
"undici": "6.19.8"
"undici": "6.21.3"
},
"engines": {
"node": ">=18"
@@ -737,9 +736,9 @@
}
},
"node_modules/express": {
"version": "4.21.1",
"resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz",
"integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==",
"version": "4.21.2",
"resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz",
"integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==",
"license": "MIT",
"dependencies": {
"accepts": "~1.3.8",
@@ -761,7 +760,7 @@
"methods": "~1.1.2",
"on-finished": "2.4.1",
"parseurl": "~1.3.3",
"path-to-regexp": "0.1.10",
"path-to-regexp": "0.1.12",
"proxy-addr": "~2.0.7",
"qs": "6.13.0",
"range-parser": "~1.2.1",
@@ -776,6 +775,10 @@
},
"engines": {
"node": ">= 0.10.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
}
},
"node_modules/fast-deep-equal": {
@@ -879,6 +882,21 @@
"node": ">= 0.6"
}
},
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/function-bind": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
@@ -1104,6 +1122,21 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/isows": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/isows/-/isows-1.0.7.tgz",
"integrity": "sha512-I1fSfDCZL5P0v33sVqeTDSpcstAg/N+wF5HS033mogOVIp4B+oHC7oOCsA3axAbBSGTJ8QubbNmnIRN/h8U7hg==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/wevm"
}
],
"license": "MIT",
"peerDependencies": {
"ws": "*"
}
},
"node_modules/kuler": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz",
@@ -1146,9 +1179,9 @@
"license": "MIT"
},
"node_modules/magic-bytes.js": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.10.0.tgz",
"integrity": "sha512-/k20Lg2q8LE5xiaaSkMXk4sfvI+9EGEykFS4b0CHHGWqDYU0bGUFSwchNOMA56D7TCs9GwVTkqe9als1/ns8UQ==",
"version": "1.12.1",
"resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.12.1.tgz",
"integrity": "sha512-ThQLOhN86ZkJ7qemtVRGYM+gRgR8GEXNli9H/PMvpnZsE44Xfh3wx9kGJaldg314v85m+bFW6WBMaVHJc/c3zA==",
"license": "MIT"
},
"node_modules/media-typer": {
@@ -1346,9 +1379,9 @@
}
},
"node_modules/path-to-regexp": {
"version": "0.1.10",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz",
"integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==",
"version": "0.1.12",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
"integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==",
"license": "MIT"
},
"node_modules/picomatch": {
@@ -1721,9 +1754,9 @@
"license": "MIT"
},
"node_modules/tslib": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz",
"integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==",
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
"license": "0BSD"
},
"node_modules/type-is": {
@@ -1747,18 +1780,18 @@
"license": "MIT"
},
"node_modules/undici": {
"version": "6.19.8",
"resolved": "https://registry.npmjs.org/undici/-/undici-6.19.8.tgz",
"integrity": "sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==",
"version": "6.21.3",
"resolved": "https://registry.npmjs.org/undici/-/undici-6.21.3.tgz",
"integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==",
"license": "MIT",
"engines": {
"node": ">=18.17"
}
},
"node_modules/undici-types": {
"version": "6.19.8",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
"version": "7.8.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
"integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==",
"license": "MIT"
},
"node_modules/unpipe": {
@@ -1847,9 +1880,9 @@
}
},
"node_modules/ws": {
"version": "8.18.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",
"integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==",
"version": "8.18.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz",
"integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==",
"license": "MIT",
"engines": {
"node": ">=10.0.0"

View File

@@ -23,7 +23,7 @@
## Installation
**Node.js 18 or newer is required.**
**Node.js 16.11.0 or newer is required.**
```sh
npm install @discordjs/builders

View File

@@ -1,5 +1,5 @@
import * as _sapphire_shapeshift from '@sapphire/shapeshift';
import { APIEmbedField, APIEmbedAuthor, APIEmbedFooter, APIEmbedImage, APIEmbed, APISelectMenuOption, APIMessageComponentEmoji, ButtonStyle, ChannelType, APIActionRowComponent, APIActionRowComponentTypes, APIBaseComponent, ComponentType, APIButtonComponent, Snowflake, APISelectMenuComponent, APIChannelSelectComponent, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, APIMessageActionRowComponent, APIModalActionRowComponent, APIModalComponent, APIMessageComponent, APIModalInteractionResponseCallbackData, LocalizationMap, LocaleString, InteractionContextType, Permissions, ApplicationIntegrationType, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandAttachmentOption, APIApplicationCommandBooleanOption, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, APIApplicationCommandOption, Locale, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody } from 'discord-api-types/v10';
import { APIEmbedField, APIEmbedAuthor, APIEmbedFooter, APIEmbedImage, APIEmbed, APISelectMenuOption, APIMessageComponentEmoji, ButtonStyle, ChannelType, APIActionRowComponent, APIComponentInActionRow, APIMessageComponent, APIBaseComponent, ComponentType, APIButtonComponent, Snowflake, APISelectMenuComponent, APIChannelSelectComponent, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, APIComponentInMessageActionRow, APIComponentInModalActionRow, APIFileComponent, APISeparatorComponent, SeparatorSpacingSize, APITextDisplayComponent, APIContainerComponent, APIMediaGalleryComponent, APISectionComponent, APIComponentInContainer, APIMediaGalleryItem, APIThumbnailComponent, APIModalComponent, APIModalInteractionResponseCallbackData, LocalizationMap, LocaleString, InteractionContextType, Permissions, ApplicationIntegrationType, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandAttachmentOption, APIApplicationCommandBooleanOption, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, APIApplicationCommandOption, Locale, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody } from 'discord-api-types/v10';
export * from '@discordjs/formatters';
import { JSONEncodable, Equatable } from '@discordjs/util';
@@ -40,7 +40,7 @@ declare const embedAuthorPredicate: _sapphire_shapeshift.ObjectValidator<{
}>>;
declare const RGBPredicate: _sapphire_shapeshift.NumberValidator<number>;
declare const colorPredicate: _sapphire_shapeshift.UnionValidator<number | [number, number, number] | null>;
declare const descriptionPredicate: _sapphire_shapeshift.UnionValidator<string | null>;
declare const descriptionPredicate$1: _sapphire_shapeshift.UnionValidator<string | null>;
declare const footerTextPredicate: _sapphire_shapeshift.UnionValidator<string | null>;
declare const embedFooterPredicate: _sapphire_shapeshift.ObjectValidator<{
text: string | null;
@@ -52,26 +52,25 @@ declare const embedFooterPredicate: _sapphire_shapeshift.ObjectValidator<{
declare const timestampPredicate: _sapphire_shapeshift.UnionValidator<number | Date | null>;
declare const titlePredicate: _sapphire_shapeshift.UnionValidator<string | null>;
declare const Assertions$5_RGBPredicate: typeof RGBPredicate;
declare const Assertions$5_authorNamePredicate: typeof authorNamePredicate;
declare const Assertions$5_colorPredicate: typeof colorPredicate;
declare const Assertions$5_descriptionPredicate: typeof descriptionPredicate;
declare const Assertions$5_embedAuthorPredicate: typeof embedAuthorPredicate;
declare const Assertions$5_embedFieldPredicate: typeof embedFieldPredicate;
declare const Assertions$5_embedFieldsArrayPredicate: typeof embedFieldsArrayPredicate;
declare const Assertions$5_embedFooterPredicate: typeof embedFooterPredicate;
declare const Assertions$5_fieldInlinePredicate: typeof fieldInlinePredicate;
declare const Assertions$5_fieldLengthPredicate: typeof fieldLengthPredicate;
declare const Assertions$5_fieldNamePredicate: typeof fieldNamePredicate;
declare const Assertions$5_fieldValuePredicate: typeof fieldValuePredicate;
declare const Assertions$5_footerTextPredicate: typeof footerTextPredicate;
declare const Assertions$5_imageURLPredicate: typeof imageURLPredicate;
declare const Assertions$5_timestampPredicate: typeof timestampPredicate;
declare const Assertions$5_titlePredicate: typeof titlePredicate;
declare const Assertions$5_urlPredicate: typeof urlPredicate;
declare const Assertions$5_validateFieldLength: typeof validateFieldLength;
declare namespace Assertions$5 {
export { Assertions$5_RGBPredicate as RGBPredicate, Assertions$5_authorNamePredicate as authorNamePredicate, Assertions$5_colorPredicate as colorPredicate, Assertions$5_descriptionPredicate as descriptionPredicate, Assertions$5_embedAuthorPredicate as embedAuthorPredicate, Assertions$5_embedFieldPredicate as embedFieldPredicate, Assertions$5_embedFieldsArrayPredicate as embedFieldsArrayPredicate, Assertions$5_embedFooterPredicate as embedFooterPredicate, Assertions$5_fieldInlinePredicate as fieldInlinePredicate, Assertions$5_fieldLengthPredicate as fieldLengthPredicate, Assertions$5_fieldNamePredicate as fieldNamePredicate, Assertions$5_fieldValuePredicate as fieldValuePredicate, Assertions$5_footerTextPredicate as footerTextPredicate, Assertions$5_imageURLPredicate as imageURLPredicate, Assertions$5_timestampPredicate as timestampPredicate, Assertions$5_titlePredicate as titlePredicate, Assertions$5_urlPredicate as urlPredicate, Assertions$5_validateFieldLength as validateFieldLength };
declare const Assertions$6_RGBPredicate: typeof RGBPredicate;
declare const Assertions$6_authorNamePredicate: typeof authorNamePredicate;
declare const Assertions$6_colorPredicate: typeof colorPredicate;
declare const Assertions$6_embedAuthorPredicate: typeof embedAuthorPredicate;
declare const Assertions$6_embedFieldPredicate: typeof embedFieldPredicate;
declare const Assertions$6_embedFieldsArrayPredicate: typeof embedFieldsArrayPredicate;
declare const Assertions$6_embedFooterPredicate: typeof embedFooterPredicate;
declare const Assertions$6_fieldInlinePredicate: typeof fieldInlinePredicate;
declare const Assertions$6_fieldLengthPredicate: typeof fieldLengthPredicate;
declare const Assertions$6_fieldNamePredicate: typeof fieldNamePredicate;
declare const Assertions$6_fieldValuePredicate: typeof fieldValuePredicate;
declare const Assertions$6_footerTextPredicate: typeof footerTextPredicate;
declare const Assertions$6_imageURLPredicate: typeof imageURLPredicate;
declare const Assertions$6_timestampPredicate: typeof timestampPredicate;
declare const Assertions$6_titlePredicate: typeof titlePredicate;
declare const Assertions$6_urlPredicate: typeof urlPredicate;
declare const Assertions$6_validateFieldLength: typeof validateFieldLength;
declare namespace Assertions$6 {
export { Assertions$6_RGBPredicate as RGBPredicate, Assertions$6_authorNamePredicate as authorNamePredicate, Assertions$6_colorPredicate as colorPredicate, descriptionPredicate$1 as descriptionPredicate, Assertions$6_embedAuthorPredicate as embedAuthorPredicate, Assertions$6_embedFieldPredicate as embedFieldPredicate, Assertions$6_embedFieldsArrayPredicate as embedFieldsArrayPredicate, Assertions$6_embedFooterPredicate as embedFooterPredicate, Assertions$6_fieldInlinePredicate as fieldInlinePredicate, Assertions$6_fieldLengthPredicate as fieldLengthPredicate, Assertions$6_fieldNamePredicate as fieldNamePredicate, Assertions$6_fieldValuePredicate as fieldValuePredicate, Assertions$6_footerTextPredicate as footerTextPredicate, Assertions$6_imageURLPredicate as imageURLPredicate, Assertions$6_timestampPredicate as timestampPredicate, Assertions$6_titlePredicate as titlePredicate, Assertions$6_urlPredicate as urlPredicate, Assertions$6_validateFieldLength as validateFieldLength };
}
/**
@@ -346,6 +345,7 @@ declare class StringSelectMenuOptionBuilder implements JSONEncodable<APISelectMe
toJSON(): APISelectMenuOption;
}
declare const idValidator: _sapphire_shapeshift.NumberValidator<number>;
declare const customIdValidator: _sapphire_shapeshift.StringValidator<string>;
declare const emojiValidator: _sapphire_shapeshift.ObjectValidator<{
name?: string | undefined;
@@ -393,31 +393,32 @@ declare const channelTypesValidator: _sapphire_shapeshift.ArrayValidator<Channel
declare const urlValidator: _sapphire_shapeshift.StringValidator<string>;
declare function validateRequiredButtonParameters(style?: ButtonStyle, label?: string, emoji?: APIMessageComponentEmoji, customId?: string, skuId?: string, url?: string): void;
declare const Assertions$4_buttonLabelValidator: typeof buttonLabelValidator;
declare const Assertions$4_buttonStyleValidator: typeof buttonStyleValidator;
declare const Assertions$4_channelTypesValidator: typeof channelTypesValidator;
declare const Assertions$4_customIdValidator: typeof customIdValidator;
declare const Assertions$4_defaultValidator: typeof defaultValidator;
declare const Assertions$4_disabledValidator: typeof disabledValidator;
declare const Assertions$4_emojiValidator: typeof emojiValidator;
declare const Assertions$4_jsonOptionValidator: typeof jsonOptionValidator;
declare const Assertions$4_labelValueDescriptionValidator: typeof labelValueDescriptionValidator;
declare const Assertions$4_minMaxValidator: typeof minMaxValidator;
declare const Assertions$4_optionValidator: typeof optionValidator;
declare const Assertions$4_optionsLengthValidator: typeof optionsLengthValidator;
declare const Assertions$4_optionsValidator: typeof optionsValidator;
declare const Assertions$4_urlValidator: typeof urlValidator;
declare const Assertions$4_validateRequiredButtonParameters: typeof validateRequiredButtonParameters;
declare const Assertions$4_validateRequiredSelectMenuOptionParameters: typeof validateRequiredSelectMenuOptionParameters;
declare const Assertions$4_validateRequiredSelectMenuParameters: typeof validateRequiredSelectMenuParameters;
declare namespace Assertions$4 {
export { Assertions$4_buttonLabelValidator as buttonLabelValidator, Assertions$4_buttonStyleValidator as buttonStyleValidator, Assertions$4_channelTypesValidator as channelTypesValidator, Assertions$4_customIdValidator as customIdValidator, Assertions$4_defaultValidator as defaultValidator, Assertions$4_disabledValidator as disabledValidator, Assertions$4_emojiValidator as emojiValidator, Assertions$4_jsonOptionValidator as jsonOptionValidator, Assertions$4_labelValueDescriptionValidator as labelValueDescriptionValidator, Assertions$4_minMaxValidator as minMaxValidator, Assertions$4_optionValidator as optionValidator, Assertions$4_optionsLengthValidator as optionsLengthValidator, Assertions$4_optionsValidator as optionsValidator, placeholderValidator$1 as placeholderValidator, Assertions$4_urlValidator as urlValidator, Assertions$4_validateRequiredButtonParameters as validateRequiredButtonParameters, Assertions$4_validateRequiredSelectMenuOptionParameters as validateRequiredSelectMenuOptionParameters, Assertions$4_validateRequiredSelectMenuParameters as validateRequiredSelectMenuParameters };
declare const Assertions$5_buttonLabelValidator: typeof buttonLabelValidator;
declare const Assertions$5_buttonStyleValidator: typeof buttonStyleValidator;
declare const Assertions$5_channelTypesValidator: typeof channelTypesValidator;
declare const Assertions$5_customIdValidator: typeof customIdValidator;
declare const Assertions$5_defaultValidator: typeof defaultValidator;
declare const Assertions$5_disabledValidator: typeof disabledValidator;
declare const Assertions$5_emojiValidator: typeof emojiValidator;
declare const Assertions$5_idValidator: typeof idValidator;
declare const Assertions$5_jsonOptionValidator: typeof jsonOptionValidator;
declare const Assertions$5_labelValueDescriptionValidator: typeof labelValueDescriptionValidator;
declare const Assertions$5_minMaxValidator: typeof minMaxValidator;
declare const Assertions$5_optionValidator: typeof optionValidator;
declare const Assertions$5_optionsLengthValidator: typeof optionsLengthValidator;
declare const Assertions$5_optionsValidator: typeof optionsValidator;
declare const Assertions$5_urlValidator: typeof urlValidator;
declare const Assertions$5_validateRequiredButtonParameters: typeof validateRequiredButtonParameters;
declare const Assertions$5_validateRequiredSelectMenuOptionParameters: typeof validateRequiredSelectMenuOptionParameters;
declare const Assertions$5_validateRequiredSelectMenuParameters: typeof validateRequiredSelectMenuParameters;
declare namespace Assertions$5 {
export { Assertions$5_buttonLabelValidator as buttonLabelValidator, Assertions$5_buttonStyleValidator as buttonStyleValidator, Assertions$5_channelTypesValidator as channelTypesValidator, Assertions$5_customIdValidator as customIdValidator, Assertions$5_defaultValidator as defaultValidator, Assertions$5_disabledValidator as disabledValidator, Assertions$5_emojiValidator as emojiValidator, Assertions$5_idValidator as idValidator, Assertions$5_jsonOptionValidator as jsonOptionValidator, Assertions$5_labelValueDescriptionValidator as labelValueDescriptionValidator, Assertions$5_minMaxValidator as minMaxValidator, Assertions$5_optionValidator as optionValidator, Assertions$5_optionsLengthValidator as optionsLengthValidator, Assertions$5_optionsValidator as optionsValidator, placeholderValidator$1 as placeholderValidator, Assertions$5_urlValidator as urlValidator, Assertions$5_validateRequiredButtonParameters as validateRequiredButtonParameters, Assertions$5_validateRequiredSelectMenuOptionParameters as validateRequiredSelectMenuOptionParameters, Assertions$5_validateRequiredSelectMenuParameters as validateRequiredSelectMenuParameters };
}
/**
* Any action row component data represented as an object.
*/
type AnyAPIActionRowComponent = APIActionRowComponent<APIActionRowComponentTypes> | APIActionRowComponentTypes;
type AnyAPIActionRowComponent = APIActionRowComponent<APIComponentInActionRow> | APIComponentInActionRow | APIMessageComponent;
/**
* The base component builder that contains common symbols for all sorts of components.
*
@@ -442,6 +443,16 @@ declare abstract class ComponentBuilder<DataType extends Partial<APIBaseComponen
* @param data - The data to construct a component out of
*/
constructor(data: Partial<DataType>);
/**
* Sets the id (not the custom id) for this component.
*
* @param id - The id for this component
*/
setId(id: number): this;
/**
* Clears the id of this component, defaulting to a default incremented id.
*/
clearId(): this;
}
/**
@@ -940,10 +951,6 @@ declare class TextInputBuilder extends ComponentBuilder<APITextInputComponent> i
equals(other: APITextInputComponent | JSONEncodable<APITextInputComponent>): boolean;
}
/**
* The builders that may be used for messages.
*/
type MessageComponentBuilder = ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder;
/**
* The builders that may be used for modals.
*/
@@ -965,7 +972,7 @@ type AnyComponentBuilder = MessageActionRowComponentBuilder | ModalActionRowComp
*
* @typeParam ComponentType - The types of components this action row holds
*/
declare class ActionRowBuilder<ComponentType extends AnyComponentBuilder> extends ComponentBuilder<APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent>> {
declare class ActionRowBuilder<ComponentType extends AnyComponentBuilder> extends ComponentBuilder<APIActionRowComponent<APIComponentInMessageActionRow | APIComponentInModalActionRow>> {
/**
* The components within this action row.
*/
@@ -1004,7 +1011,7 @@ declare class ActionRowBuilder<ComponentType extends AnyComponentBuilder> extend
* .addComponents(button2, button3);
* ```
*/
constructor({ components, ...data }?: Partial<APIActionRowComponent<APIActionRowComponentTypes>>);
constructor({ components, ...data }?: Partial<APIActionRowComponent<APIComponentInActionRow>>);
/**
* Adds components to this action row.
*
@@ -1023,6 +1030,504 @@ declare class ActionRowBuilder<ComponentType extends AnyComponentBuilder> extend
toJSON(): APIActionRowComponent<ReturnType<ComponentType['toJSON']>>;
}
declare class FileBuilder extends ComponentBuilder<APIFileComponent> {
/**
* Creates a new file from API data.
*
* @param data - The API data to create this file with
* @example
* Creating a file from an API data object:
* ```ts
* const file = new FileBuilder({
* spoiler: true,
* file: {
* url: 'attachment://file.png',
* },
* });
* ```
* @example
* Creating a file using setters and API data:
* ```ts
* const file = new FileBuilder({
* file: {
* url: 'attachment://image.jpg',
* },
* })
* .setSpoiler(false);
* ```
*/
constructor(data?: Partial<APIFileComponent>);
/**
* Sets the spoiler status of this file.
*
* @param spoiler - The spoiler status to use
*/
setSpoiler(spoiler?: boolean): this;
/**
* Sets the media URL of this file.
*
* @param url - The URL to use
*/
setURL(url: string): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APIFileComponent;
}
declare class SeparatorBuilder extends ComponentBuilder<APISeparatorComponent> {
/**
* Creates a new separator from API data.
*
* @param data - The API data to create this separator with
* @example
* Creating a separator from an API data object:
* ```ts
* const separator = new SeparatorBuilder({
* spacing: SeparatorSpacingSize.Small,
* divider: true,
* });
* ```
* @example
* Creating a separator using setters and API data:
* ```ts
* const separator = new SeparatorBuilder({
* spacing: SeparatorSpacingSize.Large,
* })
* .setDivider(false);
* ```
*/
constructor(data?: Partial<APISeparatorComponent>);
/**
* Sets whether this separator should show a divider line.
*
* @param divider - Whether to show a divider line
*/
setDivider(divider?: boolean): this;
/**
* Sets the spacing of this separator.
*
* @param spacing - The spacing to use
*/
setSpacing(spacing: SeparatorSpacingSize): this;
/**
* Clears the spacing of this separator.
*/
clearSpacing(): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APISeparatorComponent;
}
declare class TextDisplayBuilder extends ComponentBuilder<APITextDisplayComponent> {
/**
* Creates a new text display from API data.
*
* @param data - The API data to create this text display with
* @example
* Creating a text display from an API data object:
* ```ts
* const textDisplay = new TextDisplayBuilder({
* content: 'some text',
* });
* ```
* @example
* Creating a text display using setters and API data:
* ```ts
* const textDisplay = new TextDisplayBuilder({
* content: 'old text',
* })
* .setContent('new text');
* ```
*/
constructor(data?: Partial<APITextDisplayComponent>);
/**
* Sets the text of this text display.
*
* @param content - The text to use
*/
setContent(content: string): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APITextDisplayComponent;
}
/**
* The builders that may be used within a container.
*/
type ContainerComponentBuilder = ActionRowBuilder<AnyComponentBuilder> | FileBuilder | MediaGalleryBuilder | SectionBuilder | SeparatorBuilder | TextDisplayBuilder;
/**
* A builder that creates API-compatible JSON data for a container.
*/
declare class ContainerBuilder extends ComponentBuilder<APIContainerComponent> {
/**
* The components within this container.
*/
readonly components: ContainerComponentBuilder[];
/**
* Creates a new container from API data.
*
* @param data - The API data to create this container with
* @example
* Creating a container from an API data object:
* ```ts
* const container = new ContainerBuilder({
* components: [
* {
* content: "Some text here",
* type: ComponentType.TextDisplay,
* },
* ],
* });
* ```
* @example
* Creating a container using setters and API data:
* ```ts
* const container = new ContainerBuilder({
* components: [
* {
* content: "# Heading",
* type: ComponentType.TextDisplay,
* },
* ],
* })
* .addComponents(separator, section);
* ```
*/
constructor({ components, ...data }?: Partial<APIContainerComponent>);
/**
* Sets the accent color of this container.
*
* @param color - The color to use
*/
setAccentColor(color?: RGBTuple | number): this;
/**
* Clears the accent color of this container.
*/
clearAccentColor(): this;
/**
* Adds action row components to this container.
*
* @param components - The action row components to add
*/
addActionRowComponents<ComponentType extends MessageActionRowComponentBuilder>(...components: RestOrArray<ActionRowBuilder<ComponentType> | APIActionRowComponent<APIComponentInMessageActionRow> | ((builder: ActionRowBuilder<ComponentType>) => ActionRowBuilder<ComponentType>)>): this;
/**
* Adds file components to this container.
*
* @param components - The file components to add
*/
addFileComponents(...components: RestOrArray<APIFileComponent | FileBuilder | ((builder: FileBuilder) => FileBuilder)>): this;
/**
* Adds media gallery components to this container.
*
* @param components - The media gallery components to add
*/
addMediaGalleryComponents(...components: RestOrArray<APIMediaGalleryComponent | MediaGalleryBuilder | ((builder: MediaGalleryBuilder) => MediaGalleryBuilder)>): this;
/**
* Adds section components to this container.
*
* @param components - The section components to add
*/
addSectionComponents(...components: RestOrArray<APISectionComponent | SectionBuilder | ((builder: SectionBuilder) => SectionBuilder)>): this;
/**
* Adds separator components to this container.
*
* @param components - The separator components to add
*/
addSeparatorComponents(...components: RestOrArray<APISeparatorComponent | SeparatorBuilder | ((builder: SeparatorBuilder) => SeparatorBuilder)>): this;
/**
* Adds text display components to this container.
*
* @param components - The text display components to add
*/
addTextDisplayComponents(...components: RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>): this;
/**
* Removes, replaces, or inserts components for this container.
*
* @param index - The index to start removing, replacing or inserting components
* @param deleteCount - The amount of components to remove
* @param components - The components to set
*/
spliceComponents(index: number, deleteCount: number, ...components: RestOrArray<APIComponentInContainer | ContainerComponentBuilder>): this;
/**
* Sets the spoiler status of this container.
*
* @param spoiler - The spoiler status to use
*/
setSpoiler(spoiler?: boolean): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APIContainerComponent;
}
declare class MediaGalleryItemBuilder implements JSONEncodable<APIMediaGalleryItem> {
/**
* The API data associated with this media gallery item.
*/
readonly data: Partial<APIMediaGalleryItem>;
/**
* Creates a new media gallery item from API data.
*
* @param data - The API data to create this media gallery item with
* @example
* Creating a media gallery item from an API data object:
* ```ts
* const item = new MediaGalleryItemBuilder({
* description: "Some text here",
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/2.png',
* },
* });
* ```
* @example
* Creating a media gallery item using setters and API data:
* ```ts
* const item = new MediaGalleryItemBuilder({
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/5.png',
* },
* })
* .setDescription("alt text");
* ```
*/
constructor(data?: Partial<APIMediaGalleryItem>);
/**
* Sets the description of this media gallery item.
*
* @param description - The description to use
*/
setDescription(description: string): this;
/**
* Clears the description of this media gallery item.
*/
clearDescription(): this;
/**
* Sets the spoiler status of this media gallery item.
*
* @param spoiler - The spoiler status to use
*/
setSpoiler(spoiler?: boolean): this;
/**
* Sets the media URL of this media gallery item.
*
* @param url - The URL to use
*/
setURL(url: string): this;
/**
* Serializes this builder to API-compatible JSON data.
*
* @remarks
* This method runs validations on the data before serializing it.
* As such, it may throw an error if the data is invalid.
*/
toJSON(): APIMediaGalleryItem;
}
/**
* A builder that creates API-compatible JSON data for a container.
*/
declare class MediaGalleryBuilder extends ComponentBuilder<APIMediaGalleryComponent> {
/**
* The components within this container.
*/
readonly items: MediaGalleryItemBuilder[];
/**
* Creates a new media gallery from API data.
*
* @param data - The API data to create this media gallery with
* @example
* Creating a media gallery from an API data object:
* ```ts
* const mediaGallery = new MediaGalleryBuilder({
* items: [
* {
* description: "Some text here",
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/2.png',
* },
* },
* ],
* });
* ```
* @example
* Creating a media gallery using setters and API data:
* ```ts
* const mediaGallery = new MediaGalleryBuilder({
* items: [
* {
* description: "alt text",
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/5.png',
* },
* },
* ],
* })
* .addItems(item2, item3);
* ```
*/
constructor({ items, ...data }?: Partial<APIMediaGalleryComponent>);
/**
* Adds items to this media gallery.
*
* @param items - The items to add
*/
addItems(...items: RestOrArray<APIMediaGalleryItem | MediaGalleryItemBuilder | ((builder: MediaGalleryItemBuilder) => MediaGalleryItemBuilder)>): this;
/**
* Removes, replaces, or inserts media gallery items for this media gallery.
*
* @param index - The index to start removing, replacing or inserting items
* @param deleteCount - The amount of items to remove
* @param items - The items to insert
*/
spliceItems(index: number, deleteCount: number, ...items: RestOrArray<APIMediaGalleryItem | MediaGalleryItemBuilder | ((builder: MediaGalleryItemBuilder) => MediaGalleryItemBuilder)>): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APIMediaGalleryComponent;
}
/**
* A builder that creates API-compatible JSON data for a section.
*/
declare class SectionBuilder extends ComponentBuilder<APISectionComponent> {
/**
* The components within this section.
*/
readonly components: ComponentBuilder[];
/**
* The accessory of this section.
*/
readonly accessory?: ButtonBuilder | ThumbnailBuilder;
/**
* Creates a new section from API data.
*
* @param data - The API data to create this section with
* @example
* Creating a section from an API data object:
* ```ts
* const section = new SectionBuilder({
* components: [
* {
* content: "Some text here",
* type: ComponentType.TextDisplay,
* },
* ],
* accessory: {
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/3.png',
* },
* }
* });
* ```
* @example
* Creating a section using setters and API data:
* ```ts
* const section = new SectionBuilder({
* components: [
* {
* content: "# Heading",
* type: ComponentType.TextDisplay,
* },
* ],
* })
* .setPrimaryButtonAccessory(button);
* ```
*/
constructor({ components, accessory, ...data }?: Partial<APISectionComponent>);
/**
* Sets the accessory of this section to a button.
*
* @param accessory - The accessory to use
*/
setButtonAccessory(accessory: APIButtonComponent | ButtonBuilder | ((builder: ButtonBuilder) => ButtonBuilder)): this;
/**
* Sets the accessory of this section to a thumbnail.
*
* @param accessory - The accessory to use
*/
setThumbnailAccessory(accessory: APIThumbnailComponent | ThumbnailBuilder | ((builder: ThumbnailBuilder) => ThumbnailBuilder)): this;
/**
* Adds text display components to this section.
*
* @param components - The text display components to add
*/
addTextDisplayComponents(...components: RestOrArray<TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>): this;
/**
* Removes, replaces, or inserts text display components for this section.
*
* @param index - The index to start removing, replacing or inserting text display components
* @param deleteCount - The amount of text display components to remove
* @param components - The text display components to insert
*/
spliceTextDisplayComponents(index: number, deleteCount: number, ...components: RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APISectionComponent;
}
declare class ThumbnailBuilder extends ComponentBuilder<APIThumbnailComponent> {
/**
* Creates a new thumbnail from API data.
*
* @param data - The API data to create this thumbnail with
* @example
* Creating a thumbnail from an API data object:
* ```ts
* const thumbnail = new ThumbnailBuilder({
* description: 'some text',
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/4.png',
* },
* });
* ```
* @example
* Creating a thumbnail using setters and API data:
* ```ts
* const thumbnail = new ThumbnailBuilder({
* media: {
* url: 'attachment://image.png',
* },
* })
* .setDescription('alt text');
* ```
*/
constructor(data?: Partial<APIThumbnailComponent>);
/**
* Sets the description of this thumbnail.
*
* @param description - The description to use
*/
setDescription(description: string): this;
/**
* Clears the description of this thumbnail.
*/
clearDescription(): this;
/**
* Sets the spoiler status of this thumbnail.
*
* @param spoiler - The spoiler status to use
*/
setSpoiler(spoiler?: boolean): this;
/**
* Sets the media URL of this thumbnail.
*
* @param url - The URL to use
*/
setURL(url: string): this;
/**
* {@inheritdoc ComponentBuilder.toJSON}
*/
toJSON(): APIThumbnailComponent;
}
/**
* The builders that may be used for messages.
*/
type MessageComponentBuilder = ActionRowBuilder<MessageActionRowComponentBuilder> | ContainerBuilder | FileBuilder | MediaGalleryBuilder | MessageActionRowComponentBuilder | SectionBuilder | SeparatorBuilder | TextDisplayBuilder | ThumbnailBuilder;
/**
* Components here are mapped to their respective builder.
*/
@@ -1059,6 +1564,34 @@ interface MappedComponentTypes {
* The channel select component type is associated with a {@link ChannelSelectMenuBuilder}.
*/
[ComponentType.ChannelSelect]: ChannelSelectMenuBuilder;
/**
* The file component type is associated with a {@link FileBuilder}.
*/
[ComponentType.File]: FileBuilder;
/**
* The separator component type is associated with a {@link SeparatorBuilder}.
*/
[ComponentType.Separator]: SeparatorBuilder;
/**
* The container component type is associated with a {@link ContainerBuilder}.
*/
[ComponentType.Container]: ContainerBuilder;
/**
* The text display component type is associated with a {@link TextDisplayBuilder}.
*/
[ComponentType.TextDisplay]: TextDisplayBuilder;
/**
* The thumbnail component type is associated with a {@link ThumbnailBuilder}.
*/
[ComponentType.Thumbnail]: ThumbnailBuilder;
/**
* The section component type is associated with a {@link SectionBuilder}.
*/
[ComponentType.Section]: SectionBuilder;
/**
* The media gallery component type is associated with a {@link MediaGalleryBuilder}.
*/
[ComponentType.MediaGallery]: MediaGalleryBuilder;
}
/**
* Factory for creating components from API data.
@@ -1076,6 +1609,7 @@ declare function createComponentBuilder<ComponentType extends keyof MappedCompon
* @param data - The API data to transform to a component class
*/
declare function createComponentBuilder<ComponentBuilder extends MessageComponentBuilder | ModalComponentBuilder>(data: ComponentBuilder): ComponentBuilder;
declare function resolveBuilder<ComponentType extends Record<PropertyKey, any>, Builder extends JSONEncodable<any>>(builder: Builder | ComponentType | ((builder: Builder) => Builder), Constructor: new (data?: ComponentType) => Builder): Builder;
declare const textInputStyleValidator: _sapphire_shapeshift.NativeEnumValidator<typeof TextInputStyle>;
declare const minLengthValidator: _sapphire_shapeshift.NumberValidator<number>;
@@ -1086,15 +1620,15 @@ declare const placeholderValidator: _sapphire_shapeshift.StringValidator<string>
declare const labelValidator: _sapphire_shapeshift.StringValidator<string>;
declare function validateRequiredParameters$3(customId?: string, style?: TextInputStyle, label?: string): void;
declare const Assertions$3_labelValidator: typeof labelValidator;
declare const Assertions$3_maxLengthValidator: typeof maxLengthValidator;
declare const Assertions$3_minLengthValidator: typeof minLengthValidator;
declare const Assertions$3_placeholderValidator: typeof placeholderValidator;
declare const Assertions$3_requiredValidator: typeof requiredValidator;
declare const Assertions$3_textInputStyleValidator: typeof textInputStyleValidator;
declare const Assertions$3_valueValidator: typeof valueValidator;
declare namespace Assertions$3 {
export { Assertions$3_labelValidator as labelValidator, Assertions$3_maxLengthValidator as maxLengthValidator, Assertions$3_minLengthValidator as minLengthValidator, Assertions$3_placeholderValidator as placeholderValidator, Assertions$3_requiredValidator as requiredValidator, Assertions$3_textInputStyleValidator as textInputStyleValidator, validateRequiredParameters$3 as validateRequiredParameters, Assertions$3_valueValidator as valueValidator };
declare const Assertions$4_labelValidator: typeof labelValidator;
declare const Assertions$4_maxLengthValidator: typeof maxLengthValidator;
declare const Assertions$4_minLengthValidator: typeof minLengthValidator;
declare const Assertions$4_placeholderValidator: typeof placeholderValidator;
declare const Assertions$4_requiredValidator: typeof requiredValidator;
declare const Assertions$4_textInputStyleValidator: typeof textInputStyleValidator;
declare const Assertions$4_valueValidator: typeof valueValidator;
declare namespace Assertions$4 {
export { Assertions$4_labelValidator as labelValidator, Assertions$4_maxLengthValidator as maxLengthValidator, Assertions$4_minLengthValidator as minLengthValidator, Assertions$4_placeholderValidator as placeholderValidator, Assertions$4_requiredValidator as requiredValidator, Assertions$4_textInputStyleValidator as textInputStyleValidator, validateRequiredParameters$3 as validateRequiredParameters, Assertions$4_valueValidator as valueValidator };
}
/**
@@ -1132,7 +1666,7 @@ declare class ModalBuilder implements JSONEncodable<APIModalInteractionResponseC
*
* @param components - The components to add
*/
addComponents(...components: RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder> | APIActionRowComponent<APIModalActionRowComponent>>): this;
addComponents(...components: RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder> | APIActionRowComponent<APIComponentInModalActionRow>>): this;
/**
* Sets components for this modal.
*
@@ -1149,10 +1683,44 @@ declare const titleValidator: _sapphire_shapeshift.StringValidator<string>;
declare const componentsValidator: _sapphire_shapeshift.ArrayValidator<[ActionRowBuilder<AnyComponentBuilder>, ...ActionRowBuilder<AnyComponentBuilder>[]], ActionRowBuilder<AnyComponentBuilder>>;
declare function validateRequiredParameters$2(customId?: string, title?: string, components?: ActionRowBuilder<ModalActionRowComponentBuilder>[]): void;
declare const Assertions$2_componentsValidator: typeof componentsValidator;
declare const Assertions$2_titleValidator: typeof titleValidator;
declare const Assertions$3_componentsValidator: typeof componentsValidator;
declare const Assertions$3_titleValidator: typeof titleValidator;
declare namespace Assertions$3 {
export { Assertions$3_componentsValidator as componentsValidator, Assertions$3_titleValidator as titleValidator, validateRequiredParameters$2 as validateRequiredParameters };
}
declare const unfurledMediaItemPredicate: _sapphire_shapeshift.ObjectValidator<{
url: string;
}, _sapphire_shapeshift.UndefinedToOptional<{
url: string;
}>>;
declare const descriptionPredicate: _sapphire_shapeshift.StringValidator<string>;
declare const filePredicate: _sapphire_shapeshift.ObjectValidator<{
url: string;
}, _sapphire_shapeshift.UndefinedToOptional<{
url: string;
}>>;
declare const spoilerPredicate: _sapphire_shapeshift.BooleanValidator<boolean>;
declare const dividerPredicate: _sapphire_shapeshift.BooleanValidator<boolean>;
declare const spacingPredicate: _sapphire_shapeshift.NativeEnumValidator<typeof SeparatorSpacingSize>;
declare const textDisplayContentPredicate: _sapphire_shapeshift.StringValidator<string>;
declare const accessoryPredicate: _sapphire_shapeshift.UnionValidator<ButtonBuilder | ThumbnailBuilder>;
declare const containerColorPredicate: _sapphire_shapeshift.UnionValidator<number | [number, number, number] | null | undefined>;
declare function assertReturnOfBuilder$1<ReturnType extends MediaGalleryItemBuilder | TextDisplayBuilder>(input: unknown, ExpectedInstanceOf: new () => ReturnType): asserts input is ReturnType;
declare function validateComponentArray<ReturnType extends ContainerComponentBuilder | MediaGalleryItemBuilder = ContainerComponentBuilder>(input: unknown, min: number, max: number, ExpectedInstanceOf?: new () => ReturnType): asserts input is ReturnType[];
declare const Assertions$2_accessoryPredicate: typeof accessoryPredicate;
declare const Assertions$2_containerColorPredicate: typeof containerColorPredicate;
declare const Assertions$2_descriptionPredicate: typeof descriptionPredicate;
declare const Assertions$2_dividerPredicate: typeof dividerPredicate;
declare const Assertions$2_filePredicate: typeof filePredicate;
declare const Assertions$2_spacingPredicate: typeof spacingPredicate;
declare const Assertions$2_spoilerPredicate: typeof spoilerPredicate;
declare const Assertions$2_textDisplayContentPredicate: typeof textDisplayContentPredicate;
declare const Assertions$2_unfurledMediaItemPredicate: typeof unfurledMediaItemPredicate;
declare const Assertions$2_validateComponentArray: typeof validateComponentArray;
declare namespace Assertions$2 {
export { Assertions$2_componentsValidator as componentsValidator, Assertions$2_titleValidator as titleValidator, validateRequiredParameters$2 as validateRequiredParameters };
export { Assertions$2_accessoryPredicate as accessoryPredicate, assertReturnOfBuilder$1 as assertReturnOfBuilder, Assertions$2_containerColorPredicate as containerColorPredicate, Assertions$2_descriptionPredicate as descriptionPredicate, Assertions$2_dividerPredicate as dividerPredicate, Assertions$2_filePredicate as filePredicate, Assertions$2_spacingPredicate as spacingPredicate, Assertions$2_spoilerPredicate as spoilerPredicate, Assertions$2_textDisplayContentPredicate as textDisplayContentPredicate, Assertions$2_unfurledMediaItemPredicate as unfurledMediaItemPredicate, Assertions$2_validateComponentArray as validateComponentArray };
}
/**
@@ -1843,7 +2411,7 @@ declare function validateDefaultPermission$1(value: unknown): asserts value is b
declare function validateRequired(required: unknown): asserts required is boolean;
declare function validateChoicesLength(amountAdding: number, choices?: APIApplicationCommandOptionChoice[]): void;
declare function assertReturnOfBuilder<ReturnType extends ApplicationCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder>(input: unknown, ExpectedInstanceOf: new () => ReturnType): asserts input is ReturnType;
declare const localizationMapPredicate: _sapphire_shapeshift.UnionValidator<_sapphire_shapeshift.UndefinedToOptional<Partial<Record<"id" | "en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "es-419" | "sv-SE" | "th" | "tr" | "uk" | "vi", string | null>>> | null | undefined>;
declare const localizationMapPredicate: _sapphire_shapeshift.UnionValidator<_sapphire_shapeshift.UndefinedToOptional<Partial<Record<Locale, string | null>>> | null | undefined>;
declare function validateLocalizationMap(value: unknown): asserts value is LocalizationMap;
declare function validateDMPermission$1(value: unknown): asserts value is boolean | null | undefined;
declare function validateDefaultMemberPermissions$1(permissions: unknown): string | null | undefined;
@@ -2040,4 +2608,4 @@ declare function isValidationEnabled(): boolean;
*/
declare const version: string;
export { ActionRowBuilder, type AnyAPIActionRowComponent, type AnyComponentBuilder, ApplicationCommandNumericOptionMinMaxValueMixin, type ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, ApplicationCommandOptionChannelTypesMixin, ApplicationCommandOptionWithAutocompleteMixin, ApplicationCommandOptionWithChoicesMixin, BaseSelectMenuBuilder, ButtonBuilder, ChannelSelectMenuBuilder, Assertions$4 as ComponentAssertions, ComponentBuilder, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, type ContextMenuCommandType, Assertions$5 as EmbedAssertions, type EmbedAuthorData, type EmbedAuthorOptions, EmbedBuilder, type EmbedFooterData, type EmbedFooterOptions, type EmbedImageData, type IconData, type MappedComponentTypes, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, type MessageComponentBuilder, type ModalActionRowComponentBuilder, Assertions$2 as ModalAssertions, ModalBuilder, type ModalComponentBuilder, type RGBTuple, type RestOrArray, RoleSelectMenuBuilder, StringSelectMenuBuilder as SelectMenuBuilder, StringSelectMenuOptionBuilder as SelectMenuOptionBuilder, SharedNameAndDescription, SharedSlashCommand, SharedSlashCommandOptions, SharedSlashCommandSubcommands, Assertions$1 as SlashCommandAssertions, SlashCommandAttachmentOption, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, type SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, type SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, Assertions$3 as TextInputAssertions, TextInputBuilder, type ToAPIApplicationCommandOptions, UserSelectMenuBuilder, createComponentBuilder, disableValidators, embedLength, enableValidators, isValidationEnabled, normalizeArray, version };
export { ActionRowBuilder, type AnyAPIActionRowComponent, type AnyComponentBuilder, ApplicationCommandNumericOptionMinMaxValueMixin, type ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, ApplicationCommandOptionChannelTypesMixin, ApplicationCommandOptionWithAutocompleteMixin, ApplicationCommandOptionWithChoicesMixin, BaseSelectMenuBuilder, ButtonBuilder, ChannelSelectMenuBuilder, Assertions$5 as ComponentAssertions, ComponentBuilder, Assertions$2 as ComponentsV2Assertions, ContainerBuilder, type ContainerComponentBuilder, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, type ContextMenuCommandType, Assertions$6 as EmbedAssertions, type EmbedAuthorData, type EmbedAuthorOptions, EmbedBuilder, type EmbedFooterData, type EmbedFooterOptions, type EmbedImageData, FileBuilder, type IconData, type MappedComponentTypes, MediaGalleryBuilder, MediaGalleryItemBuilder, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, type MessageComponentBuilder, type ModalActionRowComponentBuilder, Assertions$3 as ModalAssertions, ModalBuilder, type ModalComponentBuilder, type RGBTuple, type RestOrArray, RoleSelectMenuBuilder, SectionBuilder, StringSelectMenuBuilder as SelectMenuBuilder, StringSelectMenuOptionBuilder as SelectMenuOptionBuilder, SeparatorBuilder, SharedNameAndDescription, SharedSlashCommand, SharedSlashCommandOptions, SharedSlashCommandSubcommands, Assertions$1 as SlashCommandAssertions, SlashCommandAttachmentOption, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, type SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, type SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, TextDisplayBuilder, Assertions$4 as TextInputAssertions, TextInputBuilder, ThumbnailBuilder, type ToAPIApplicationCommandOptions, UserSelectMenuBuilder, createComponentBuilder, disableValidators, embedLength, enableValidators, isValidationEnabled, normalizeArray, resolveBuilder, version };

View File

@@ -1,5 +1,5 @@
import * as _sapphire_shapeshift from '@sapphire/shapeshift';
import { APIEmbedField, APIEmbedAuthor, APIEmbedFooter, APIEmbedImage, APIEmbed, APISelectMenuOption, APIMessageComponentEmoji, ButtonStyle, ChannelType, APIActionRowComponent, APIActionRowComponentTypes, APIBaseComponent, ComponentType, APIButtonComponent, Snowflake, APISelectMenuComponent, APIChannelSelectComponent, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, APIMessageActionRowComponent, APIModalActionRowComponent, APIModalComponent, APIMessageComponent, APIModalInteractionResponseCallbackData, LocalizationMap, LocaleString, InteractionContextType, Permissions, ApplicationIntegrationType, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandAttachmentOption, APIApplicationCommandBooleanOption, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, APIApplicationCommandOption, Locale, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody } from 'discord-api-types/v10';
import { APIEmbedField, APIEmbedAuthor, APIEmbedFooter, APIEmbedImage, APIEmbed, APISelectMenuOption, APIMessageComponentEmoji, ButtonStyle, ChannelType, APIActionRowComponent, APIComponentInActionRow, APIMessageComponent, APIBaseComponent, ComponentType, APIButtonComponent, Snowflake, APISelectMenuComponent, APIChannelSelectComponent, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, APIComponentInMessageActionRow, APIComponentInModalActionRow, APIFileComponent, APISeparatorComponent, SeparatorSpacingSize, APITextDisplayComponent, APIContainerComponent, APIMediaGalleryComponent, APISectionComponent, APIComponentInContainer, APIMediaGalleryItem, APIThumbnailComponent, APIModalComponent, APIModalInteractionResponseCallbackData, LocalizationMap, LocaleString, InteractionContextType, Permissions, ApplicationIntegrationType, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandAttachmentOption, APIApplicationCommandBooleanOption, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, APIApplicationCommandOption, Locale, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody } from 'discord-api-types/v10';
export * from '@discordjs/formatters';
import { JSONEncodable, Equatable } from '@discordjs/util';
@@ -40,7 +40,7 @@ declare const embedAuthorPredicate: _sapphire_shapeshift.ObjectValidator<{
}>>;
declare const RGBPredicate: _sapphire_shapeshift.NumberValidator<number>;
declare const colorPredicate: _sapphire_shapeshift.UnionValidator<number | [number, number, number] | null>;
declare const descriptionPredicate: _sapphire_shapeshift.UnionValidator<string | null>;
declare const descriptionPredicate$1: _sapphire_shapeshift.UnionValidator<string | null>;
declare const footerTextPredicate: _sapphire_shapeshift.UnionValidator<string | null>;
declare const embedFooterPredicate: _sapphire_shapeshift.ObjectValidator<{
text: string | null;
@@ -52,26 +52,25 @@ declare const embedFooterPredicate: _sapphire_shapeshift.ObjectValidator<{
declare const timestampPredicate: _sapphire_shapeshift.UnionValidator<number | Date | null>;
declare const titlePredicate: _sapphire_shapeshift.UnionValidator<string | null>;
declare const Assertions$5_RGBPredicate: typeof RGBPredicate;
declare const Assertions$5_authorNamePredicate: typeof authorNamePredicate;
declare const Assertions$5_colorPredicate: typeof colorPredicate;
declare const Assertions$5_descriptionPredicate: typeof descriptionPredicate;
declare const Assertions$5_embedAuthorPredicate: typeof embedAuthorPredicate;
declare const Assertions$5_embedFieldPredicate: typeof embedFieldPredicate;
declare const Assertions$5_embedFieldsArrayPredicate: typeof embedFieldsArrayPredicate;
declare const Assertions$5_embedFooterPredicate: typeof embedFooterPredicate;
declare const Assertions$5_fieldInlinePredicate: typeof fieldInlinePredicate;
declare const Assertions$5_fieldLengthPredicate: typeof fieldLengthPredicate;
declare const Assertions$5_fieldNamePredicate: typeof fieldNamePredicate;
declare const Assertions$5_fieldValuePredicate: typeof fieldValuePredicate;
declare const Assertions$5_footerTextPredicate: typeof footerTextPredicate;
declare const Assertions$5_imageURLPredicate: typeof imageURLPredicate;
declare const Assertions$5_timestampPredicate: typeof timestampPredicate;
declare const Assertions$5_titlePredicate: typeof titlePredicate;
declare const Assertions$5_urlPredicate: typeof urlPredicate;
declare const Assertions$5_validateFieldLength: typeof validateFieldLength;
declare namespace Assertions$5 {
export { Assertions$5_RGBPredicate as RGBPredicate, Assertions$5_authorNamePredicate as authorNamePredicate, Assertions$5_colorPredicate as colorPredicate, Assertions$5_descriptionPredicate as descriptionPredicate, Assertions$5_embedAuthorPredicate as embedAuthorPredicate, Assertions$5_embedFieldPredicate as embedFieldPredicate, Assertions$5_embedFieldsArrayPredicate as embedFieldsArrayPredicate, Assertions$5_embedFooterPredicate as embedFooterPredicate, Assertions$5_fieldInlinePredicate as fieldInlinePredicate, Assertions$5_fieldLengthPredicate as fieldLengthPredicate, Assertions$5_fieldNamePredicate as fieldNamePredicate, Assertions$5_fieldValuePredicate as fieldValuePredicate, Assertions$5_footerTextPredicate as footerTextPredicate, Assertions$5_imageURLPredicate as imageURLPredicate, Assertions$5_timestampPredicate as timestampPredicate, Assertions$5_titlePredicate as titlePredicate, Assertions$5_urlPredicate as urlPredicate, Assertions$5_validateFieldLength as validateFieldLength };
declare const Assertions$6_RGBPredicate: typeof RGBPredicate;
declare const Assertions$6_authorNamePredicate: typeof authorNamePredicate;
declare const Assertions$6_colorPredicate: typeof colorPredicate;
declare const Assertions$6_embedAuthorPredicate: typeof embedAuthorPredicate;
declare const Assertions$6_embedFieldPredicate: typeof embedFieldPredicate;
declare const Assertions$6_embedFieldsArrayPredicate: typeof embedFieldsArrayPredicate;
declare const Assertions$6_embedFooterPredicate: typeof embedFooterPredicate;
declare const Assertions$6_fieldInlinePredicate: typeof fieldInlinePredicate;
declare const Assertions$6_fieldLengthPredicate: typeof fieldLengthPredicate;
declare const Assertions$6_fieldNamePredicate: typeof fieldNamePredicate;
declare const Assertions$6_fieldValuePredicate: typeof fieldValuePredicate;
declare const Assertions$6_footerTextPredicate: typeof footerTextPredicate;
declare const Assertions$6_imageURLPredicate: typeof imageURLPredicate;
declare const Assertions$6_timestampPredicate: typeof timestampPredicate;
declare const Assertions$6_titlePredicate: typeof titlePredicate;
declare const Assertions$6_urlPredicate: typeof urlPredicate;
declare const Assertions$6_validateFieldLength: typeof validateFieldLength;
declare namespace Assertions$6 {
export { Assertions$6_RGBPredicate as RGBPredicate, Assertions$6_authorNamePredicate as authorNamePredicate, Assertions$6_colorPredicate as colorPredicate, descriptionPredicate$1 as descriptionPredicate, Assertions$6_embedAuthorPredicate as embedAuthorPredicate, Assertions$6_embedFieldPredicate as embedFieldPredicate, Assertions$6_embedFieldsArrayPredicate as embedFieldsArrayPredicate, Assertions$6_embedFooterPredicate as embedFooterPredicate, Assertions$6_fieldInlinePredicate as fieldInlinePredicate, Assertions$6_fieldLengthPredicate as fieldLengthPredicate, Assertions$6_fieldNamePredicate as fieldNamePredicate, Assertions$6_fieldValuePredicate as fieldValuePredicate, Assertions$6_footerTextPredicate as footerTextPredicate, Assertions$6_imageURLPredicate as imageURLPredicate, Assertions$6_timestampPredicate as timestampPredicate, Assertions$6_titlePredicate as titlePredicate, Assertions$6_urlPredicate as urlPredicate, Assertions$6_validateFieldLength as validateFieldLength };
}
/**
@@ -346,6 +345,7 @@ declare class StringSelectMenuOptionBuilder implements JSONEncodable<APISelectMe
toJSON(): APISelectMenuOption;
}
declare const idValidator: _sapphire_shapeshift.NumberValidator<number>;
declare const customIdValidator: _sapphire_shapeshift.StringValidator<string>;
declare const emojiValidator: _sapphire_shapeshift.ObjectValidator<{
name?: string | undefined;
@@ -393,31 +393,32 @@ declare const channelTypesValidator: _sapphire_shapeshift.ArrayValidator<Channel
declare const urlValidator: _sapphire_shapeshift.StringValidator<string>;
declare function validateRequiredButtonParameters(style?: ButtonStyle, label?: string, emoji?: APIMessageComponentEmoji, customId?: string, skuId?: string, url?: string): void;
declare const Assertions$4_buttonLabelValidator: typeof buttonLabelValidator;
declare const Assertions$4_buttonStyleValidator: typeof buttonStyleValidator;
declare const Assertions$4_channelTypesValidator: typeof channelTypesValidator;
declare const Assertions$4_customIdValidator: typeof customIdValidator;
declare const Assertions$4_defaultValidator: typeof defaultValidator;
declare const Assertions$4_disabledValidator: typeof disabledValidator;
declare const Assertions$4_emojiValidator: typeof emojiValidator;
declare const Assertions$4_jsonOptionValidator: typeof jsonOptionValidator;
declare const Assertions$4_labelValueDescriptionValidator: typeof labelValueDescriptionValidator;
declare const Assertions$4_minMaxValidator: typeof minMaxValidator;
declare const Assertions$4_optionValidator: typeof optionValidator;
declare const Assertions$4_optionsLengthValidator: typeof optionsLengthValidator;
declare const Assertions$4_optionsValidator: typeof optionsValidator;
declare const Assertions$4_urlValidator: typeof urlValidator;
declare const Assertions$4_validateRequiredButtonParameters: typeof validateRequiredButtonParameters;
declare const Assertions$4_validateRequiredSelectMenuOptionParameters: typeof validateRequiredSelectMenuOptionParameters;
declare const Assertions$4_validateRequiredSelectMenuParameters: typeof validateRequiredSelectMenuParameters;
declare namespace Assertions$4 {
export { Assertions$4_buttonLabelValidator as buttonLabelValidator, Assertions$4_buttonStyleValidator as buttonStyleValidator, Assertions$4_channelTypesValidator as channelTypesValidator, Assertions$4_customIdValidator as customIdValidator, Assertions$4_defaultValidator as defaultValidator, Assertions$4_disabledValidator as disabledValidator, Assertions$4_emojiValidator as emojiValidator, Assertions$4_jsonOptionValidator as jsonOptionValidator, Assertions$4_labelValueDescriptionValidator as labelValueDescriptionValidator, Assertions$4_minMaxValidator as minMaxValidator, Assertions$4_optionValidator as optionValidator, Assertions$4_optionsLengthValidator as optionsLengthValidator, Assertions$4_optionsValidator as optionsValidator, placeholderValidator$1 as placeholderValidator, Assertions$4_urlValidator as urlValidator, Assertions$4_validateRequiredButtonParameters as validateRequiredButtonParameters, Assertions$4_validateRequiredSelectMenuOptionParameters as validateRequiredSelectMenuOptionParameters, Assertions$4_validateRequiredSelectMenuParameters as validateRequiredSelectMenuParameters };
declare const Assertions$5_buttonLabelValidator: typeof buttonLabelValidator;
declare const Assertions$5_buttonStyleValidator: typeof buttonStyleValidator;
declare const Assertions$5_channelTypesValidator: typeof channelTypesValidator;
declare const Assertions$5_customIdValidator: typeof customIdValidator;
declare const Assertions$5_defaultValidator: typeof defaultValidator;
declare const Assertions$5_disabledValidator: typeof disabledValidator;
declare const Assertions$5_emojiValidator: typeof emojiValidator;
declare const Assertions$5_idValidator: typeof idValidator;
declare const Assertions$5_jsonOptionValidator: typeof jsonOptionValidator;
declare const Assertions$5_labelValueDescriptionValidator: typeof labelValueDescriptionValidator;
declare const Assertions$5_minMaxValidator: typeof minMaxValidator;
declare const Assertions$5_optionValidator: typeof optionValidator;
declare const Assertions$5_optionsLengthValidator: typeof optionsLengthValidator;
declare const Assertions$5_optionsValidator: typeof optionsValidator;
declare const Assertions$5_urlValidator: typeof urlValidator;
declare const Assertions$5_validateRequiredButtonParameters: typeof validateRequiredButtonParameters;
declare const Assertions$5_validateRequiredSelectMenuOptionParameters: typeof validateRequiredSelectMenuOptionParameters;
declare const Assertions$5_validateRequiredSelectMenuParameters: typeof validateRequiredSelectMenuParameters;
declare namespace Assertions$5 {
export { Assertions$5_buttonLabelValidator as buttonLabelValidator, Assertions$5_buttonStyleValidator as buttonStyleValidator, Assertions$5_channelTypesValidator as channelTypesValidator, Assertions$5_customIdValidator as customIdValidator, Assertions$5_defaultValidator as defaultValidator, Assertions$5_disabledValidator as disabledValidator, Assertions$5_emojiValidator as emojiValidator, Assertions$5_idValidator as idValidator, Assertions$5_jsonOptionValidator as jsonOptionValidator, Assertions$5_labelValueDescriptionValidator as labelValueDescriptionValidator, Assertions$5_minMaxValidator as minMaxValidator, Assertions$5_optionValidator as optionValidator, Assertions$5_optionsLengthValidator as optionsLengthValidator, Assertions$5_optionsValidator as optionsValidator, placeholderValidator$1 as placeholderValidator, Assertions$5_urlValidator as urlValidator, Assertions$5_validateRequiredButtonParameters as validateRequiredButtonParameters, Assertions$5_validateRequiredSelectMenuOptionParameters as validateRequiredSelectMenuOptionParameters, Assertions$5_validateRequiredSelectMenuParameters as validateRequiredSelectMenuParameters };
}
/**
* Any action row component data represented as an object.
*/
type AnyAPIActionRowComponent = APIActionRowComponent<APIActionRowComponentTypes> | APIActionRowComponentTypes;
type AnyAPIActionRowComponent = APIActionRowComponent<APIComponentInActionRow> | APIComponentInActionRow | APIMessageComponent;
/**
* The base component builder that contains common symbols for all sorts of components.
*
@@ -442,6 +443,16 @@ declare abstract class ComponentBuilder<DataType extends Partial<APIBaseComponen
* @param data - The data to construct a component out of
*/
constructor(data: Partial<DataType>);
/**
* Sets the id (not the custom id) for this component.
*
* @param id - The id for this component
*/
setId(id: number): this;
/**
* Clears the id of this component, defaulting to a default incremented id.
*/
clearId(): this;
}
/**
@@ -940,10 +951,6 @@ declare class TextInputBuilder extends ComponentBuilder<APITextInputComponent> i
equals(other: APITextInputComponent | JSONEncodable<APITextInputComponent>): boolean;
}
/**
* The builders that may be used for messages.
*/
type MessageComponentBuilder = ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder;
/**
* The builders that may be used for modals.
*/
@@ -965,7 +972,7 @@ type AnyComponentBuilder = MessageActionRowComponentBuilder | ModalActionRowComp
*
* @typeParam ComponentType - The types of components this action row holds
*/
declare class ActionRowBuilder<ComponentType extends AnyComponentBuilder> extends ComponentBuilder<APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent>> {
declare class ActionRowBuilder<ComponentType extends AnyComponentBuilder> extends ComponentBuilder<APIActionRowComponent<APIComponentInMessageActionRow | APIComponentInModalActionRow>> {
/**
* The components within this action row.
*/
@@ -1004,7 +1011,7 @@ declare class ActionRowBuilder<ComponentType extends AnyComponentBuilder> extend
* .addComponents(button2, button3);
* ```
*/
constructor({ components, ...data }?: Partial<APIActionRowComponent<APIActionRowComponentTypes>>);
constructor({ components, ...data }?: Partial<APIActionRowComponent<APIComponentInActionRow>>);
/**
* Adds components to this action row.
*
@@ -1023,6 +1030,504 @@ declare class ActionRowBuilder<ComponentType extends AnyComponentBuilder> extend
toJSON(): APIActionRowComponent<ReturnType<ComponentType['toJSON']>>;
}
declare class FileBuilder extends ComponentBuilder<APIFileComponent> {
/**
* Creates a new file from API data.
*
* @param data - The API data to create this file with
* @example
* Creating a file from an API data object:
* ```ts
* const file = new FileBuilder({
* spoiler: true,
* file: {
* url: 'attachment://file.png',
* },
* });
* ```
* @example
* Creating a file using setters and API data:
* ```ts
* const file = new FileBuilder({
* file: {
* url: 'attachment://image.jpg',
* },
* })
* .setSpoiler(false);
* ```
*/
constructor(data?: Partial<APIFileComponent>);
/**
* Sets the spoiler status of this file.
*
* @param spoiler - The spoiler status to use
*/
setSpoiler(spoiler?: boolean): this;
/**
* Sets the media URL of this file.
*
* @param url - The URL to use
*/
setURL(url: string): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APIFileComponent;
}
declare class SeparatorBuilder extends ComponentBuilder<APISeparatorComponent> {
/**
* Creates a new separator from API data.
*
* @param data - The API data to create this separator with
* @example
* Creating a separator from an API data object:
* ```ts
* const separator = new SeparatorBuilder({
* spacing: SeparatorSpacingSize.Small,
* divider: true,
* });
* ```
* @example
* Creating a separator using setters and API data:
* ```ts
* const separator = new SeparatorBuilder({
* spacing: SeparatorSpacingSize.Large,
* })
* .setDivider(false);
* ```
*/
constructor(data?: Partial<APISeparatorComponent>);
/**
* Sets whether this separator should show a divider line.
*
* @param divider - Whether to show a divider line
*/
setDivider(divider?: boolean): this;
/**
* Sets the spacing of this separator.
*
* @param spacing - The spacing to use
*/
setSpacing(spacing: SeparatorSpacingSize): this;
/**
* Clears the spacing of this separator.
*/
clearSpacing(): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APISeparatorComponent;
}
declare class TextDisplayBuilder extends ComponentBuilder<APITextDisplayComponent> {
/**
* Creates a new text display from API data.
*
* @param data - The API data to create this text display with
* @example
* Creating a text display from an API data object:
* ```ts
* const textDisplay = new TextDisplayBuilder({
* content: 'some text',
* });
* ```
* @example
* Creating a text display using setters and API data:
* ```ts
* const textDisplay = new TextDisplayBuilder({
* content: 'old text',
* })
* .setContent('new text');
* ```
*/
constructor(data?: Partial<APITextDisplayComponent>);
/**
* Sets the text of this text display.
*
* @param content - The text to use
*/
setContent(content: string): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APITextDisplayComponent;
}
/**
* The builders that may be used within a container.
*/
type ContainerComponentBuilder = ActionRowBuilder<AnyComponentBuilder> | FileBuilder | MediaGalleryBuilder | SectionBuilder | SeparatorBuilder | TextDisplayBuilder;
/**
* A builder that creates API-compatible JSON data for a container.
*/
declare class ContainerBuilder extends ComponentBuilder<APIContainerComponent> {
/**
* The components within this container.
*/
readonly components: ContainerComponentBuilder[];
/**
* Creates a new container from API data.
*
* @param data - The API data to create this container with
* @example
* Creating a container from an API data object:
* ```ts
* const container = new ContainerBuilder({
* components: [
* {
* content: "Some text here",
* type: ComponentType.TextDisplay,
* },
* ],
* });
* ```
* @example
* Creating a container using setters and API data:
* ```ts
* const container = new ContainerBuilder({
* components: [
* {
* content: "# Heading",
* type: ComponentType.TextDisplay,
* },
* ],
* })
* .addComponents(separator, section);
* ```
*/
constructor({ components, ...data }?: Partial<APIContainerComponent>);
/**
* Sets the accent color of this container.
*
* @param color - The color to use
*/
setAccentColor(color?: RGBTuple | number): this;
/**
* Clears the accent color of this container.
*/
clearAccentColor(): this;
/**
* Adds action row components to this container.
*
* @param components - The action row components to add
*/
addActionRowComponents<ComponentType extends MessageActionRowComponentBuilder>(...components: RestOrArray<ActionRowBuilder<ComponentType> | APIActionRowComponent<APIComponentInMessageActionRow> | ((builder: ActionRowBuilder<ComponentType>) => ActionRowBuilder<ComponentType>)>): this;
/**
* Adds file components to this container.
*
* @param components - The file components to add
*/
addFileComponents(...components: RestOrArray<APIFileComponent | FileBuilder | ((builder: FileBuilder) => FileBuilder)>): this;
/**
* Adds media gallery components to this container.
*
* @param components - The media gallery components to add
*/
addMediaGalleryComponents(...components: RestOrArray<APIMediaGalleryComponent | MediaGalleryBuilder | ((builder: MediaGalleryBuilder) => MediaGalleryBuilder)>): this;
/**
* Adds section components to this container.
*
* @param components - The section components to add
*/
addSectionComponents(...components: RestOrArray<APISectionComponent | SectionBuilder | ((builder: SectionBuilder) => SectionBuilder)>): this;
/**
* Adds separator components to this container.
*
* @param components - The separator components to add
*/
addSeparatorComponents(...components: RestOrArray<APISeparatorComponent | SeparatorBuilder | ((builder: SeparatorBuilder) => SeparatorBuilder)>): this;
/**
* Adds text display components to this container.
*
* @param components - The text display components to add
*/
addTextDisplayComponents(...components: RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>): this;
/**
* Removes, replaces, or inserts components for this container.
*
* @param index - The index to start removing, replacing or inserting components
* @param deleteCount - The amount of components to remove
* @param components - The components to set
*/
spliceComponents(index: number, deleteCount: number, ...components: RestOrArray<APIComponentInContainer | ContainerComponentBuilder>): this;
/**
* Sets the spoiler status of this container.
*
* @param spoiler - The spoiler status to use
*/
setSpoiler(spoiler?: boolean): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APIContainerComponent;
}
declare class MediaGalleryItemBuilder implements JSONEncodable<APIMediaGalleryItem> {
/**
* The API data associated with this media gallery item.
*/
readonly data: Partial<APIMediaGalleryItem>;
/**
* Creates a new media gallery item from API data.
*
* @param data - The API data to create this media gallery item with
* @example
* Creating a media gallery item from an API data object:
* ```ts
* const item = new MediaGalleryItemBuilder({
* description: "Some text here",
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/2.png',
* },
* });
* ```
* @example
* Creating a media gallery item using setters and API data:
* ```ts
* const item = new MediaGalleryItemBuilder({
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/5.png',
* },
* })
* .setDescription("alt text");
* ```
*/
constructor(data?: Partial<APIMediaGalleryItem>);
/**
* Sets the description of this media gallery item.
*
* @param description - The description to use
*/
setDescription(description: string): this;
/**
* Clears the description of this media gallery item.
*/
clearDescription(): this;
/**
* Sets the spoiler status of this media gallery item.
*
* @param spoiler - The spoiler status to use
*/
setSpoiler(spoiler?: boolean): this;
/**
* Sets the media URL of this media gallery item.
*
* @param url - The URL to use
*/
setURL(url: string): this;
/**
* Serializes this builder to API-compatible JSON data.
*
* @remarks
* This method runs validations on the data before serializing it.
* As such, it may throw an error if the data is invalid.
*/
toJSON(): APIMediaGalleryItem;
}
/**
* A builder that creates API-compatible JSON data for a container.
*/
declare class MediaGalleryBuilder extends ComponentBuilder<APIMediaGalleryComponent> {
/**
* The components within this container.
*/
readonly items: MediaGalleryItemBuilder[];
/**
* Creates a new media gallery from API data.
*
* @param data - The API data to create this media gallery with
* @example
* Creating a media gallery from an API data object:
* ```ts
* const mediaGallery = new MediaGalleryBuilder({
* items: [
* {
* description: "Some text here",
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/2.png',
* },
* },
* ],
* });
* ```
* @example
* Creating a media gallery using setters and API data:
* ```ts
* const mediaGallery = new MediaGalleryBuilder({
* items: [
* {
* description: "alt text",
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/5.png',
* },
* },
* ],
* })
* .addItems(item2, item3);
* ```
*/
constructor({ items, ...data }?: Partial<APIMediaGalleryComponent>);
/**
* Adds items to this media gallery.
*
* @param items - The items to add
*/
addItems(...items: RestOrArray<APIMediaGalleryItem | MediaGalleryItemBuilder | ((builder: MediaGalleryItemBuilder) => MediaGalleryItemBuilder)>): this;
/**
* Removes, replaces, or inserts media gallery items for this media gallery.
*
* @param index - The index to start removing, replacing or inserting items
* @param deleteCount - The amount of items to remove
* @param items - The items to insert
*/
spliceItems(index: number, deleteCount: number, ...items: RestOrArray<APIMediaGalleryItem | MediaGalleryItemBuilder | ((builder: MediaGalleryItemBuilder) => MediaGalleryItemBuilder)>): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APIMediaGalleryComponent;
}
/**
* A builder that creates API-compatible JSON data for a section.
*/
declare class SectionBuilder extends ComponentBuilder<APISectionComponent> {
/**
* The components within this section.
*/
readonly components: ComponentBuilder[];
/**
* The accessory of this section.
*/
readonly accessory?: ButtonBuilder | ThumbnailBuilder;
/**
* Creates a new section from API data.
*
* @param data - The API data to create this section with
* @example
* Creating a section from an API data object:
* ```ts
* const section = new SectionBuilder({
* components: [
* {
* content: "Some text here",
* type: ComponentType.TextDisplay,
* },
* ],
* accessory: {
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/3.png',
* },
* }
* });
* ```
* @example
* Creating a section using setters and API data:
* ```ts
* const section = new SectionBuilder({
* components: [
* {
* content: "# Heading",
* type: ComponentType.TextDisplay,
* },
* ],
* })
* .setPrimaryButtonAccessory(button);
* ```
*/
constructor({ components, accessory, ...data }?: Partial<APISectionComponent>);
/**
* Sets the accessory of this section to a button.
*
* @param accessory - The accessory to use
*/
setButtonAccessory(accessory: APIButtonComponent | ButtonBuilder | ((builder: ButtonBuilder) => ButtonBuilder)): this;
/**
* Sets the accessory of this section to a thumbnail.
*
* @param accessory - The accessory to use
*/
setThumbnailAccessory(accessory: APIThumbnailComponent | ThumbnailBuilder | ((builder: ThumbnailBuilder) => ThumbnailBuilder)): this;
/**
* Adds text display components to this section.
*
* @param components - The text display components to add
*/
addTextDisplayComponents(...components: RestOrArray<TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>): this;
/**
* Removes, replaces, or inserts text display components for this section.
*
* @param index - The index to start removing, replacing or inserting text display components
* @param deleteCount - The amount of text display components to remove
* @param components - The text display components to insert
*/
spliceTextDisplayComponents(index: number, deleteCount: number, ...components: RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APISectionComponent;
}
declare class ThumbnailBuilder extends ComponentBuilder<APIThumbnailComponent> {
/**
* Creates a new thumbnail from API data.
*
* @param data - The API data to create this thumbnail with
* @example
* Creating a thumbnail from an API data object:
* ```ts
* const thumbnail = new ThumbnailBuilder({
* description: 'some text',
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/4.png',
* },
* });
* ```
* @example
* Creating a thumbnail using setters and API data:
* ```ts
* const thumbnail = new ThumbnailBuilder({
* media: {
* url: 'attachment://image.png',
* },
* })
* .setDescription('alt text');
* ```
*/
constructor(data?: Partial<APIThumbnailComponent>);
/**
* Sets the description of this thumbnail.
*
* @param description - The description to use
*/
setDescription(description: string): this;
/**
* Clears the description of this thumbnail.
*/
clearDescription(): this;
/**
* Sets the spoiler status of this thumbnail.
*
* @param spoiler - The spoiler status to use
*/
setSpoiler(spoiler?: boolean): this;
/**
* Sets the media URL of this thumbnail.
*
* @param url - The URL to use
*/
setURL(url: string): this;
/**
* {@inheritdoc ComponentBuilder.toJSON}
*/
toJSON(): APIThumbnailComponent;
}
/**
* The builders that may be used for messages.
*/
type MessageComponentBuilder = ActionRowBuilder<MessageActionRowComponentBuilder> | ContainerBuilder | FileBuilder | MediaGalleryBuilder | MessageActionRowComponentBuilder | SectionBuilder | SeparatorBuilder | TextDisplayBuilder | ThumbnailBuilder;
/**
* Components here are mapped to their respective builder.
*/
@@ -1059,6 +1564,34 @@ interface MappedComponentTypes {
* The channel select component type is associated with a {@link ChannelSelectMenuBuilder}.
*/
[ComponentType.ChannelSelect]: ChannelSelectMenuBuilder;
/**
* The file component type is associated with a {@link FileBuilder}.
*/
[ComponentType.File]: FileBuilder;
/**
* The separator component type is associated with a {@link SeparatorBuilder}.
*/
[ComponentType.Separator]: SeparatorBuilder;
/**
* The container component type is associated with a {@link ContainerBuilder}.
*/
[ComponentType.Container]: ContainerBuilder;
/**
* The text display component type is associated with a {@link TextDisplayBuilder}.
*/
[ComponentType.TextDisplay]: TextDisplayBuilder;
/**
* The thumbnail component type is associated with a {@link ThumbnailBuilder}.
*/
[ComponentType.Thumbnail]: ThumbnailBuilder;
/**
* The section component type is associated with a {@link SectionBuilder}.
*/
[ComponentType.Section]: SectionBuilder;
/**
* The media gallery component type is associated with a {@link MediaGalleryBuilder}.
*/
[ComponentType.MediaGallery]: MediaGalleryBuilder;
}
/**
* Factory for creating components from API data.
@@ -1076,6 +1609,7 @@ declare function createComponentBuilder<ComponentType extends keyof MappedCompon
* @param data - The API data to transform to a component class
*/
declare function createComponentBuilder<ComponentBuilder extends MessageComponentBuilder | ModalComponentBuilder>(data: ComponentBuilder): ComponentBuilder;
declare function resolveBuilder<ComponentType extends Record<PropertyKey, any>, Builder extends JSONEncodable<any>>(builder: Builder | ComponentType | ((builder: Builder) => Builder), Constructor: new (data?: ComponentType) => Builder): Builder;
declare const textInputStyleValidator: _sapphire_shapeshift.NativeEnumValidator<typeof TextInputStyle>;
declare const minLengthValidator: _sapphire_shapeshift.NumberValidator<number>;
@@ -1086,15 +1620,15 @@ declare const placeholderValidator: _sapphire_shapeshift.StringValidator<string>
declare const labelValidator: _sapphire_shapeshift.StringValidator<string>;
declare function validateRequiredParameters$3(customId?: string, style?: TextInputStyle, label?: string): void;
declare const Assertions$3_labelValidator: typeof labelValidator;
declare const Assertions$3_maxLengthValidator: typeof maxLengthValidator;
declare const Assertions$3_minLengthValidator: typeof minLengthValidator;
declare const Assertions$3_placeholderValidator: typeof placeholderValidator;
declare const Assertions$3_requiredValidator: typeof requiredValidator;
declare const Assertions$3_textInputStyleValidator: typeof textInputStyleValidator;
declare const Assertions$3_valueValidator: typeof valueValidator;
declare namespace Assertions$3 {
export { Assertions$3_labelValidator as labelValidator, Assertions$3_maxLengthValidator as maxLengthValidator, Assertions$3_minLengthValidator as minLengthValidator, Assertions$3_placeholderValidator as placeholderValidator, Assertions$3_requiredValidator as requiredValidator, Assertions$3_textInputStyleValidator as textInputStyleValidator, validateRequiredParameters$3 as validateRequiredParameters, Assertions$3_valueValidator as valueValidator };
declare const Assertions$4_labelValidator: typeof labelValidator;
declare const Assertions$4_maxLengthValidator: typeof maxLengthValidator;
declare const Assertions$4_minLengthValidator: typeof minLengthValidator;
declare const Assertions$4_placeholderValidator: typeof placeholderValidator;
declare const Assertions$4_requiredValidator: typeof requiredValidator;
declare const Assertions$4_textInputStyleValidator: typeof textInputStyleValidator;
declare const Assertions$4_valueValidator: typeof valueValidator;
declare namespace Assertions$4 {
export { Assertions$4_labelValidator as labelValidator, Assertions$4_maxLengthValidator as maxLengthValidator, Assertions$4_minLengthValidator as minLengthValidator, Assertions$4_placeholderValidator as placeholderValidator, Assertions$4_requiredValidator as requiredValidator, Assertions$4_textInputStyleValidator as textInputStyleValidator, validateRequiredParameters$3 as validateRequiredParameters, Assertions$4_valueValidator as valueValidator };
}
/**
@@ -1132,7 +1666,7 @@ declare class ModalBuilder implements JSONEncodable<APIModalInteractionResponseC
*
* @param components - The components to add
*/
addComponents(...components: RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder> | APIActionRowComponent<APIModalActionRowComponent>>): this;
addComponents(...components: RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder> | APIActionRowComponent<APIComponentInModalActionRow>>): this;
/**
* Sets components for this modal.
*
@@ -1149,10 +1683,44 @@ declare const titleValidator: _sapphire_shapeshift.StringValidator<string>;
declare const componentsValidator: _sapphire_shapeshift.ArrayValidator<[ActionRowBuilder<AnyComponentBuilder>, ...ActionRowBuilder<AnyComponentBuilder>[]], ActionRowBuilder<AnyComponentBuilder>>;
declare function validateRequiredParameters$2(customId?: string, title?: string, components?: ActionRowBuilder<ModalActionRowComponentBuilder>[]): void;
declare const Assertions$2_componentsValidator: typeof componentsValidator;
declare const Assertions$2_titleValidator: typeof titleValidator;
declare const Assertions$3_componentsValidator: typeof componentsValidator;
declare const Assertions$3_titleValidator: typeof titleValidator;
declare namespace Assertions$3 {
export { Assertions$3_componentsValidator as componentsValidator, Assertions$3_titleValidator as titleValidator, validateRequiredParameters$2 as validateRequiredParameters };
}
declare const unfurledMediaItemPredicate: _sapphire_shapeshift.ObjectValidator<{
url: string;
}, _sapphire_shapeshift.UndefinedToOptional<{
url: string;
}>>;
declare const descriptionPredicate: _sapphire_shapeshift.StringValidator<string>;
declare const filePredicate: _sapphire_shapeshift.ObjectValidator<{
url: string;
}, _sapphire_shapeshift.UndefinedToOptional<{
url: string;
}>>;
declare const spoilerPredicate: _sapphire_shapeshift.BooleanValidator<boolean>;
declare const dividerPredicate: _sapphire_shapeshift.BooleanValidator<boolean>;
declare const spacingPredicate: _sapphire_shapeshift.NativeEnumValidator<typeof SeparatorSpacingSize>;
declare const textDisplayContentPredicate: _sapphire_shapeshift.StringValidator<string>;
declare const accessoryPredicate: _sapphire_shapeshift.UnionValidator<ButtonBuilder | ThumbnailBuilder>;
declare const containerColorPredicate: _sapphire_shapeshift.UnionValidator<number | [number, number, number] | null | undefined>;
declare function assertReturnOfBuilder$1<ReturnType extends MediaGalleryItemBuilder | TextDisplayBuilder>(input: unknown, ExpectedInstanceOf: new () => ReturnType): asserts input is ReturnType;
declare function validateComponentArray<ReturnType extends ContainerComponentBuilder | MediaGalleryItemBuilder = ContainerComponentBuilder>(input: unknown, min: number, max: number, ExpectedInstanceOf?: new () => ReturnType): asserts input is ReturnType[];
declare const Assertions$2_accessoryPredicate: typeof accessoryPredicate;
declare const Assertions$2_containerColorPredicate: typeof containerColorPredicate;
declare const Assertions$2_descriptionPredicate: typeof descriptionPredicate;
declare const Assertions$2_dividerPredicate: typeof dividerPredicate;
declare const Assertions$2_filePredicate: typeof filePredicate;
declare const Assertions$2_spacingPredicate: typeof spacingPredicate;
declare const Assertions$2_spoilerPredicate: typeof spoilerPredicate;
declare const Assertions$2_textDisplayContentPredicate: typeof textDisplayContentPredicate;
declare const Assertions$2_unfurledMediaItemPredicate: typeof unfurledMediaItemPredicate;
declare const Assertions$2_validateComponentArray: typeof validateComponentArray;
declare namespace Assertions$2 {
export { Assertions$2_componentsValidator as componentsValidator, Assertions$2_titleValidator as titleValidator, validateRequiredParameters$2 as validateRequiredParameters };
export { Assertions$2_accessoryPredicate as accessoryPredicate, assertReturnOfBuilder$1 as assertReturnOfBuilder, Assertions$2_containerColorPredicate as containerColorPredicate, Assertions$2_descriptionPredicate as descriptionPredicate, Assertions$2_dividerPredicate as dividerPredicate, Assertions$2_filePredicate as filePredicate, Assertions$2_spacingPredicate as spacingPredicate, Assertions$2_spoilerPredicate as spoilerPredicate, Assertions$2_textDisplayContentPredicate as textDisplayContentPredicate, Assertions$2_unfurledMediaItemPredicate as unfurledMediaItemPredicate, Assertions$2_validateComponentArray as validateComponentArray };
}
/**
@@ -1843,7 +2411,7 @@ declare function validateDefaultPermission$1(value: unknown): asserts value is b
declare function validateRequired(required: unknown): asserts required is boolean;
declare function validateChoicesLength(amountAdding: number, choices?: APIApplicationCommandOptionChoice[]): void;
declare function assertReturnOfBuilder<ReturnType extends ApplicationCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder>(input: unknown, ExpectedInstanceOf: new () => ReturnType): asserts input is ReturnType;
declare const localizationMapPredicate: _sapphire_shapeshift.UnionValidator<_sapphire_shapeshift.UndefinedToOptional<Partial<Record<"id" | "en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "es-419" | "sv-SE" | "th" | "tr" | "uk" | "vi", string | null>>> | null | undefined>;
declare const localizationMapPredicate: _sapphire_shapeshift.UnionValidator<_sapphire_shapeshift.UndefinedToOptional<Partial<Record<Locale, string | null>>> | null | undefined>;
declare function validateLocalizationMap(value: unknown): asserts value is LocalizationMap;
declare function validateDMPermission$1(value: unknown): asserts value is boolean | null | undefined;
declare function validateDefaultMemberPermissions$1(permissions: unknown): string | null | undefined;
@@ -2040,4 +2608,4 @@ declare function isValidationEnabled(): boolean;
*/
declare const version: string;
export { ActionRowBuilder, type AnyAPIActionRowComponent, type AnyComponentBuilder, ApplicationCommandNumericOptionMinMaxValueMixin, type ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, ApplicationCommandOptionChannelTypesMixin, ApplicationCommandOptionWithAutocompleteMixin, ApplicationCommandOptionWithChoicesMixin, BaseSelectMenuBuilder, ButtonBuilder, ChannelSelectMenuBuilder, Assertions$4 as ComponentAssertions, ComponentBuilder, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, type ContextMenuCommandType, Assertions$5 as EmbedAssertions, type EmbedAuthorData, type EmbedAuthorOptions, EmbedBuilder, type EmbedFooterData, type EmbedFooterOptions, type EmbedImageData, type IconData, type MappedComponentTypes, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, type MessageComponentBuilder, type ModalActionRowComponentBuilder, Assertions$2 as ModalAssertions, ModalBuilder, type ModalComponentBuilder, type RGBTuple, type RestOrArray, RoleSelectMenuBuilder, StringSelectMenuBuilder as SelectMenuBuilder, StringSelectMenuOptionBuilder as SelectMenuOptionBuilder, SharedNameAndDescription, SharedSlashCommand, SharedSlashCommandOptions, SharedSlashCommandSubcommands, Assertions$1 as SlashCommandAssertions, SlashCommandAttachmentOption, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, type SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, type SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, Assertions$3 as TextInputAssertions, TextInputBuilder, type ToAPIApplicationCommandOptions, UserSelectMenuBuilder, createComponentBuilder, disableValidators, embedLength, enableValidators, isValidationEnabled, normalizeArray, version };
export { ActionRowBuilder, type AnyAPIActionRowComponent, type AnyComponentBuilder, ApplicationCommandNumericOptionMinMaxValueMixin, type ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, ApplicationCommandOptionChannelTypesMixin, ApplicationCommandOptionWithAutocompleteMixin, ApplicationCommandOptionWithChoicesMixin, BaseSelectMenuBuilder, ButtonBuilder, ChannelSelectMenuBuilder, Assertions$5 as ComponentAssertions, ComponentBuilder, Assertions$2 as ComponentsV2Assertions, ContainerBuilder, type ContainerComponentBuilder, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, type ContextMenuCommandType, Assertions$6 as EmbedAssertions, type EmbedAuthorData, type EmbedAuthorOptions, EmbedBuilder, type EmbedFooterData, type EmbedFooterOptions, type EmbedImageData, FileBuilder, type IconData, type MappedComponentTypes, MediaGalleryBuilder, MediaGalleryItemBuilder, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, type MessageComponentBuilder, type ModalActionRowComponentBuilder, Assertions$3 as ModalAssertions, ModalBuilder, type ModalComponentBuilder, type RGBTuple, type RestOrArray, RoleSelectMenuBuilder, SectionBuilder, StringSelectMenuBuilder as SelectMenuBuilder, StringSelectMenuOptionBuilder as SelectMenuOptionBuilder, SeparatorBuilder, SharedNameAndDescription, SharedSlashCommand, SharedSlashCommandOptions, SharedSlashCommandSubcommands, Assertions$1 as SlashCommandAssertions, SlashCommandAttachmentOption, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, type SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, type SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, TextDisplayBuilder, Assertions$4 as TextInputAssertions, TextInputBuilder, ThumbnailBuilder, type ToAPIApplicationCommandOptions, UserSelectMenuBuilder, createComponentBuilder, disableValidators, embedLength, enableValidators, isValidationEnabled, normalizeArray, resolveBuilder, version };

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@discordjs/builders",
"version": "1.9.0",
"version": "1.11.2",
"description": "A set of builders that you can use when creating your bot",
"exports": {
".": {
@@ -54,12 +54,12 @@
"funding": "https://github.com/discordjs/discord.js?sponsor",
"dependencies": {
"@sapphire/shapeshift": "^4.0.0",
"discord-api-types": "0.37.97",
"discord-api-types": "^0.38.1",
"fast-deep-equal": "^3.1.3",
"ts-mixer": "^6.0.4",
"tslib": "^2.6.3",
"@discordjs/util": "^1.1.1",
"@discordjs/formatters": "^0.5.0"
"@discordjs/formatters": "^0.6.1",
"@discordjs/util": "^1.1.1"
},
"devDependencies": {
"@favware/cliff-jumper": "^4.1.0",
@@ -79,7 +79,7 @@
"@discordjs/scripts": "^0.1.0"
},
"engines": {
"node": ">=18"
"node": ">=16.11.0"
},
"publishConfig": {
"access": "public",

View File

@@ -23,7 +23,7 @@
## Installation
**Node.js 18 or newer is required.**
**Node.js 16.11.0 or newer is required.**
```sh
npm install @discordjs/formatters

View File

@@ -402,7 +402,7 @@ var GuildNavigationMentions = /* @__PURE__ */ ((GuildNavigationMentions2) => {
})(GuildNavigationMentions || {});
// src/index.ts
var version = "0.5.0";
var version = "0.6.1";
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Faces,

File diff suppressed because one or more lines are too long

View File

@@ -336,7 +336,7 @@ var GuildNavigationMentions = /* @__PURE__ */ ((GuildNavigationMentions2) => {
})(GuildNavigationMentions || {});
// src/index.ts
var version = "0.5.0";
var version = "0.6.1";
export {
Faces,
GuildNavigationMentions,

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@discordjs/formatters",
"version": "0.5.0",
"version": "0.6.1",
"description": "A set of functions to format strings for Discord.",
"exports": {
".": {
@@ -44,7 +44,7 @@
"homepage": "https://discord.js.org",
"funding": "https://github.com/discordjs/discord.js?sponsor",
"dependencies": {
"discord-api-types": "0.37.97"
"discord-api-types": "^0.38.1"
},
"devDependencies": {
"@favware/cliff-jumper": "^4.1.0",
@@ -64,7 +64,7 @@
"@discordjs/scripts": "^0.1.0"
},
"engines": {
"node": ">=18"
"node": ">=16.11.0"
},
"publishConfig": {
"access": "public",

View File

@@ -9,6 +9,7 @@
<a href="https://www.npmjs.com/package/@discordjs/rest"><img src="https://img.shields.io/npm/v/@discordjs/rest.svg?maxAge=3600" alt="npm version" /></a>
<a href="https://www.npmjs.com/package/@discordjs/rest"><img src="https://img.shields.io/npm/dt/@discordjs/rest.svg?maxAge=3600" alt="npm downloads" /></a>
<a href="https://github.com/discordjs/discord.js/actions"><img src="https://github.com/discordjs/discord.js/actions/workflows/test.yml/badge.svg" alt="Tests status" /></a>
<a href="https://github.com/discordjs/discord.js/commits/main/packages/rest" ><img alt="Last commit." src="https://img.shields.io/github/last-commit/discordjs/discord.js?logo=github&logoColor=ffffff&path=packages%2Frest"></a>
<a href="https://codecov.io/gh/discordjs/discord.js" ><img src="https://codecov.io/gh/discordjs/discord.js/branch/main/graph/badge.svg?precision=2&flag=rest" alt="Code coverage" /></a>
</p>
<p>

View File

@@ -1,5 +1,6 @@
import * as url from 'url';
import { Snowflake } from 'discord-api-types/v10';
import { ImageSize, Snowflake } from 'discord-api-types/v10';
export { ImageSize } from 'discord-api-types/v10';
import { Readable } from 'node:stream';
import { ReadableStream } from 'node:stream/web';
import { Collection } from '@discordjs/collection';
@@ -430,10 +431,9 @@ declare enum RESTEvents {
}
declare const ALLOWED_EXTENSIONS: readonly ["webp", "png", "jpg", "jpeg", "gif"];
declare const ALLOWED_STICKER_EXTENSIONS: readonly ["png", "json", "gif"];
declare const ALLOWED_SIZES: readonly [16, 32, 64, 128, 256, 512, 1024, 2048, 4096];
declare const ALLOWED_SIZES: readonly number[];
type ImageExtension = (typeof ALLOWED_EXTENSIONS)[number];
type StickerExtension = (typeof ALLOWED_STICKER_EXTENSIONS)[number];
type ImageSize = (typeof ALLOWED_SIZES)[number];
declare const OverwrittenMimeTypes: {
readonly 'image/apng': "image/png";
};
@@ -663,6 +663,12 @@ declare class CDN {
* @param options - Optional options for the cover image
*/
guildScheduledEventCover(scheduledEventId: string, coverHash: string, options?: Readonly<BaseImageURLOptions>): string;
/**
* Generates a URL for a soundboard sound.
*
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId: string): string;
/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
*
@@ -923,4 +929,4 @@ declare function calculateUserDefaultAvatarIndex(userId: Snowflake): number;
*/
declare const version: string;
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageSize, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };

View File

@@ -1,5 +1,6 @@
import * as url from 'url';
import { Snowflake } from 'discord-api-types/v10';
import { ImageSize, Snowflake } from 'discord-api-types/v10';
export { ImageSize } from 'discord-api-types/v10';
import { Readable } from 'node:stream';
import { ReadableStream } from 'node:stream/web';
import { Collection } from '@discordjs/collection';
@@ -430,10 +431,9 @@ declare enum RESTEvents {
}
declare const ALLOWED_EXTENSIONS: readonly ["webp", "png", "jpg", "jpeg", "gif"];
declare const ALLOWED_STICKER_EXTENSIONS: readonly ["png", "json", "gif"];
declare const ALLOWED_SIZES: readonly [16, 32, 64, 128, 256, 512, 1024, 2048, 4096];
declare const ALLOWED_SIZES: readonly number[];
type ImageExtension = (typeof ALLOWED_EXTENSIONS)[number];
type StickerExtension = (typeof ALLOWED_STICKER_EXTENSIONS)[number];
type ImageSize = (typeof ALLOWED_SIZES)[number];
declare const OverwrittenMimeTypes: {
readonly 'image/apng': "image/png";
};
@@ -663,6 +663,12 @@ declare class CDN {
* @param options - Optional options for the cover image
*/
guildScheduledEventCover(scheduledEventId: string, coverHash: string, options?: Readonly<BaseImageURLOptions>): string;
/**
* Generates a URL for a soundboard sound.
*
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId: string): string;
/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
*
@@ -923,4 +929,4 @@ declare function calculateUserDefaultAvatarIndex(userId: Snowflake): number;
*/
declare const version: string;
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageSize, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };

View File

@@ -121,10 +121,13 @@ async function resolveBody(body) {
}
__name(resolveBody, "resolveBody");
// src/lib/CDN.ts
var import_v102 = require("discord-api-types/v10");
// src/lib/utils/constants.ts
var import_util = require("@discordjs/util");
var import_v10 = require("discord-api-types/v10");
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.4.0)`;
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.5.1)`;
var DefaultUserAgentAppendix = (0, import_util.getUserAgentAppendix)();
var DefaultRestOptions = {
agent: null,
@@ -162,7 +165,17 @@ var RESTEvents = /* @__PURE__ */ ((RESTEvents2) => {
})(RESTEvents || {});
var ALLOWED_EXTENSIONS = ["webp", "png", "jpg", "jpeg", "gif"];
var ALLOWED_STICKER_EXTENSIONS = ["png", "json", "gif"];
var ALLOWED_SIZES = [16, 32, 64, 128, 256, 512, 1024, 2048, 4096];
var ALLOWED_SIZES = [
16,
32,
64,
128,
256,
512,
1024,
2048,
4096
];
var OverwrittenMimeTypes = {
// https://github.com/discordjs/discord.js/issues/8557
"image/apng": "image/png"
@@ -445,7 +458,7 @@ var CDN = class {
* @param options - Optional options for the banner
*/
guildMemberBanner(guildId, userId, bannerHash, options) {
return this.dynamicMakeURL(`/guilds/${guildId}/users/${userId}/banner`, bannerHash, options);
return this.dynamicMakeURL(`/guilds/${guildId}/users/${userId}/banners/${bannerHash}`, bannerHash, options);
}
/**
* Generates an icon URL, e.g. for a guild.
@@ -522,6 +535,14 @@ var CDN = class {
guildScheduledEventCover(scheduledEventId, coverHash, options) {
return this.makeURL(`/guild-events/${scheduledEventId}/${coverHash}`, options);
}
/**
* Generates a URL for a soundboard sound.
*
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId) {
return `${this.cdn}${import_v102.CDNRoutes.soundboardSound(soundId)}`;
}
/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
*
@@ -1448,7 +1469,7 @@ var REST = class _REST extends import_async_event_emitter.AsyncEventEmitter {
};
// src/shared.ts
var version = "2.4.0";
var version = "2.5.1";
// src/index.ts
globalThis.FormData ??= import_undici2.FormData;

File diff suppressed because one or more lines are too long

View File

@@ -80,10 +80,13 @@ async function resolveBody(body) {
}
__name(resolveBody, "resolveBody");
// src/lib/CDN.ts
import { CDNRoutes } from "discord-api-types/v10";
// src/lib/utils/constants.ts
import { getUserAgentAppendix } from "@discordjs/util";
import { APIVersion } from "discord-api-types/v10";
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.4.0)`;
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.5.1)`;
var DefaultUserAgentAppendix = getUserAgentAppendix();
var DefaultRestOptions = {
agent: null,
@@ -121,7 +124,17 @@ var RESTEvents = /* @__PURE__ */ ((RESTEvents2) => {
})(RESTEvents || {});
var ALLOWED_EXTENSIONS = ["webp", "png", "jpg", "jpeg", "gif"];
var ALLOWED_STICKER_EXTENSIONS = ["png", "json", "gif"];
var ALLOWED_SIZES = [16, 32, 64, 128, 256, 512, 1024, 2048, 4096];
var ALLOWED_SIZES = [
16,
32,
64,
128,
256,
512,
1024,
2048,
4096
];
var OverwrittenMimeTypes = {
// https://github.com/discordjs/discord.js/issues/8557
"image/apng": "image/png"
@@ -404,7 +417,7 @@ var CDN = class {
* @param options - Optional options for the banner
*/
guildMemberBanner(guildId, userId, bannerHash, options) {
return this.dynamicMakeURL(`/guilds/${guildId}/users/${userId}/banner`, bannerHash, options);
return this.dynamicMakeURL(`/guilds/${guildId}/users/${userId}/banners/${bannerHash}`, bannerHash, options);
}
/**
* Generates an icon URL, e.g. for a guild.
@@ -481,6 +494,14 @@ var CDN = class {
guildScheduledEventCover(scheduledEventId, coverHash, options) {
return this.makeURL(`/guild-events/${scheduledEventId}/${coverHash}`, options);
}
/**
* Generates a URL for a soundboard sound.
*
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId) {
return `${this.cdn}${CDNRoutes.soundboardSound(soundId)}`;
}
/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
*
@@ -1407,7 +1428,7 @@ var REST = class _REST extends AsyncEventEmitter {
};
// src/shared.ts
var version = "2.4.0";
var version = "2.5.1";
// src/index.ts
globalThis.FormData ??= FormData2;

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,6 @@
import * as url from 'url';
import { Snowflake } from 'discord-api-types/v10';
import { ImageSize, Snowflake } from 'discord-api-types/v10';
export { ImageSize } from 'discord-api-types/v10';
import { Readable } from 'node:stream';
import { ReadableStream } from 'node:stream/web';
import { Collection } from '@discordjs/collection';
@@ -430,10 +431,9 @@ declare enum RESTEvents {
}
declare const ALLOWED_EXTENSIONS: readonly ["webp", "png", "jpg", "jpeg", "gif"];
declare const ALLOWED_STICKER_EXTENSIONS: readonly ["png", "json", "gif"];
declare const ALLOWED_SIZES: readonly [16, 32, 64, 128, 256, 512, 1024, 2048, 4096];
declare const ALLOWED_SIZES: readonly number[];
type ImageExtension = (typeof ALLOWED_EXTENSIONS)[number];
type StickerExtension = (typeof ALLOWED_STICKER_EXTENSIONS)[number];
type ImageSize = (typeof ALLOWED_SIZES)[number];
declare const OverwrittenMimeTypes: {
readonly 'image/apng': "image/png";
};
@@ -663,6 +663,12 @@ declare class CDN {
* @param options - Optional options for the cover image
*/
guildScheduledEventCover(scheduledEventId: string, coverHash: string, options?: Readonly<BaseImageURLOptions>): string;
/**
* Generates a URL for a soundboard sound.
*
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId: string): string;
/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
*
@@ -923,4 +929,4 @@ declare function calculateUserDefaultAvatarIndex(userId: Snowflake): number;
*/
declare const version: string;
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageSize, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };

View File

@@ -1,5 +1,6 @@
import * as url from 'url';
import { Snowflake } from 'discord-api-types/v10';
import { ImageSize, Snowflake } from 'discord-api-types/v10';
export { ImageSize } from 'discord-api-types/v10';
import { Readable } from 'node:stream';
import { ReadableStream } from 'node:stream/web';
import { Collection } from '@discordjs/collection';
@@ -430,10 +431,9 @@ declare enum RESTEvents {
}
declare const ALLOWED_EXTENSIONS: readonly ["webp", "png", "jpg", "jpeg", "gif"];
declare const ALLOWED_STICKER_EXTENSIONS: readonly ["png", "json", "gif"];
declare const ALLOWED_SIZES: readonly [16, 32, 64, 128, 256, 512, 1024, 2048, 4096];
declare const ALLOWED_SIZES: readonly number[];
type ImageExtension = (typeof ALLOWED_EXTENSIONS)[number];
type StickerExtension = (typeof ALLOWED_STICKER_EXTENSIONS)[number];
type ImageSize = (typeof ALLOWED_SIZES)[number];
declare const OverwrittenMimeTypes: {
readonly 'image/apng': "image/png";
};
@@ -663,6 +663,12 @@ declare class CDN {
* @param options - Optional options for the cover image
*/
guildScheduledEventCover(scheduledEventId: string, coverHash: string, options?: Readonly<BaseImageURLOptions>): string;
/**
* Generates a URL for a soundboard sound.
*
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId: string): string;
/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
*
@@ -923,4 +929,4 @@ declare function calculateUserDefaultAvatarIndex(userId: Snowflake): number;
*/
declare const version: string;
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageSize, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };

View File

@@ -55,10 +55,13 @@ function getDefaultStrategy() {
}
__name(getDefaultStrategy, "getDefaultStrategy");
// src/lib/CDN.ts
var import_v102 = require("discord-api-types/v10");
// src/lib/utils/constants.ts
var import_util = require("@discordjs/util");
var import_v10 = require("discord-api-types/v10");
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.4.0)`;
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.5.1)`;
var DefaultUserAgentAppendix = (0, import_util.getUserAgentAppendix)();
var DefaultRestOptions = {
agent: null,
@@ -96,7 +99,17 @@ var RESTEvents = /* @__PURE__ */ ((RESTEvents2) => {
})(RESTEvents || {});
var ALLOWED_EXTENSIONS = ["webp", "png", "jpg", "jpeg", "gif"];
var ALLOWED_STICKER_EXTENSIONS = ["png", "json", "gif"];
var ALLOWED_SIZES = [16, 32, 64, 128, 256, 512, 1024, 2048, 4096];
var ALLOWED_SIZES = [
16,
32,
64,
128,
256,
512,
1024,
2048,
4096
];
var OverwrittenMimeTypes = {
// https://github.com/discordjs/discord.js/issues/8557
"image/apng": "image/png"
@@ -379,7 +392,7 @@ var CDN = class {
* @param options - Optional options for the banner
*/
guildMemberBanner(guildId, userId, bannerHash, options) {
return this.dynamicMakeURL(`/guilds/${guildId}/users/${userId}/banner`, bannerHash, options);
return this.dynamicMakeURL(`/guilds/${guildId}/users/${userId}/banners/${bannerHash}`, bannerHash, options);
}
/**
* Generates an icon URL, e.g. for a guild.
@@ -456,6 +469,14 @@ var CDN = class {
guildScheduledEventCover(scheduledEventId, coverHash, options) {
return this.makeURL(`/guild-events/${scheduledEventId}/${coverHash}`, options);
}
/**
* Generates a URL for a soundboard sound.
*
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId) {
return `${this.cdn}${import_v102.CDNRoutes.soundboardSound(soundId)}`;
}
/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
*
@@ -1382,7 +1403,7 @@ var REST = class _REST extends import_async_event_emitter.AsyncEventEmitter {
};
// src/shared.ts
var version = "2.4.0";
var version = "2.5.1";
// src/web.ts
setDefaultStrategy(fetch);

File diff suppressed because one or more lines are too long

View File

@@ -12,10 +12,13 @@ function getDefaultStrategy() {
}
__name(getDefaultStrategy, "getDefaultStrategy");
// src/lib/CDN.ts
import { CDNRoutes } from "discord-api-types/v10";
// src/lib/utils/constants.ts
import { getUserAgentAppendix } from "@discordjs/util";
import { APIVersion } from "discord-api-types/v10";
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.4.0)`;
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.5.1)`;
var DefaultUserAgentAppendix = getUserAgentAppendix();
var DefaultRestOptions = {
agent: null,
@@ -53,7 +56,17 @@ var RESTEvents = /* @__PURE__ */ ((RESTEvents2) => {
})(RESTEvents || {});
var ALLOWED_EXTENSIONS = ["webp", "png", "jpg", "jpeg", "gif"];
var ALLOWED_STICKER_EXTENSIONS = ["png", "json", "gif"];
var ALLOWED_SIZES = [16, 32, 64, 128, 256, 512, 1024, 2048, 4096];
var ALLOWED_SIZES = [
16,
32,
64,
128,
256,
512,
1024,
2048,
4096
];
var OverwrittenMimeTypes = {
// https://github.com/discordjs/discord.js/issues/8557
"image/apng": "image/png"
@@ -336,7 +349,7 @@ var CDN = class {
* @param options - Optional options for the banner
*/
guildMemberBanner(guildId, userId, bannerHash, options) {
return this.dynamicMakeURL(`/guilds/${guildId}/users/${userId}/banner`, bannerHash, options);
return this.dynamicMakeURL(`/guilds/${guildId}/users/${userId}/banners/${bannerHash}`, bannerHash, options);
}
/**
* Generates an icon URL, e.g. for a guild.
@@ -413,6 +426,14 @@ var CDN = class {
guildScheduledEventCover(scheduledEventId, coverHash, options) {
return this.makeURL(`/guild-events/${scheduledEventId}/${coverHash}`, options);
}
/**
* Generates a URL for a soundboard sound.
*
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId) {
return `${this.cdn}${CDNRoutes.soundboardSound(soundId)}`;
}
/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
*
@@ -1339,7 +1360,7 @@ var REST = class _REST extends AsyncEventEmitter {
};
// src/shared.ts
var version = "2.4.0";
var version = "2.5.1";
// src/web.ts
setDefaultStrategy(fetch);

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@discordjs/rest",
"version": "2.4.0",
"version": "2.5.1",
"description": "The REST API for discord.js",
"exports": {
".": {
@@ -74,10 +74,10 @@
"@sapphire/async-queue": "^1.5.3",
"@sapphire/snowflake": "^3.5.3",
"@vladfrangu/async_event_emitter": "^2.4.6",
"discord-api-types": "0.37.97",
"discord-api-types": "^0.38.1",
"magic-bytes.js": "^1.10.0",
"tslib": "^2.6.3",
"undici": "6.19.8",
"undici": "6.21.3",
"@discordjs/collection": "^2.1.1",
"@discordjs/util": "^1.1.1"
},
@@ -95,8 +95,8 @@
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"vitest": "^2.0.5",
"@discordjs/api-extractor": "^7.38.1",
"@discordjs/scripts": "^0.1.0"
"@discordjs/scripts": "^0.1.0",
"@discordjs/api-extractor": "^7.38.1"
},
"engines": {
"node": ">=18"

View File

@@ -280,7 +280,7 @@ var SimpleIdentifyThrottler = class {
await state.queue.wait({ signal });
try {
const diff = state.resetsAt - Date.now();
if (diff <= 5e3) {
if (diff > 0 && diff <= 5e3) {
const time = diff + Math.random() * 1500;
await (0, import_promises.setTimeout)(time);
}
@@ -299,7 +299,7 @@ var DefaultWebSocketManagerOptions = {
const info = await manager.fetchGatewayInformation();
return new SimpleIdentifyThrottler(info.session_start_limit.max_concurrency);
},
buildStrategy: (manager) => new SimpleShardingStrategy(manager),
buildStrategy: /* @__PURE__ */ __name((manager) => new SimpleShardingStrategy(manager), "buildStrategy"),
shardCount: null,
shardIds: null,
largeThreshold: null,
@@ -340,6 +340,7 @@ function getInitialSendRateLimitState() {
};
}
__name(getInitialSendRateLimitState, "getInitialSendRateLimitState");
var KnownNetworkErrorCodes = /* @__PURE__ */ new Set(["ECONNRESET", "ECONNREFUSED", "ETIMEDOUT", "EAI_AGAIN"]);
// src/ws/WebSocketShard.ts
var getZlibSync = (0, import_util2.lazy)(async () => import("zlib-sync").then((mod) => mod.default).catch(() => null));
@@ -376,7 +377,7 @@ var WebSocketShard = class extends import_async_event_emitter.AsyncEventEmitter
lastHeartbeatAt = -1;
// Indicates whether the shard has already resolved its original connect() call
initialConnectResolved = false;
// Indicates if we failed to connect to the ws url (ECONNREFUSED/ECONNRESET)
// Indicates if we failed to connect to the ws url
failedToConnectDueToNetworkError = false;
sendQueue = new import_async_queue2.AsyncQueue();
timeoutAbortControllers = new import_collection6.Collection();
@@ -824,7 +825,7 @@ var WebSocketShard = class extends import_async_event_emitter.AsyncEventEmitter
}
}
onError(error) {
if ("code" in error && ["ECONNRESET", "ECONNREFUSED"].includes(error.code)) {
if ("code" in error && KnownNetworkErrorCodes.has(error.code)) {
this.debug(["Failed to connect to the gateway URL specified due to a network error"]);
this.failedToConnectDueToNetworkError = true;
return;
@@ -924,9 +925,7 @@ var WebSocketShard = class extends import_async_event_emitter.AsyncEventEmitter
}
}
debug(messages) {
const message = `${messages[0]}${messages.length > 1 ? `
${messages.slice(1).map((m) => ` ${m}`).join("\n")}` : ""}`;
this.emit("debug" /* Debug */, { message });
this.emit("debug" /* Debug */, { message: messages.join("\n ") });
}
};

File diff suppressed because one or more lines are too long

View File

@@ -262,7 +262,7 @@ var SimpleIdentifyThrottler = class {
await state.queue.wait({ signal });
try {
const diff = state.resetsAt - Date.now();
if (diff <= 5e3) {
if (diff > 0 && diff <= 5e3) {
const time = diff + Math.random() * 1500;
await sleep(time);
}
@@ -281,7 +281,7 @@ var DefaultWebSocketManagerOptions = {
const info = await manager.fetchGatewayInformation();
return new SimpleIdentifyThrottler(info.session_start_limit.max_concurrency);
},
buildStrategy: (manager) => new SimpleShardingStrategy(manager),
buildStrategy: /* @__PURE__ */ __name((manager) => new SimpleShardingStrategy(manager), "buildStrategy"),
shardCount: null,
shardIds: null,
largeThreshold: null,
@@ -322,6 +322,7 @@ function getInitialSendRateLimitState() {
};
}
__name(getInitialSendRateLimitState, "getInitialSendRateLimitState");
var KnownNetworkErrorCodes = /* @__PURE__ */ new Set(["ECONNRESET", "ECONNREFUSED", "ETIMEDOUT", "EAI_AGAIN"]);
// src/ws/WebSocketShard.ts
var getZlibSync = lazy2(async () => import("zlib-sync").then((mod) => mod.default).catch(() => null));
@@ -358,7 +359,7 @@ var WebSocketShard = class extends AsyncEventEmitter {
lastHeartbeatAt = -1;
// Indicates whether the shard has already resolved its original connect() call
initialConnectResolved = false;
// Indicates if we failed to connect to the ws url (ECONNREFUSED/ECONNRESET)
// Indicates if we failed to connect to the ws url
failedToConnectDueToNetworkError = false;
sendQueue = new AsyncQueue2();
timeoutAbortControllers = new Collection6();
@@ -806,7 +807,7 @@ var WebSocketShard = class extends AsyncEventEmitter {
}
}
onError(error) {
if ("code" in error && ["ECONNRESET", "ECONNREFUSED"].includes(error.code)) {
if ("code" in error && KnownNetworkErrorCodes.has(error.code)) {
this.debug(["Failed to connect to the gateway URL specified due to a network error"]);
this.failedToConnectDueToNetworkError = true;
return;
@@ -906,9 +907,7 @@ var WebSocketShard = class extends AsyncEventEmitter {
}
}
debug(messages) {
const message = `${messages[0]}${messages.length > 1 ? `
${messages.slice(1).map((m) => ` ${m}`).join("\n")}` : ""}`;
this.emit("debug" /* Debug */, { message });
this.emit("debug" /* Debug */, { message: messages.join("\n ") });
}
};

File diff suppressed because one or more lines are too long

View File

@@ -225,6 +225,7 @@ declare const DefaultWebSocketManagerOptions: {
};
declare const ImportantGatewayOpcodes: Set<GatewayOpcodes>;
declare function getInitialSendRateLimitState(): SendRateLimitState;
declare const KnownNetworkErrorCodes: Set<string>;
/**
* Represents a range of shard ids
@@ -701,4 +702,4 @@ declare class WorkerBootstrapper {
*/
declare const version: string;
export { type BootstrapOptions, CloseCodes, CompressionMethod, type CreateWebSocketManagerOptions, DefaultDeviceProperty, DefaultWebSocketManagerOptions, Encoding, type FetchingStrategyOptions, type IContextFetchingStrategy, type IIdentifyThrottler, type IShardingStrategy, type IdentifyState, ImportantGatewayOpcodes, type ManagerShardEventsMap, type OptionalWebSocketManagerOptions, type RequiredWebSocketManagerOptions, type SendRateLimitState, type SessionInfo, type ShardRange, SimpleContextFetchingStrategy, SimpleIdentifyThrottler, SimpleShardingStrategy, WebSocketManager, type WebSocketManagerOptions, WebSocketShard, type WebSocketShardDestroyOptions, WebSocketShardDestroyRecovery, WebSocketShardEvents, type WebSocketShardEventsMap, WebSocketShardStatus, WorkerBootstrapper, WorkerContextFetchingStrategy, type WorkerData, type WorkerReceivePayload, WorkerReceivePayloadOp, type WorkerSendPayload, WorkerSendPayloadOp, WorkerShardingStrategy, type WorkerShardingStrategyOptions, getInitialSendRateLimitState, managerToFetchingStrategyOptions, version };
export { type BootstrapOptions, CloseCodes, CompressionMethod, type CreateWebSocketManagerOptions, DefaultDeviceProperty, DefaultWebSocketManagerOptions, Encoding, type FetchingStrategyOptions, type IContextFetchingStrategy, type IIdentifyThrottler, type IShardingStrategy, type IdentifyState, ImportantGatewayOpcodes, KnownNetworkErrorCodes, type ManagerShardEventsMap, type OptionalWebSocketManagerOptions, type RequiredWebSocketManagerOptions, type SendRateLimitState, type SessionInfo, type ShardRange, SimpleContextFetchingStrategy, SimpleIdentifyThrottler, SimpleShardingStrategy, WebSocketManager, type WebSocketManagerOptions, WebSocketShard, type WebSocketShardDestroyOptions, WebSocketShardDestroyRecovery, WebSocketShardEvents, type WebSocketShardEventsMap, WebSocketShardStatus, WorkerBootstrapper, WorkerContextFetchingStrategy, type WorkerData, type WorkerReceivePayload, WorkerReceivePayloadOp, type WorkerSendPayload, WorkerSendPayloadOp, WorkerShardingStrategy, type WorkerShardingStrategyOptions, getInitialSendRateLimitState, managerToFetchingStrategyOptions, version };

View File

@@ -225,6 +225,7 @@ declare const DefaultWebSocketManagerOptions: {
};
declare const ImportantGatewayOpcodes: Set<GatewayOpcodes>;
declare function getInitialSendRateLimitState(): SendRateLimitState;
declare const KnownNetworkErrorCodes: Set<string>;
/**
* Represents a range of shard ids
@@ -701,4 +702,4 @@ declare class WorkerBootstrapper {
*/
declare const version: string;
export { type BootstrapOptions, CloseCodes, CompressionMethod, type CreateWebSocketManagerOptions, DefaultDeviceProperty, DefaultWebSocketManagerOptions, Encoding, type FetchingStrategyOptions, type IContextFetchingStrategy, type IIdentifyThrottler, type IShardingStrategy, type IdentifyState, ImportantGatewayOpcodes, type ManagerShardEventsMap, type OptionalWebSocketManagerOptions, type RequiredWebSocketManagerOptions, type SendRateLimitState, type SessionInfo, type ShardRange, SimpleContextFetchingStrategy, SimpleIdentifyThrottler, SimpleShardingStrategy, WebSocketManager, type WebSocketManagerOptions, WebSocketShard, type WebSocketShardDestroyOptions, WebSocketShardDestroyRecovery, WebSocketShardEvents, type WebSocketShardEventsMap, WebSocketShardStatus, WorkerBootstrapper, WorkerContextFetchingStrategy, type WorkerData, type WorkerReceivePayload, WorkerReceivePayloadOp, type WorkerSendPayload, WorkerSendPayloadOp, WorkerShardingStrategy, type WorkerShardingStrategyOptions, getInitialSendRateLimitState, managerToFetchingStrategyOptions, version };
export { type BootstrapOptions, CloseCodes, CompressionMethod, type CreateWebSocketManagerOptions, DefaultDeviceProperty, DefaultWebSocketManagerOptions, Encoding, type FetchingStrategyOptions, type IContextFetchingStrategy, type IIdentifyThrottler, type IShardingStrategy, type IdentifyState, ImportantGatewayOpcodes, KnownNetworkErrorCodes, type ManagerShardEventsMap, type OptionalWebSocketManagerOptions, type RequiredWebSocketManagerOptions, type SendRateLimitState, type SessionInfo, type ShardRange, SimpleContextFetchingStrategy, SimpleIdentifyThrottler, SimpleShardingStrategy, WebSocketManager, type WebSocketManagerOptions, WebSocketShard, type WebSocketShardDestroyOptions, WebSocketShardDestroyRecovery, WebSocketShardEvents, type WebSocketShardEventsMap, WebSocketShardStatus, WorkerBootstrapper, WorkerContextFetchingStrategy, type WorkerData, type WorkerReceivePayload, WorkerReceivePayloadOp, type WorkerSendPayload, WorkerSendPayloadOp, WorkerShardingStrategy, type WorkerShardingStrategyOptions, getInitialSendRateLimitState, managerToFetchingStrategyOptions, version };

View File

@@ -37,6 +37,7 @@ __export(src_exports, {
DefaultWebSocketManagerOptions: () => DefaultWebSocketManagerOptions,
Encoding: () => Encoding,
ImportantGatewayOpcodes: () => ImportantGatewayOpcodes,
KnownNetworkErrorCodes: () => KnownNetworkErrorCodes,
SimpleContextFetchingStrategy: () => SimpleContextFetchingStrategy,
SimpleIdentifyThrottler: () => SimpleIdentifyThrottler,
SimpleShardingStrategy: () => SimpleShardingStrategy,
@@ -498,7 +499,7 @@ var SimpleIdentifyThrottler = class {
await state.queue.wait({ signal });
try {
const diff = state.resetsAt - Date.now();
if (diff <= 5e3) {
if (diff > 0 && diff <= 5e3) {
const time = diff + Math.random() * 1500;
await (0, import_promises.setTimeout)(time);
}
@@ -518,14 +519,14 @@ var CompressionMethod = /* @__PURE__ */ ((CompressionMethod2) => {
CompressionMethod2["ZlibStream"] = "zlib-stream";
return CompressionMethod2;
})(CompressionMethod || {});
var DefaultDeviceProperty = `@discordjs/ws 1.1.1`;
var DefaultDeviceProperty = `@discordjs/ws 1.2.3`;
var getDefaultSessionStore = (0, import_util.lazy)(() => new import_collection4.Collection());
var DefaultWebSocketManagerOptions = {
async buildIdentifyThrottler(manager) {
const info = await manager.fetchGatewayInformation();
return new SimpleIdentifyThrottler(info.session_start_limit.max_concurrency);
},
buildStrategy: (manager) => new SimpleShardingStrategy(manager),
buildStrategy: /* @__PURE__ */ __name((manager) => new SimpleShardingStrategy(manager), "buildStrategy"),
shardCount: null,
shardIds: null,
largeThreshold: null,
@@ -566,6 +567,7 @@ function getInitialSendRateLimitState() {
};
}
__name(getInitialSendRateLimitState, "getInitialSendRateLimitState");
var KnownNetworkErrorCodes = /* @__PURE__ */ new Set(["ECONNRESET", "ECONNREFUSED", "ETIMEDOUT", "EAI_AGAIN"]);
// src/ws/WebSocketShard.ts
var getZlibSync = (0, import_util2.lazy)(async () => import("zlib-sync").then((mod) => mod.default).catch(() => null));
@@ -614,7 +616,7 @@ var WebSocketShard = class extends import_async_event_emitter.AsyncEventEmitter
lastHeartbeatAt = -1;
// Indicates whether the shard has already resolved its original connect() call
initialConnectResolved = false;
// Indicates if we failed to connect to the ws url (ECONNREFUSED/ECONNRESET)
// Indicates if we failed to connect to the ws url
failedToConnectDueToNetworkError = false;
sendQueue = new import_async_queue2.AsyncQueue();
timeoutAbortControllers = new import_collection5.Collection();
@@ -1062,7 +1064,7 @@ var WebSocketShard = class extends import_async_event_emitter.AsyncEventEmitter
}
}
onError(error) {
if ("code" in error && ["ECONNRESET", "ECONNREFUSED"].includes(error.code)) {
if ("code" in error && KnownNetworkErrorCodes.has(error.code)) {
this.debug(["Failed to connect to the gateway URL specified due to a network error"]);
this.failedToConnectDueToNetworkError = true;
return;
@@ -1162,9 +1164,7 @@ var WebSocketShard = class extends import_async_event_emitter.AsyncEventEmitter
}
}
debug(messages) {
const message = `${messages[0]}${messages.length > 1 ? `
${messages.slice(1).map((m) => ` ${m}`).join("\n")}` : ""}`;
this.emit("debug" /* Debug */, { message });
this.emit("debug" /* Debug */, { message: messages.join("\n ") });
}
};
@@ -1476,7 +1476,7 @@ var WebSocketManager = class extends import_async_event_emitter2.AsyncEventEmitt
};
// src/index.ts
var version = "1.1.1";
var version = "1.2.3";
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
CloseCodes,
@@ -1485,6 +1485,7 @@ var version = "1.1.1";
DefaultWebSocketManagerOptions,
Encoding,
ImportantGatewayOpcodes,
KnownNetworkErrorCodes,
SimpleContextFetchingStrategy,
SimpleIdentifyThrottler,
SimpleShardingStrategy,

File diff suppressed because one or more lines are too long

View File

@@ -3,12 +3,11 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
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');
});
// ../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.0_@types+node@18.17.9__postcss@8.4.38_ts-node@10.9.1_r3lsnbzmufwa2o72aygj6fd66q/node_modules/tsup/assets/esm_shims.js
// ../../node_modules/.pnpm/tsup@8.1.0_@microsoft+api-extractor@7.43.0_@types+node@18.17.9__postcss@8.4.38_ts-node@10.9.1_7cuiaqp5aco2ioxr7mdilx3yqy/node_modules/tsup/assets/esm_shims.js
import { fileURLToPath } from "url";
import path from "path";
var getFilename = /* @__PURE__ */ __name(() => fileURLToPath(import.meta.url), "getFilename");
@@ -461,7 +460,7 @@ var SimpleIdentifyThrottler = class {
await state.queue.wait({ signal });
try {
const diff = state.resetsAt - Date.now();
if (diff <= 5e3) {
if (diff > 0 && diff <= 5e3) {
const time = diff + Math.random() * 1500;
await sleep(time);
}
@@ -481,14 +480,14 @@ var CompressionMethod = /* @__PURE__ */ ((CompressionMethod2) => {
CompressionMethod2["ZlibStream"] = "zlib-stream";
return CompressionMethod2;
})(CompressionMethod || {});
var DefaultDeviceProperty = `@discordjs/ws 1.1.1`;
var DefaultDeviceProperty = `@discordjs/ws 1.2.3`;
var getDefaultSessionStore = lazy(() => new Collection4());
var DefaultWebSocketManagerOptions = {
async buildIdentifyThrottler(manager) {
const info = await manager.fetchGatewayInformation();
return new SimpleIdentifyThrottler(info.session_start_limit.max_concurrency);
},
buildStrategy: (manager) => new SimpleShardingStrategy(manager),
buildStrategy: /* @__PURE__ */ __name((manager) => new SimpleShardingStrategy(manager), "buildStrategy"),
shardCount: null,
shardIds: null,
largeThreshold: null,
@@ -529,6 +528,7 @@ function getInitialSendRateLimitState() {
};
}
__name(getInitialSendRateLimitState, "getInitialSendRateLimitState");
var KnownNetworkErrorCodes = /* @__PURE__ */ new Set(["ECONNRESET", "ECONNREFUSED", "ETIMEDOUT", "EAI_AGAIN"]);
// src/ws/WebSocketShard.ts
var getZlibSync = lazy2(async () => import("zlib-sync").then((mod) => mod.default).catch(() => null));
@@ -577,7 +577,7 @@ var WebSocketShard = class extends AsyncEventEmitter {
lastHeartbeatAt = -1;
// Indicates whether the shard has already resolved its original connect() call
initialConnectResolved = false;
// Indicates if we failed to connect to the ws url (ECONNREFUSED/ECONNRESET)
// Indicates if we failed to connect to the ws url
failedToConnectDueToNetworkError = false;
sendQueue = new AsyncQueue2();
timeoutAbortControllers = new Collection5();
@@ -1025,7 +1025,7 @@ var WebSocketShard = class extends AsyncEventEmitter {
}
}
onError(error) {
if ("code" in error && ["ECONNRESET", "ECONNREFUSED"].includes(error.code)) {
if ("code" in error && KnownNetworkErrorCodes.has(error.code)) {
this.debug(["Failed to connect to the gateway URL specified due to a network error"]);
this.failedToConnectDueToNetworkError = true;
return;
@@ -1125,9 +1125,7 @@ var WebSocketShard = class extends AsyncEventEmitter {
}
}
debug(messages) {
const message = `${messages[0]}${messages.length > 1 ? `
${messages.slice(1).map((m) => ` ${m}`).join("\n")}` : ""}`;
this.emit("debug" /* Debug */, { message });
this.emit("debug" /* Debug */, { message: messages.join("\n ") });
}
};
@@ -1441,7 +1439,7 @@ var WebSocketManager = class extends AsyncEventEmitter2 {
};
// src/index.ts
var version = "1.1.1";
var version = "1.2.3";
export {
CloseCodes,
CompressionMethod,
@@ -1449,6 +1447,7 @@ export {
DefaultWebSocketManagerOptions,
Encoding,
ImportantGatewayOpcodes,
KnownNetworkErrorCodes,
SimpleContextFetchingStrategy,
SimpleIdentifyThrottler,
SimpleShardingStrategy,

File diff suppressed because one or more lines are too long

View File

@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2020 vladfrangu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,105 +0,0 @@
# Discord API Types
[![discord-api-types](https://raw.githubusercontent.com/discordjs/discord-api-types/main/website/static/svgs/logo_long_blurple.svg)](https://github.com/discordjs/discord-api-types)
[![GitHub](https://img.shields.io/github/license/discordjs/discord-api-types)](https://github.com/discordjs/discord-api-types/blob/main/LICENSE.md)
[![npm](https://img.shields.io/npm/v/discord-api-types?color=crimson&logo=npm)](https://www.npmjs.com/package/discord-api-types)
[![deno](https://img.shields.io/npm/v/discord-api-types?color=blue&label=deno&logo=deno)](https://deno.land/x/discord_api_types)
[![Patreon Donate](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Donate%20with%20Patreon&logo=patreon&colorB=F96854&link=https://www.patreon.com/vladfrangu)](https://www.patreon.com/vladfrangu)
[![Ko-fi Donate](https://img.shields.io/badge/kofi-donate-brightgreen.svg?label=Donate%20with%20Ko-fi&logo=ko-fi&colorB=F16061&link=https://ko-fi.com/wolfgalvlad&logoColor=FFFFFF)](https://ko-fi.com/wolfgalvlad)
[![GitHub Sponsors](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Sponsor%20through%20GitHub&logo=github&colorB=F96854&link=https://github.com/sponsors/vladfrangu)](https://github.com/sponsors/vladfrangu)
[![Powered by Vercel](https://raw.githubusercontent.com/discordjs/discord-api-types/main/website/static/powered-by-vercel.svg)](https://vercel.com?utm_source=discordjs&utm_campaign=oss)
Simple type definitions for the [Discord API](https://discord.com/developers/docs/intro).
## Installation
Install with [npm](https://www.npmjs.com/) / [yarn](https://yarnpkg.com) / [pnpm](https://pnpm.js.org/):
```sh
npm install discord-api-types
yarn add discord-api-types
pnpm add discord-api-types
```
### Usage
You can only import this module by specifying the API version you want to target. Append `/v*` to the import path, where the `*` represents the API version. Below are some examples
```js
const { APIUser } = require('discord-api-types/v10');
```
```ts
// TypeScript/ES Module support
import { APIUser } from 'discord-api-types/v10';
```
You may also import just certain parts of the module that you need. The possible values are: `globals`, `gateway`, `gateway/v*`, `payloads`, `payloads/v*`, `rest`, `rest/v*`, `rpc`, `rpc/v*`, `utils`, `utils/v*`, `voice`, and `voice/v*`. Below are some examples
```js
const { GatewayVersion } = require('discord-api-types/gateway/v10');
```
```ts
// TypeScript/ES Module support
import { GatewayVersion } from 'discord-api-types/gateway/v10';
```
> _**Note:** The `v*` exports (`discord-api-types/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_
### Deno
We also provide typings compatible with the [deno](https://deno.land/) runtime. You have 3 ways you can import them:
1. Directly from GitHub
```ts
// Importing a specific API version
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v10.ts';
```
2. From [deno.land/x](https://deno.land/x)
```ts
// Importing a specific API version
import { APIUser } from 'https://deno.land/x/discord_api_types/v10.ts';
```
3. From [skypack.dev](https://www.skypack.dev/)
```ts
// Importing a specific API version
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts';
```
## Project Structure
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 `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.
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
- 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 `REST<HTTP Method>OAuth2`
- 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.
**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_.
Anything else will not be documented (for example client only types).
With that aside, we may allow certain types that are not documented in the [API Documentation repository](https://github.com/discord/discord-api-docs) on a case by case basis.
They will be documented with an `@unstable` tag and are not subject with the same versioning rules.

View File

@@ -1,9 +0,0 @@
/**
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-query-string-params
*/
export interface GatewayURLQuery {
v: string;
encoding: 'etf' | 'json';
compress?: 'zlib-stream';
}
//# sourceMappingURL=common.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["common.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,KAAK,GAAG,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,aAAa,CAAC;CACzB"}

View File

@@ -1,3 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=common.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"common.js","sourceRoot":"","sources":["common.ts"],"names":[],"mappings":""}

View File

@@ -1,2 +0,0 @@
export * from './v10';
//# sourceMappingURL=index.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAGA,cAAc,OAAO,CAAC"}

View File

@@ -1,20 +0,0 @@
"use strict";
// This file exports all the types available in the recommended gateway version
// Thereby, things MAY break in the future. Try sticking to imports from a specific version
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 });
__exportStar(require("./v10"), exports);
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,2FAA2F;;;;;;;;;;;;;;;;AAE3F,wCAAsB"}

View File

@@ -1,8 +0,0 @@
import mod from "./index.js";
export default mod;
export const GatewayCloseCodes = mod.GatewayCloseCodes;
export const GatewayDispatchEvents = mod.GatewayDispatchEvents;
export const GatewayIntentBits = mod.GatewayIntentBits;
export const GatewayOpcodes = mod.GatewayOpcodes;
export const GatewayVersion = mod.GatewayVersion;

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,261 +0,0 @@
"use strict";
/**
* 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.GatewayVersion = '10';
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
*/
var GatewayOpcodes;
(function (GatewayOpcodes) {
/**
* An event was dispatched
*/
GatewayOpcodes[GatewayOpcodes["Dispatch"] = 0] = "Dispatch";
/**
* A bidirectional opcode to maintain an active gateway connection.
* Fired periodically by the client, or fired by the gateway to request an immediate heartbeat from the client.
*/
GatewayOpcodes[GatewayOpcodes["Heartbeat"] = 1] = "Heartbeat";
/**
* Starts a new session during the initial handshake
*/
GatewayOpcodes[GatewayOpcodes["Identify"] = 2] = "Identify";
/**
* Update the client's presence
*/
GatewayOpcodes[GatewayOpcodes["PresenceUpdate"] = 3] = "PresenceUpdate";
/**
* Used to join/leave or move between voice channels
*/
GatewayOpcodes[GatewayOpcodes["VoiceStateUpdate"] = 4] = "VoiceStateUpdate";
/**
* Resume a previous session that was disconnected
*/
GatewayOpcodes[GatewayOpcodes["Resume"] = 6] = "Resume";
/**
* You should attempt to reconnect and resume immediately
*/
GatewayOpcodes[GatewayOpcodes["Reconnect"] = 7] = "Reconnect";
/**
* Request information about offline guild members in a large guild
*/
GatewayOpcodes[GatewayOpcodes["RequestGuildMembers"] = 8] = "RequestGuildMembers";
/**
* The session has been invalidated. You should reconnect and identify/resume accordingly
*/
GatewayOpcodes[GatewayOpcodes["InvalidSession"] = 9] = "InvalidSession";
/**
* Sent immediately after connecting, contains the `heartbeat_interval` to use
*/
GatewayOpcodes[GatewayOpcodes["Hello"] = 10] = "Hello";
/**
* Sent in response to receiving a heartbeat to acknowledge that it has been received
*/
GatewayOpcodes[GatewayOpcodes["HeartbeatAck"] = 11] = "HeartbeatAck";
})(GatewayOpcodes || (exports.GatewayOpcodes = GatewayOpcodes = {}));
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
*/
var GatewayCloseCodes;
(function (GatewayCloseCodes) {
/**
* We're not sure what went wrong. Try reconnecting?
*/
GatewayCloseCodes[GatewayCloseCodes["UnknownError"] = 4000] = "UnknownError";
/**
* 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
*/
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
*/
GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError";
/**
* You sent us a payload prior to identifying
*
* See 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
*/
GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed";
/**
* You sent more than one identify payload. Don't do that!
*/
GatewayCloseCodes[GatewayCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated";
/**
* 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
*/
GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq";
/**
* Woah nelly! You're sending payloads to us too quickly. Slow it down! You will be disconnected on receiving this
*/
GatewayCloseCodes[GatewayCloseCodes["RateLimited"] = 4008] = "RateLimited";
/**
* Your session timed out. Reconnect and start a new one
*/
GatewayCloseCodes[GatewayCloseCodes["SessionTimedOut"] = 4009] = "SessionTimedOut";
/**
* You sent us an invalid shard when identifying
*
* See 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
*/
GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired";
/**
* You sent an invalid version for the gateway
*/
GatewayCloseCodes[GatewayCloseCodes["InvalidAPIVersion"] = 4012] = "InvalidAPIVersion";
/**
* 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
*/
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
*/
GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents";
})(GatewayCloseCodes || (exports.GatewayCloseCodes = GatewayCloseCodes = {}));
/**
* https://discord.com/developers/docs/topics/gateway#list-of-intents
*/
var GatewayIntentBits;
(function (GatewayIntentBits) {
GatewayIntentBits[GatewayIntentBits["Guilds"] = 1] = "Guilds";
GatewayIntentBits[GatewayIntentBits["GuildMembers"] = 2] = "GuildMembers";
GatewayIntentBits[GatewayIntentBits["GuildModeration"] = 4] = "GuildModeration";
/**
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
*/
GatewayIntentBits[GatewayIntentBits["GuildBans"] = 4] = "GuildBans";
GatewayIntentBits[GatewayIntentBits["GuildEmojisAndStickers"] = 8] = "GuildEmojisAndStickers";
GatewayIntentBits[GatewayIntentBits["GuildIntegrations"] = 16] = "GuildIntegrations";
GatewayIntentBits[GatewayIntentBits["GuildWebhooks"] = 32] = "GuildWebhooks";
GatewayIntentBits[GatewayIntentBits["GuildInvites"] = 64] = "GuildInvites";
GatewayIntentBits[GatewayIntentBits["GuildVoiceStates"] = 128] = "GuildVoiceStates";
GatewayIntentBits[GatewayIntentBits["GuildPresences"] = 256] = "GuildPresences";
GatewayIntentBits[GatewayIntentBits["GuildMessages"] = 512] = "GuildMessages";
GatewayIntentBits[GatewayIntentBits["GuildMessageReactions"] = 1024] = "GuildMessageReactions";
GatewayIntentBits[GatewayIntentBits["GuildMessageTyping"] = 2048] = "GuildMessageTyping";
GatewayIntentBits[GatewayIntentBits["DirectMessages"] = 4096] = "DirectMessages";
GatewayIntentBits[GatewayIntentBits["DirectMessageReactions"] = 8192] = "DirectMessageReactions";
GatewayIntentBits[GatewayIntentBits["DirectMessageTyping"] = 16384] = "DirectMessageTyping";
GatewayIntentBits[GatewayIntentBits["MessageContent"] = 32768] = "MessageContent";
GatewayIntentBits[GatewayIntentBits["GuildScheduledEvents"] = 65536] = "GuildScheduledEvents";
GatewayIntentBits[GatewayIntentBits["AutoModerationConfiguration"] = 1048576] = "AutoModerationConfiguration";
GatewayIntentBits[GatewayIntentBits["AutoModerationExecution"] = 2097152] = "AutoModerationExecution";
GatewayIntentBits[GatewayIntentBits["GuildMessagePolls"] = 16777216] = "GuildMessagePolls";
GatewayIntentBits[GatewayIntentBits["DirectMessagePolls"] = 33554432] = "DirectMessagePolls";
})(GatewayIntentBits || (exports.GatewayIntentBits = GatewayIntentBits = {}));
/**
* https://discord.com/developers/docs/topics/gateway-events#receive-events
*/
var GatewayDispatchEvents;
(function (GatewayDispatchEvents) {
GatewayDispatchEvents["ApplicationCommandPermissionsUpdate"] = "APPLICATION_COMMAND_PERMISSIONS_UPDATE";
GatewayDispatchEvents["ChannelCreate"] = "CHANNEL_CREATE";
GatewayDispatchEvents["ChannelDelete"] = "CHANNEL_DELETE";
GatewayDispatchEvents["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE";
GatewayDispatchEvents["ChannelUpdate"] = "CHANNEL_UPDATE";
GatewayDispatchEvents["GuildBanAdd"] = "GUILD_BAN_ADD";
GatewayDispatchEvents["GuildBanRemove"] = "GUILD_BAN_REMOVE";
GatewayDispatchEvents["GuildCreate"] = "GUILD_CREATE";
GatewayDispatchEvents["GuildDelete"] = "GUILD_DELETE";
GatewayDispatchEvents["GuildEmojisUpdate"] = "GUILD_EMOJIS_UPDATE";
GatewayDispatchEvents["GuildIntegrationsUpdate"] = "GUILD_INTEGRATIONS_UPDATE";
GatewayDispatchEvents["GuildMemberAdd"] = "GUILD_MEMBER_ADD";
GatewayDispatchEvents["GuildMemberRemove"] = "GUILD_MEMBER_REMOVE";
GatewayDispatchEvents["GuildMembersChunk"] = "GUILD_MEMBERS_CHUNK";
GatewayDispatchEvents["GuildMemberUpdate"] = "GUILD_MEMBER_UPDATE";
GatewayDispatchEvents["GuildRoleCreate"] = "GUILD_ROLE_CREATE";
GatewayDispatchEvents["GuildRoleDelete"] = "GUILD_ROLE_DELETE";
GatewayDispatchEvents["GuildRoleUpdate"] = "GUILD_ROLE_UPDATE";
GatewayDispatchEvents["GuildStickersUpdate"] = "GUILD_STICKERS_UPDATE";
GatewayDispatchEvents["GuildUpdate"] = "GUILD_UPDATE";
GatewayDispatchEvents["IntegrationCreate"] = "INTEGRATION_CREATE";
GatewayDispatchEvents["IntegrationDelete"] = "INTEGRATION_DELETE";
GatewayDispatchEvents["IntegrationUpdate"] = "INTEGRATION_UPDATE";
GatewayDispatchEvents["InteractionCreate"] = "INTERACTION_CREATE";
GatewayDispatchEvents["InviteCreate"] = "INVITE_CREATE";
GatewayDispatchEvents["InviteDelete"] = "INVITE_DELETE";
GatewayDispatchEvents["MessageCreate"] = "MESSAGE_CREATE";
GatewayDispatchEvents["MessageDelete"] = "MESSAGE_DELETE";
GatewayDispatchEvents["MessageDeleteBulk"] = "MESSAGE_DELETE_BULK";
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["StageInstanceCreate"] = "STAGE_INSTANCE_CREATE";
GatewayDispatchEvents["StageInstanceDelete"] = "STAGE_INSTANCE_DELETE";
GatewayDispatchEvents["StageInstanceUpdate"] = "STAGE_INSTANCE_UPDATE";
GatewayDispatchEvents["Ready"] = "READY";
GatewayDispatchEvents["Resumed"] = "RESUMED";
GatewayDispatchEvents["ThreadCreate"] = "THREAD_CREATE";
GatewayDispatchEvents["ThreadDelete"] = "THREAD_DELETE";
GatewayDispatchEvents["ThreadListSync"] = "THREAD_LIST_SYNC";
GatewayDispatchEvents["ThreadMembersUpdate"] = "THREAD_MEMBERS_UPDATE";
GatewayDispatchEvents["ThreadMemberUpdate"] = "THREAD_MEMBER_UPDATE";
GatewayDispatchEvents["ThreadUpdate"] = "THREAD_UPDATE";
GatewayDispatchEvents["TypingStart"] = "TYPING_START";
GatewayDispatchEvents["UserUpdate"] = "USER_UPDATE";
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 = {}));
// #endregion Shared
//# sourceMappingURL=v10.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"v10.js","sourceRoot":"","sources":["v10.ts"],"names":[],"mappings":"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"}

View File

@@ -1,8 +0,0 @@
import mod from "./v10.js";
export default mod;
export const GatewayCloseCodes = mod.GatewayCloseCodes;
export const GatewayDispatchEvents = mod.GatewayDispatchEvents;
export const GatewayIntentBits = mod.GatewayIntentBits;
export const GatewayOpcodes = mod.GatewayOpcodes;
export const GatewayVersion = mod.GatewayVersion;

View File

@@ -1,658 +0,0 @@
/**
* 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';
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare const GatewayVersion = "6";
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare enum GatewayOPCodes {
Dispatch = 0,
Heartbeat = 1,
Identify = 2,
PresenceUpdate = 3,
VoiceStateUpdate = 4,
Resume = 6,
Reconnect = 7,
RequestGuildMembers = 8,
InvalidSession = 9,
Hello = 10,
HeartbeatAck = 11
}
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare enum GatewayCloseCodes {
UnknownError = 4000,
UnknownOpCode = 4001,
DecodeError = 4002,
NotAuthenticated = 4003,
AuthenticationFailed = 4004,
AlreadyAuthenticated = 4005,
InvalidSeq = 4007,
RateLimited = 4008,
SessionTimedOut = 4009,
InvalidShard = 4010,
ShardingRequired = 4011,
InvalidAPIVersion = 4012,
InvalidIntents = 4013,
DisallowedIntents = 4014
}
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare enum VoiceOPCodes {
Identify = 0,
SelectProtocol = 1,
Ready = 2,
Heartbeat = 3,
SessionDescription = 4,
Speaking = 5,
HeartbeatAck = 6,
Resume = 7,
Hello = 8,
Resumed = 9,
ClientDisconnect = 13
}
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare enum VoiceCloseCodes {
UnknownOpCode = 4001,
NotAuthenticated = 4003,
AuthenticationFailed = 4004,
AlreadyAuthenticated = 4005,
SessionNoLongerValid = 4006,
SessionTimeout = 4009,
ServerNotFound = 4011,
UnknownProtocol = 4012,
Disconnected = 4014,
VoiceServerCrashed = 4015,
UnknownEncryptionMode = 4016
}
/**
* https://discord.com/developers/docs/topics/gateway#list-of-intents
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare enum GatewayIntentBits {
GUILDS = 1,
GUILD_MEMBERS = 2,
GUILD_BANS = 4,
GUILD_EMOJIS = 8,
GUILD_INTEGRATIONS = 16,
GUILD_WEBHOOKS = 32,
GUILD_INVITES = 64,
GUILD_VOICE_STATES = 128,
GUILD_PRESENCES = 256,
GUILD_MESSAGES = 512,
GUILD_MESSAGE_REACTIONS = 1024,
GUILD_MESSAGE_TYPING = 2048,
DIRECT_MESSAGES = 4096,
DIRECT_MESSAGE_REACTIONS = 8192,
DIRECT_MESSAGE_TYPING = 16384
}
/**
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare enum GatewayDispatchEvents {
Ready = "READY",
Resumed = "RESUMED",
ChannelCreate = "CHANNEL_CREATE",
ChannelUpdate = "CHANNEL_UPDATE",
ChannelDelete = "CHANNEL_DELETE",
ChannelPinsUpdate = "CHANNEL_PINS_UPDATE",
GuildCreate = "GUILD_CREATE",
GuildUpdate = "GUILD_UPDATE",
GuildDelete = "GUILD_DELETE",
GuildBanAdd = "GUILD_BAN_ADD",
GuildBanRemove = "GUILD_BAN_REMOVE",
GuildEmojisUpdate = "GUILD_EMOJIS_UPDATE",
GuildIntegrationsUpdate = "GUILD_INTEGRATIONS_UPDATE",
GuildMemberAdd = "GUILD_MEMBER_ADD",
GuildMemberRemove = "GUILD_MEMBER_REMOVE",
GuildMemberUpdate = "GUILD_MEMBER_UPDATE",
GuildMembersChunk = "GUILD_MEMBERS_CHUNK",
GuildRoleCreate = "GUILD_ROLE_CREATE",
GuildRoleUpdate = "GUILD_ROLE_UPDATE",
GuildRoleDelete = "GUILD_ROLE_DELETE",
InviteCreate = "INVITE_CREATE",
InviteDelete = "INVITE_DELETE",
MessageCreate = "MESSAGE_CREATE",
MessageUpdate = "MESSAGE_UPDATE",
MessageDelete = "MESSAGE_DELETE",
MessageDeleteBulk = "MESSAGE_DELETE_BULK",
MessageReactionAdd = "MESSAGE_REACTION_ADD",
MessageReactionRemove = "MESSAGE_REACTION_REMOVE",
MessageReactionRemoveAll = "MESSAGE_REACTION_REMOVE_ALL",
MessageReactionRemoveEmoji = "MESSAGE_REACTION_REMOVE_EMOJI",
PresenceUpdate = "PRESENCE_UPDATE",
TypingStart = "TYPING_START",
UserUpdate = "USER_UPDATE",
VoiceStateUpdate = "VOICE_STATE_UPDATE",
VoiceServerUpdate = "VOICE_SERVER_UPDATE",
WebhooksUpdate = "WEBHOOKS_UPDATE"
}
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewaySendPayload = GatewayHeartbeat | GatewayIdentify | GatewayRequestGuildMembers | GatewayResume | GatewayUpdatePresence | GatewayVoiceStateUpdate;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayReceivePayload = GatewayDispatchPayload | GatewayHeartbeatAck | GatewayHeartbeatRequest | GatewayHello | GatewayInvalidSession | GatewayReconnect;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayDispatchPayload = GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayGuildBanModifyDispatch | GatewayGuildDeleteDispatch | GatewayGuildEmojisUpdateDispatch | GatewayGuildIntegrationsUpdateDispatch | GatewayGuildMemberAddDispatch | GatewayGuildMemberRemoveDispatch | GatewayGuildMembersChunkDispatch | GatewayGuildMemberUpdateDispatch | GatewayGuildModifyDispatch | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch | GatewayMessageCreateDispatch | GatewayMessageDeleteBulkDispatch | GatewayMessageDeleteDispatch | GatewayMessageReactionAddDispatch | GatewayMessageReactionRemoveAllDispatch | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch | GatewayReadyDispatch | GatewayResumedDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceServerUpdateDispatch | GatewayVoiceStateUpdateDispatch | GatewayWebhooksUpdateDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#hello
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayHello extends NonDispatchPayload {
op: GatewayOPCodes.Hello;
d: {
heartbeat_interval: number;
};
}
/**
* https://discord.com/developers/docs/topics/gateway#heartbeating
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayHeartbeatRequest extends NonDispatchPayload {
op: GatewayOPCodes.Heartbeat;
d: never;
}
/**
* https://discord.com/developers/docs/topics/gateway#heartbeating-example-gateway-heartbeat-ack
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayHeartbeatAck extends NonDispatchPayload {
op: GatewayOPCodes.HeartbeatAck;
d: never;
}
/**
* https://discord.com/developers/docs/topics/gateway#invalid-session
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayInvalidSession extends NonDispatchPayload {
op: GatewayOPCodes.InvalidSession;
d: boolean;
}
/**
* https://discord.com/developers/docs/topics/gateway#reconnect
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayReconnect extends NonDispatchPayload {
op: GatewayOPCodes.Reconnect;
d: never;
}
/**
* https://discord.com/developers/docs/topics/gateway#ready
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayReadyDispatch = DataPayload<GatewayDispatchEvents.Ready, {
v: number;
user: APIUser;
session_id: string;
private_channels: [];
guilds: APIUnavailableGuild[];
shard?: [number, number];
}>;
/**
* https://discord.com/developers/docs/topics/gateway#resumed
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed, never>;
/**
* https://discord.com/developers/docs/topics/gateway#channel-create
* https://discord.com/developers/docs/topics/gateway#channel-update
* https://discord.com/developers/docs/topics/gateway#channel-delete
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayChannelModifyDispatch = DataPayload<GatewayDispatchEvents.ChannelCreate | GatewayDispatchEvents.ChannelDelete | GatewayDispatchEvents.ChannelUpdate, APIChannel>;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayChannelCreateDispatch = GatewayChannelModifyDispatch;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayChannelUpdateDispatch = GatewayChannelModifyDispatch;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#channel-pins-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayChannelPinsUpdateDispatch = DataPayload<GatewayDispatchEvents.ChannelPinsUpdate, {
guild_id?: string;
channel_id: string;
last_pin_timestamp?: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-create
* https://discord.com/developers/docs/topics/gateway#guild-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildModifyDispatch = DataPayload<GatewayDispatchEvents.GuildCreate | GatewayDispatchEvents.GuildUpdate, APIGuild>;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#guild-delete
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildDelete, APIUnavailableGuild>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-ban-add
* https://discord.com/developers/docs/topics/gateway#guild-ban-remove
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildBanModifyDispatch = DataPayload<GatewayDispatchEvents.GuildBanAdd | GatewayDispatchEvents.GuildBanRemove, {
guild_id: string;
user: APIUser;
}>;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildBanAddDispatch = GatewayGuildBanModifyDispatch;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#guild-emojis-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildEmojisUpdateDispatch = DataPayload<GatewayDispatchEvents.GuildEmojisUpdate, {
guild_id: string;
emojis: APIEmoji[];
}>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-integrations-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildIntegrationsUpdateDispatch = DataPayload<GatewayDispatchEvents.GuildIntegrationsUpdate, {
guild_id: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-member-add
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildMemberAddDispatch = DataPayload<GatewayDispatchEvents.GuildMemberAdd, APIGuildMember & {
guild_id: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-member-remove
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildMemberRemoveDispatch = DataPayload<GatewayDispatchEvents.GuildMemberRemove, {
guild_id: string;
user: APIUser;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-member-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildMemberUpdateDispatch = DataPayload<GatewayDispatchEvents.GuildMemberUpdate, Omit<APIGuildMember, 'deaf' | 'mute'> & {
guild_id: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-members-chunk
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildMembersChunkDispatch = DataPayload<GatewayDispatchEvents.GuildMembersChunk, {
guild_id: string;
members: APIGuildMember[];
chunk_index?: number;
chunk_count?: number;
not_found?: unknown[];
presences?: RawGatewayPresenceUpdate[];
nonce?: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-role-create
* https://discord.com/developers/docs/topics/gateway#guild-role-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildRoleModifyDispatch = DataPayload<GatewayDispatchEvents.GuildRoleCreate | GatewayDispatchEvents.GuildRoleUpdate, {
guild_id: string;
role: APIRole;
}>;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildRoleCreateDispatch = GatewayGuildRoleModifyDispatch;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#guild-role-delete
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildRoleDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildRoleDelete, {
guild_id: string;
role_id: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#invite-create
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayInviteCreateDispatch = DataPayload<GatewayDispatchEvents.InviteCreate, {
channel_id: string;
code: string;
created_at: number;
guild_id?: string;
inviter?: APIUser;
max_age: number;
max_uses: number;
target_user?: APIUser;
target_user_type?: InviteTargetUserType;
temporary: boolean;
uses: 0;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#invite-delete
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayInviteDeleteDispatch = DataPayload<GatewayDispatchEvents.InviteDelete, {
channel_id: string;
guild_id?: string;
code: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#message-create
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayMessageCreateDispatch = DataPayload<GatewayDispatchEvents.MessageCreate, APIMessage>;
/**
* https://discord.com/developers/docs/topics/gateway#message-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayMessageUpdateDispatch = DataPayload<GatewayDispatchEvents.MessageUpdate, Partial<APIMessage> & {
id: string;
channel_id: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#message-delete
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayMessageDeleteDispatch = DataPayload<GatewayDispatchEvents.MessageDelete, {
id: string;
channel_id: string;
guild_id?: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#message-delete-bulk
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayMessageDeleteBulkDispatch = DataPayload<GatewayDispatchEvents.MessageDeleteBulk, {
ids: string[];
channel_id: string;
guild_id?: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-add
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayMessageReactionAddDispatch = ReactionData<GatewayDispatchEvents.MessageReactionAdd>;
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayMessageReactionRemoveDispatch = ReactionData<GatewayDispatchEvents.MessageReactionRemove, 'member'>;
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayMessageReactionRemoveAllDispatch = DataPayload<GatewayDispatchEvents.MessageReactionRemoveAll, MessageReactionRemoveData>;
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayMessageReactionRemoveEmojiDispatch = DataPayload<GatewayDispatchEvents.MessageReactionRemoveEmoji, MessageReactionRemoveData & {
emoji: APIEmoji;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#presence-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayPresenceUpdateDispatch = DataPayload<GatewayDispatchEvents.PresenceUpdate, RawGatewayPresenceUpdate>;
/**
* https://discord.com/developers/docs/topics/gateway#typing-start
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayTypingStartDispatch = DataPayload<GatewayDispatchEvents.TypingStart, {
channel_id: string;
guild_id?: string;
user_id: string;
timestamp: number;
member?: APIGuildMember;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#user-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayUserUpdateDispatch = DataPayload<GatewayDispatchEvents.UserUpdate, APIUser>;
/**
* https://discord.com/developers/docs/topics/gateway#voice-state-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayVoiceStateUpdateDispatch = DataPayload<GatewayDispatchEvents.VoiceStateUpdate, GatewayVoiceState>;
/**
* https://discord.com/developers/docs/topics/gateway#voice-server-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayVoiceServerUpdateDispatch = DataPayload<GatewayDispatchEvents.VoiceServerUpdate, {
token: string;
guild_id: string;
endpoint: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#webhooks-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayWebhooksUpdateDispatch = DataPayload<GatewayDispatchEvents.WebhooksUpdate, {
guild_id: string;
channel_id: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#heartbeating
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayHeartbeat {
op: GatewayOPCodes.Heartbeat;
d: number;
}
/**
* https://discord.com/developers/docs/topics/gateway#identify-identify-connection-properties
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayIdentifyProperties {
$os: string;
$browser: string;
$device: string;
}
/**
* https://discord.com/developers/docs/topics/gateway#identify
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayIdentify {
op: GatewayOPCodes.Identify;
d: {
token: string;
properties: GatewayIdentifyProperties;
compress?: boolean;
large_threshold?: number;
shard?: [shard_id: number, shard_count: number];
presence?: RawGatewayPresenceUpdate;
guild_subscriptions?: boolean;
intents?: number;
};
}
/**
* https://discord.com/developers/docs/topics/gateway#resume
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayResume {
op: GatewayOPCodes.Resume;
d: {
token: string;
session_id: string;
seq: number;
};
}
/**
* https://discord.com/developers/docs/topics/gateway#request-guild-members
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayRequestGuildMembers {
op: GatewayOPCodes.RequestGuildMembers;
d: {
guild_id: string[] | string;
query?: string;
limit: number;
presences?: boolean;
user_ids?: string[] | string;
nonce?: string;
};
}
/**
* https://discord.com/developers/docs/topics/gateway#update-voice-state
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayVoiceStateUpdate {
op: GatewayOPCodes.VoiceStateUpdate;
d: {
guild_id: string;
channel_id: string | null;
self_mute: boolean;
self_deaf: boolean;
};
}
/**
* https://discord.com/developers/docs/topics/gateway#update-status
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayUpdatePresence {
op: GatewayOPCodes.PresenceUpdate;
d: GatewayPresenceUpdateData;
}
/**
* https://discord.com/developers/docs/topics/gateway#update-status-gateway-status-update-structure
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayPresenceUpdateData {
since: number | null;
game: GatewayActivity | null;
status: PresenceUpdateStatus;
afk: boolean;
}
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
interface BasePayload {
op: GatewayOPCodes;
s: number;
d?: unknown;
t?: string;
}
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
type NonDispatchPayload = Omit<BasePayload, 't'>;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
interface DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends BasePayload {
op: GatewayOPCodes.Dispatch;
t: Event;
d: D;
}
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = DataPayload<E, Omit<{
user_id: string;
channel_id: string;
message_id: string;
guild_id?: string;
member?: APIGuildMember;
emoji: APIEmoji;
}, O>>;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
interface MessageReactionRemoveData {
channel_id: string;
message_id: string;
guild_id?: string;
}
//# sourceMappingURL=v6.d.ts.map

File diff suppressed because one or more lines are too long

View File

@@ -1,173 +0,0 @@
"use strict";
/**
* 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.
*/
exports.GatewayVersion = '6';
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
var GatewayOPCodes;
(function (GatewayOPCodes) {
GatewayOPCodes[GatewayOPCodes["Dispatch"] = 0] = "Dispatch";
GatewayOPCodes[GatewayOPCodes["Heartbeat"] = 1] = "Heartbeat";
GatewayOPCodes[GatewayOPCodes["Identify"] = 2] = "Identify";
GatewayOPCodes[GatewayOPCodes["PresenceUpdate"] = 3] = "PresenceUpdate";
GatewayOPCodes[GatewayOPCodes["VoiceStateUpdate"] = 4] = "VoiceStateUpdate";
GatewayOPCodes[GatewayOPCodes["Resume"] = 6] = "Resume";
GatewayOPCodes[GatewayOPCodes["Reconnect"] = 7] = "Reconnect";
GatewayOPCodes[GatewayOPCodes["RequestGuildMembers"] = 8] = "RequestGuildMembers";
GatewayOPCodes[GatewayOPCodes["InvalidSession"] = 9] = "InvalidSession";
GatewayOPCodes[GatewayOPCodes["Hello"] = 10] = "Hello";
GatewayOPCodes[GatewayOPCodes["HeartbeatAck"] = 11] = "HeartbeatAck";
})(GatewayOPCodes || (exports.GatewayOPCodes = GatewayOPCodes = {}));
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
var GatewayCloseCodes;
(function (GatewayCloseCodes) {
GatewayCloseCodes[GatewayCloseCodes["UnknownError"] = 4000] = "UnknownError";
GatewayCloseCodes[GatewayCloseCodes["UnknownOpCode"] = 4001] = "UnknownOpCode";
GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError";
GatewayCloseCodes[GatewayCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated";
GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed";
GatewayCloseCodes[GatewayCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated";
GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq";
GatewayCloseCodes[GatewayCloseCodes["RateLimited"] = 4008] = "RateLimited";
GatewayCloseCodes[GatewayCloseCodes["SessionTimedOut"] = 4009] = "SessionTimedOut";
GatewayCloseCodes[GatewayCloseCodes["InvalidShard"] = 4010] = "InvalidShard";
GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired";
GatewayCloseCodes[GatewayCloseCodes["InvalidAPIVersion"] = 4012] = "InvalidAPIVersion";
GatewayCloseCodes[GatewayCloseCodes["InvalidIntents"] = 4013] = "InvalidIntents";
GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents";
})(GatewayCloseCodes || (exports.GatewayCloseCodes = GatewayCloseCodes = {}));
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
var VoiceOPCodes;
(function (VoiceOPCodes) {
VoiceOPCodes[VoiceOPCodes["Identify"] = 0] = "Identify";
VoiceOPCodes[VoiceOPCodes["SelectProtocol"] = 1] = "SelectProtocol";
VoiceOPCodes[VoiceOPCodes["Ready"] = 2] = "Ready";
VoiceOPCodes[VoiceOPCodes["Heartbeat"] = 3] = "Heartbeat";
VoiceOPCodes[VoiceOPCodes["SessionDescription"] = 4] = "SessionDescription";
VoiceOPCodes[VoiceOPCodes["Speaking"] = 5] = "Speaking";
VoiceOPCodes[VoiceOPCodes["HeartbeatAck"] = 6] = "HeartbeatAck";
VoiceOPCodes[VoiceOPCodes["Resume"] = 7] = "Resume";
VoiceOPCodes[VoiceOPCodes["Hello"] = 8] = "Hello";
VoiceOPCodes[VoiceOPCodes["Resumed"] = 9] = "Resumed";
VoiceOPCodes[VoiceOPCodes["ClientDisconnect"] = 13] = "ClientDisconnect";
})(VoiceOPCodes || (exports.VoiceOPCodes = VoiceOPCodes = {}));
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
var VoiceCloseCodes;
(function (VoiceCloseCodes) {
VoiceCloseCodes[VoiceCloseCodes["UnknownOpCode"] = 4001] = "UnknownOpCode";
VoiceCloseCodes[VoiceCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated";
VoiceCloseCodes[VoiceCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed";
VoiceCloseCodes[VoiceCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated";
VoiceCloseCodes[VoiceCloseCodes["SessionNoLongerValid"] = 4006] = "SessionNoLongerValid";
VoiceCloseCodes[VoiceCloseCodes["SessionTimeout"] = 4009] = "SessionTimeout";
VoiceCloseCodes[VoiceCloseCodes["ServerNotFound"] = 4011] = "ServerNotFound";
VoiceCloseCodes[VoiceCloseCodes["UnknownProtocol"] = 4012] = "UnknownProtocol";
VoiceCloseCodes[VoiceCloseCodes["Disconnected"] = 4014] = "Disconnected";
VoiceCloseCodes[VoiceCloseCodes["VoiceServerCrashed"] = 4015] = "VoiceServerCrashed";
VoiceCloseCodes[VoiceCloseCodes["UnknownEncryptionMode"] = 4016] = "UnknownEncryptionMode";
})(VoiceCloseCodes || (exports.VoiceCloseCodes = VoiceCloseCodes = {}));
/**
* https://discord.com/developers/docs/topics/gateway#list-of-intents
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
var GatewayIntentBits;
(function (GatewayIntentBits) {
GatewayIntentBits[GatewayIntentBits["GUILDS"] = 1] = "GUILDS";
GatewayIntentBits[GatewayIntentBits["GUILD_MEMBERS"] = 2] = "GUILD_MEMBERS";
GatewayIntentBits[GatewayIntentBits["GUILD_BANS"] = 4] = "GUILD_BANS";
GatewayIntentBits[GatewayIntentBits["GUILD_EMOJIS"] = 8] = "GUILD_EMOJIS";
GatewayIntentBits[GatewayIntentBits["GUILD_INTEGRATIONS"] = 16] = "GUILD_INTEGRATIONS";
GatewayIntentBits[GatewayIntentBits["GUILD_WEBHOOKS"] = 32] = "GUILD_WEBHOOKS";
GatewayIntentBits[GatewayIntentBits["GUILD_INVITES"] = 64] = "GUILD_INVITES";
GatewayIntentBits[GatewayIntentBits["GUILD_VOICE_STATES"] = 128] = "GUILD_VOICE_STATES";
GatewayIntentBits[GatewayIntentBits["GUILD_PRESENCES"] = 256] = "GUILD_PRESENCES";
GatewayIntentBits[GatewayIntentBits["GUILD_MESSAGES"] = 512] = "GUILD_MESSAGES";
GatewayIntentBits[GatewayIntentBits["GUILD_MESSAGE_REACTIONS"] = 1024] = "GUILD_MESSAGE_REACTIONS";
GatewayIntentBits[GatewayIntentBits["GUILD_MESSAGE_TYPING"] = 2048] = "GUILD_MESSAGE_TYPING";
GatewayIntentBits[GatewayIntentBits["DIRECT_MESSAGES"] = 4096] = "DIRECT_MESSAGES";
GatewayIntentBits[GatewayIntentBits["DIRECT_MESSAGE_REACTIONS"] = 8192] = "DIRECT_MESSAGE_REACTIONS";
GatewayIntentBits[GatewayIntentBits["DIRECT_MESSAGE_TYPING"] = 16384] = "DIRECT_MESSAGE_TYPING";
})(GatewayIntentBits || (exports.GatewayIntentBits = GatewayIntentBits = {}));
/**
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
var GatewayDispatchEvents;
(function (GatewayDispatchEvents) {
GatewayDispatchEvents["Ready"] = "READY";
GatewayDispatchEvents["Resumed"] = "RESUMED";
GatewayDispatchEvents["ChannelCreate"] = "CHANNEL_CREATE";
GatewayDispatchEvents["ChannelUpdate"] = "CHANNEL_UPDATE";
GatewayDispatchEvents["ChannelDelete"] = "CHANNEL_DELETE";
GatewayDispatchEvents["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE";
GatewayDispatchEvents["GuildCreate"] = "GUILD_CREATE";
GatewayDispatchEvents["GuildUpdate"] = "GUILD_UPDATE";
GatewayDispatchEvents["GuildDelete"] = "GUILD_DELETE";
GatewayDispatchEvents["GuildBanAdd"] = "GUILD_BAN_ADD";
GatewayDispatchEvents["GuildBanRemove"] = "GUILD_BAN_REMOVE";
GatewayDispatchEvents["GuildEmojisUpdate"] = "GUILD_EMOJIS_UPDATE";
GatewayDispatchEvents["GuildIntegrationsUpdate"] = "GUILD_INTEGRATIONS_UPDATE";
GatewayDispatchEvents["GuildMemberAdd"] = "GUILD_MEMBER_ADD";
GatewayDispatchEvents["GuildMemberRemove"] = "GUILD_MEMBER_REMOVE";
GatewayDispatchEvents["GuildMemberUpdate"] = "GUILD_MEMBER_UPDATE";
GatewayDispatchEvents["GuildMembersChunk"] = "GUILD_MEMBERS_CHUNK";
GatewayDispatchEvents["GuildRoleCreate"] = "GUILD_ROLE_CREATE";
GatewayDispatchEvents["GuildRoleUpdate"] = "GUILD_ROLE_UPDATE";
GatewayDispatchEvents["GuildRoleDelete"] = "GUILD_ROLE_DELETE";
GatewayDispatchEvents["InviteCreate"] = "INVITE_CREATE";
GatewayDispatchEvents["InviteDelete"] = "INVITE_DELETE";
GatewayDispatchEvents["MessageCreate"] = "MESSAGE_CREATE";
GatewayDispatchEvents["MessageUpdate"] = "MESSAGE_UPDATE";
GatewayDispatchEvents["MessageDelete"] = "MESSAGE_DELETE";
GatewayDispatchEvents["MessageDeleteBulk"] = "MESSAGE_DELETE_BULK";
GatewayDispatchEvents["MessageReactionAdd"] = "MESSAGE_REACTION_ADD";
GatewayDispatchEvents["MessageReactionRemove"] = "MESSAGE_REACTION_REMOVE";
GatewayDispatchEvents["MessageReactionRemoveAll"] = "MESSAGE_REACTION_REMOVE_ALL";
GatewayDispatchEvents["MessageReactionRemoveEmoji"] = "MESSAGE_REACTION_REMOVE_EMOJI";
GatewayDispatchEvents["PresenceUpdate"] = "PRESENCE_UPDATE";
GatewayDispatchEvents["TypingStart"] = "TYPING_START";
GatewayDispatchEvents["UserUpdate"] = "USER_UPDATE";
GatewayDispatchEvents["VoiceStateUpdate"] = "VOICE_STATE_UPDATE";
GatewayDispatchEvents["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE";
GatewayDispatchEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE";
})(GatewayDispatchEvents || (exports.GatewayDispatchEvents = GatewayDispatchEvents = {}));
// #endregion Shared
//# sourceMappingURL=v6.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"v6.js","sourceRoot":"","sources":["v6.ts"],"names":[],"mappings":"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"}

View File

@@ -1,10 +0,0 @@
import mod from "./v6.js";
export default mod;
export const GatewayCloseCodes = mod.GatewayCloseCodes;
export const GatewayDispatchEvents = mod.GatewayDispatchEvents;
export const GatewayIntentBits = mod.GatewayIntentBits;
export const GatewayOPCodes = mod.GatewayOPCodes;
export const GatewayVersion = mod.GatewayVersion;
export const VoiceCloseCodes = mod.VoiceCloseCodes;
export const VoiceOPCodes = mod.VoiceOPCodes;

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,246 +0,0 @@
"use strict";
/**
* 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.
*/
exports.GatewayVersion = '8';
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
*
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
var GatewayOpcodes;
(function (GatewayOpcodes) {
/**
* An event was dispatched
*/
GatewayOpcodes[GatewayOpcodes["Dispatch"] = 0] = "Dispatch";
/**
* A bidirectional opcode to maintain an active gateway connection.
* Fired periodically by the client, or fired by the gateway to request an immediate heartbeat from the client.
*/
GatewayOpcodes[GatewayOpcodes["Heartbeat"] = 1] = "Heartbeat";
/**
* Starts a new session during the initial handshake
*/
GatewayOpcodes[GatewayOpcodes["Identify"] = 2] = "Identify";
/**
* Update the client's presence
*/
GatewayOpcodes[GatewayOpcodes["PresenceUpdate"] = 3] = "PresenceUpdate";
/**
* Used to join/leave or move between voice channels
*/
GatewayOpcodes[GatewayOpcodes["VoiceStateUpdate"] = 4] = "VoiceStateUpdate";
/**
* Resume a previous session that was disconnected
*/
GatewayOpcodes[GatewayOpcodes["Resume"] = 6] = "Resume";
/**
* You should attempt to reconnect and resume immediately
*/
GatewayOpcodes[GatewayOpcodes["Reconnect"] = 7] = "Reconnect";
/**
* Request information about offline guild members in a large guild
*/
GatewayOpcodes[GatewayOpcodes["RequestGuildMembers"] = 8] = "RequestGuildMembers";
/**
* The session has been invalidated. You should reconnect and identify/resume accordingly
*/
GatewayOpcodes[GatewayOpcodes["InvalidSession"] = 9] = "InvalidSession";
/**
* Sent immediately after connecting, contains the `heartbeat_interval` to use
*/
GatewayOpcodes[GatewayOpcodes["Hello"] = 10] = "Hello";
/**
* Sent in response to receiving a heartbeat to acknowledge that it has been received
*/
GatewayOpcodes[GatewayOpcodes["HeartbeatAck"] = 11] = "HeartbeatAck";
})(GatewayOpcodes || (exports.GatewayOpcodes = GatewayOpcodes = {}));
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
*
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
var GatewayCloseCodes;
(function (GatewayCloseCodes) {
/**
* We're not sure what went wrong. Try reconnecting?
*/
GatewayCloseCodes[GatewayCloseCodes["UnknownError"] = 4000] = "UnknownError";
/**
* 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#payloads-and-opcodes
*/
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-payloads
*/
GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError";
/**
* You sent us a payload prior to identifying
*
* See https://discord.com/developers/docs/topics/gateway#identify
*/
GatewayCloseCodes[GatewayCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated";
/**
* The account token sent with your identify payload is incorrect
*
* See https://discord.com/developers/docs/topics/gateway#identify
*/
GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed";
/**
* You sent more than one identify payload. Don't do that!
*/
GatewayCloseCodes[GatewayCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated";
/**
* The sequence sent when resuming the session was invalid. Reconnect and start a new session
*
* See https://discord.com/developers/docs/topics/gateway#resume
*/
GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq";
/**
* Woah nelly! You're sending payloads to us too quickly. Slow it down! You will be disconnected on receiving this
*/
GatewayCloseCodes[GatewayCloseCodes["RateLimited"] = 4008] = "RateLimited";
/**
* Your session timed out. Reconnect and start a new one
*/
GatewayCloseCodes[GatewayCloseCodes["SessionTimedOut"] = 4009] = "SessionTimedOut";
/**
* You sent us an invalid shard when identifying
*
* See 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
*/
GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired";
/**
* You sent an invalid version for the gateway
*/
GatewayCloseCodes[GatewayCloseCodes["InvalidAPIVersion"] = 4012] = "InvalidAPIVersion";
/**
* 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
*/
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
*/
GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents";
})(GatewayCloseCodes || (exports.GatewayCloseCodes = GatewayCloseCodes = {}));
/**
* https://discord.com/developers/docs/topics/gateway#list-of-intents
*
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
var GatewayIntentBits;
(function (GatewayIntentBits) {
GatewayIntentBits[GatewayIntentBits["Guilds"] = 1] = "Guilds";
GatewayIntentBits[GatewayIntentBits["GuildMembers"] = 2] = "GuildMembers";
GatewayIntentBits[GatewayIntentBits["GuildBans"] = 4] = "GuildBans";
GatewayIntentBits[GatewayIntentBits["GuildEmojisAndStickers"] = 8] = "GuildEmojisAndStickers";
GatewayIntentBits[GatewayIntentBits["GuildIntegrations"] = 16] = "GuildIntegrations";
GatewayIntentBits[GatewayIntentBits["GuildWebhooks"] = 32] = "GuildWebhooks";
GatewayIntentBits[GatewayIntentBits["GuildInvites"] = 64] = "GuildInvites";
GatewayIntentBits[GatewayIntentBits["GuildVoiceStates"] = 128] = "GuildVoiceStates";
GatewayIntentBits[GatewayIntentBits["GuildPresences"] = 256] = "GuildPresences";
GatewayIntentBits[GatewayIntentBits["GuildMessages"] = 512] = "GuildMessages";
GatewayIntentBits[GatewayIntentBits["GuildMessageReactions"] = 1024] = "GuildMessageReactions";
GatewayIntentBits[GatewayIntentBits["GuildMessageTyping"] = 2048] = "GuildMessageTyping";
GatewayIntentBits[GatewayIntentBits["DirectMessages"] = 4096] = "DirectMessages";
GatewayIntentBits[GatewayIntentBits["DirectMessageReactions"] = 8192] = "DirectMessageReactions";
GatewayIntentBits[GatewayIntentBits["DirectMessageTyping"] = 16384] = "DirectMessageTyping";
GatewayIntentBits[GatewayIntentBits["GuildScheduledEvents"] = 65536] = "GuildScheduledEvents";
})(GatewayIntentBits || (exports.GatewayIntentBits = GatewayIntentBits = {}));
/**
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
*
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
var GatewayDispatchEvents;
(function (GatewayDispatchEvents) {
GatewayDispatchEvents["ChannelCreate"] = "CHANNEL_CREATE";
GatewayDispatchEvents["ChannelDelete"] = "CHANNEL_DELETE";
GatewayDispatchEvents["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE";
GatewayDispatchEvents["ChannelUpdate"] = "CHANNEL_UPDATE";
GatewayDispatchEvents["GuildBanAdd"] = "GUILD_BAN_ADD";
GatewayDispatchEvents["GuildBanRemove"] = "GUILD_BAN_REMOVE";
GatewayDispatchEvents["GuildCreate"] = "GUILD_CREATE";
GatewayDispatchEvents["GuildDelete"] = "GUILD_DELETE";
GatewayDispatchEvents["GuildEmojisUpdate"] = "GUILD_EMOJIS_UPDATE";
GatewayDispatchEvents["GuildIntegrationsUpdate"] = "GUILD_INTEGRATIONS_UPDATE";
GatewayDispatchEvents["GuildMemberAdd"] = "GUILD_MEMBER_ADD";
GatewayDispatchEvents["GuildMemberRemove"] = "GUILD_MEMBER_REMOVE";
GatewayDispatchEvents["GuildMembersChunk"] = "GUILD_MEMBERS_CHUNK";
GatewayDispatchEvents["GuildMemberUpdate"] = "GUILD_MEMBER_UPDATE";
GatewayDispatchEvents["GuildRoleCreate"] = "GUILD_ROLE_CREATE";
GatewayDispatchEvents["GuildRoleDelete"] = "GUILD_ROLE_DELETE";
GatewayDispatchEvents["GuildRoleUpdate"] = "GUILD_ROLE_UPDATE";
GatewayDispatchEvents["GuildStickersUpdate"] = "GUILD_STICKERS_UPDATE";
GatewayDispatchEvents["GuildUpdate"] = "GUILD_UPDATE";
GatewayDispatchEvents["IntegrationCreate"] = "INTEGRATION_CREATE";
GatewayDispatchEvents["IntegrationDelete"] = "INTEGRATION_DELETE";
GatewayDispatchEvents["IntegrationUpdate"] = "INTEGRATION_UPDATE";
GatewayDispatchEvents["InteractionCreate"] = "INTERACTION_CREATE";
GatewayDispatchEvents["InviteCreate"] = "INVITE_CREATE";
GatewayDispatchEvents["InviteDelete"] = "INVITE_DELETE";
GatewayDispatchEvents["MessageCreate"] = "MESSAGE_CREATE";
GatewayDispatchEvents["MessageDelete"] = "MESSAGE_DELETE";
GatewayDispatchEvents["MessageDeleteBulk"] = "MESSAGE_DELETE_BULK";
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["StageInstanceCreate"] = "STAGE_INSTANCE_CREATE";
GatewayDispatchEvents["StageInstanceDelete"] = "STAGE_INSTANCE_DELETE";
GatewayDispatchEvents["StageInstanceUpdate"] = "STAGE_INSTANCE_UPDATE";
GatewayDispatchEvents["Ready"] = "READY";
GatewayDispatchEvents["Resumed"] = "RESUMED";
GatewayDispatchEvents["TypingStart"] = "TYPING_START";
GatewayDispatchEvents["UserUpdate"] = "USER_UPDATE";
GatewayDispatchEvents["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE";
GatewayDispatchEvents["VoiceStateUpdate"] = "VOICE_STATE_UPDATE";
GatewayDispatchEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE";
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 || (exports.GatewayDispatchEvents = GatewayDispatchEvents = {}));
// #endregion Shared
//# sourceMappingURL=v8.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"v8.js","sourceRoot":"","sources":["v8.ts"],"names":[],"mappings":"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"}

View File

@@ -1,8 +0,0 @@
import mod from "./v8.js";
export default mod;
export const GatewayCloseCodes = mod.GatewayCloseCodes;
export const GatewayDispatchEvents = mod.GatewayDispatchEvents;
export const GatewayIntentBits = mod.GatewayIntentBits;
export const GatewayOpcodes = mod.GatewayOpcodes;
export const GatewayVersion = mod.GatewayVersion;

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,260 +0,0 @@
"use strict";
/**
* 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.GatewayVersion = '9';
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
*/
var GatewayOpcodes;
(function (GatewayOpcodes) {
/**
* An event was dispatched
*/
GatewayOpcodes[GatewayOpcodes["Dispatch"] = 0] = "Dispatch";
/**
* A bidirectional opcode to maintain an active gateway connection.
* Fired periodically by the client, or fired by the gateway to request an immediate heartbeat from the client.
*/
GatewayOpcodes[GatewayOpcodes["Heartbeat"] = 1] = "Heartbeat";
/**
* Starts a new session during the initial handshake
*/
GatewayOpcodes[GatewayOpcodes["Identify"] = 2] = "Identify";
/**
* Update the client's presence
*/
GatewayOpcodes[GatewayOpcodes["PresenceUpdate"] = 3] = "PresenceUpdate";
/**
* Used to join/leave or move between voice channels
*/
GatewayOpcodes[GatewayOpcodes["VoiceStateUpdate"] = 4] = "VoiceStateUpdate";
/**
* Resume a previous session that was disconnected
*/
GatewayOpcodes[GatewayOpcodes["Resume"] = 6] = "Resume";
/**
* You should attempt to reconnect and resume immediately
*/
GatewayOpcodes[GatewayOpcodes["Reconnect"] = 7] = "Reconnect";
/**
* Request information about offline guild members in a large guild
*/
GatewayOpcodes[GatewayOpcodes["RequestGuildMembers"] = 8] = "RequestGuildMembers";
/**
* The session has been invalidated. You should reconnect and identify/resume accordingly
*/
GatewayOpcodes[GatewayOpcodes["InvalidSession"] = 9] = "InvalidSession";
/**
* Sent immediately after connecting, contains the `heartbeat_interval` to use
*/
GatewayOpcodes[GatewayOpcodes["Hello"] = 10] = "Hello";
/**
* Sent in response to receiving a heartbeat to acknowledge that it has been received
*/
GatewayOpcodes[GatewayOpcodes["HeartbeatAck"] = 11] = "HeartbeatAck";
})(GatewayOpcodes || (exports.GatewayOpcodes = GatewayOpcodes = {}));
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
*/
var GatewayCloseCodes;
(function (GatewayCloseCodes) {
/**
* We're not sure what went wrong. Try reconnecting?
*/
GatewayCloseCodes[GatewayCloseCodes["UnknownError"] = 4000] = "UnknownError";
/**
* 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
*/
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
*/
GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError";
/**
* You sent us a payload prior to identifying
*
* See 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
*/
GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed";
/**
* You sent more than one identify payload. Don't do that!
*/
GatewayCloseCodes[GatewayCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated";
/**
* 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
*/
GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq";
/**
* Woah nelly! You're sending payloads to us too quickly. Slow it down! You will be disconnected on receiving this
*/
GatewayCloseCodes[GatewayCloseCodes["RateLimited"] = 4008] = "RateLimited";
/**
* Your session timed out. Reconnect and start a new one
*/
GatewayCloseCodes[GatewayCloseCodes["SessionTimedOut"] = 4009] = "SessionTimedOut";
/**
* You sent us an invalid shard when identifying
*
* See 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
*/
GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired";
/**
* You sent an invalid version for the gateway
*/
GatewayCloseCodes[GatewayCloseCodes["InvalidAPIVersion"] = 4012] = "InvalidAPIVersion";
/**
* 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
*/
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
*/
GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents";
})(GatewayCloseCodes || (exports.GatewayCloseCodes = GatewayCloseCodes = {}));
/**
* https://discord.com/developers/docs/topics/gateway#list-of-intents
*/
var GatewayIntentBits;
(function (GatewayIntentBits) {
GatewayIntentBits[GatewayIntentBits["Guilds"] = 1] = "Guilds";
GatewayIntentBits[GatewayIntentBits["GuildMembers"] = 2] = "GuildMembers";
GatewayIntentBits[GatewayIntentBits["GuildModeration"] = 4] = "GuildModeration";
/**
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
*/
GatewayIntentBits[GatewayIntentBits["GuildBans"] = 4] = "GuildBans";
GatewayIntentBits[GatewayIntentBits["GuildEmojisAndStickers"] = 8] = "GuildEmojisAndStickers";
GatewayIntentBits[GatewayIntentBits["GuildIntegrations"] = 16] = "GuildIntegrations";
GatewayIntentBits[GatewayIntentBits["GuildWebhooks"] = 32] = "GuildWebhooks";
GatewayIntentBits[GatewayIntentBits["GuildInvites"] = 64] = "GuildInvites";
GatewayIntentBits[GatewayIntentBits["GuildVoiceStates"] = 128] = "GuildVoiceStates";
GatewayIntentBits[GatewayIntentBits["GuildPresences"] = 256] = "GuildPresences";
GatewayIntentBits[GatewayIntentBits["GuildMessages"] = 512] = "GuildMessages";
GatewayIntentBits[GatewayIntentBits["GuildMessageReactions"] = 1024] = "GuildMessageReactions";
GatewayIntentBits[GatewayIntentBits["GuildMessageTyping"] = 2048] = "GuildMessageTyping";
GatewayIntentBits[GatewayIntentBits["DirectMessages"] = 4096] = "DirectMessages";
GatewayIntentBits[GatewayIntentBits["DirectMessageReactions"] = 8192] = "DirectMessageReactions";
GatewayIntentBits[GatewayIntentBits["DirectMessageTyping"] = 16384] = "DirectMessageTyping";
GatewayIntentBits[GatewayIntentBits["GuildScheduledEvents"] = 65536] = "GuildScheduledEvents";
GatewayIntentBits[GatewayIntentBits["AutoModerationConfiguration"] = 1048576] = "AutoModerationConfiguration";
GatewayIntentBits[GatewayIntentBits["AutoModerationExecution"] = 2097152] = "AutoModerationExecution";
GatewayIntentBits[GatewayIntentBits["GuildMessagePolls"] = 16777216] = "GuildMessagePolls";
GatewayIntentBits[GatewayIntentBits["DirectMessagePolls"] = 33554432] = "DirectMessagePolls";
})(GatewayIntentBits || (exports.GatewayIntentBits = GatewayIntentBits = {}));
/**
* https://discord.com/developers/docs/topics/gateway-events#receive-events
*/
var GatewayDispatchEvents;
(function (GatewayDispatchEvents) {
GatewayDispatchEvents["ApplicationCommandPermissionsUpdate"] = "APPLICATION_COMMAND_PERMISSIONS_UPDATE";
GatewayDispatchEvents["ChannelCreate"] = "CHANNEL_CREATE";
GatewayDispatchEvents["ChannelDelete"] = "CHANNEL_DELETE";
GatewayDispatchEvents["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE";
GatewayDispatchEvents["ChannelUpdate"] = "CHANNEL_UPDATE";
GatewayDispatchEvents["GuildBanAdd"] = "GUILD_BAN_ADD";
GatewayDispatchEvents["GuildBanRemove"] = "GUILD_BAN_REMOVE";
GatewayDispatchEvents["GuildCreate"] = "GUILD_CREATE";
GatewayDispatchEvents["GuildDelete"] = "GUILD_DELETE";
GatewayDispatchEvents["GuildEmojisUpdate"] = "GUILD_EMOJIS_UPDATE";
GatewayDispatchEvents["GuildIntegrationsUpdate"] = "GUILD_INTEGRATIONS_UPDATE";
GatewayDispatchEvents["GuildMemberAdd"] = "GUILD_MEMBER_ADD";
GatewayDispatchEvents["GuildMemberRemove"] = "GUILD_MEMBER_REMOVE";
GatewayDispatchEvents["GuildMembersChunk"] = "GUILD_MEMBERS_CHUNK";
GatewayDispatchEvents["GuildMemberUpdate"] = "GUILD_MEMBER_UPDATE";
GatewayDispatchEvents["GuildRoleCreate"] = "GUILD_ROLE_CREATE";
GatewayDispatchEvents["GuildRoleDelete"] = "GUILD_ROLE_DELETE";
GatewayDispatchEvents["GuildRoleUpdate"] = "GUILD_ROLE_UPDATE";
GatewayDispatchEvents["GuildStickersUpdate"] = "GUILD_STICKERS_UPDATE";
GatewayDispatchEvents["GuildUpdate"] = "GUILD_UPDATE";
GatewayDispatchEvents["IntegrationCreate"] = "INTEGRATION_CREATE";
GatewayDispatchEvents["IntegrationDelete"] = "INTEGRATION_DELETE";
GatewayDispatchEvents["IntegrationUpdate"] = "INTEGRATION_UPDATE";
GatewayDispatchEvents["InteractionCreate"] = "INTERACTION_CREATE";
GatewayDispatchEvents["InviteCreate"] = "INVITE_CREATE";
GatewayDispatchEvents["InviteDelete"] = "INVITE_DELETE";
GatewayDispatchEvents["MessageCreate"] = "MESSAGE_CREATE";
GatewayDispatchEvents["MessageDelete"] = "MESSAGE_DELETE";
GatewayDispatchEvents["MessageDeleteBulk"] = "MESSAGE_DELETE_BULK";
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["StageInstanceCreate"] = "STAGE_INSTANCE_CREATE";
GatewayDispatchEvents["StageInstanceDelete"] = "STAGE_INSTANCE_DELETE";
GatewayDispatchEvents["StageInstanceUpdate"] = "STAGE_INSTANCE_UPDATE";
GatewayDispatchEvents["Ready"] = "READY";
GatewayDispatchEvents["Resumed"] = "RESUMED";
GatewayDispatchEvents["ThreadCreate"] = "THREAD_CREATE";
GatewayDispatchEvents["ThreadDelete"] = "THREAD_DELETE";
GatewayDispatchEvents["ThreadListSync"] = "THREAD_LIST_SYNC";
GatewayDispatchEvents["ThreadMembersUpdate"] = "THREAD_MEMBERS_UPDATE";
GatewayDispatchEvents["ThreadMemberUpdate"] = "THREAD_MEMBER_UPDATE";
GatewayDispatchEvents["ThreadUpdate"] = "THREAD_UPDATE";
GatewayDispatchEvents["TypingStart"] = "TYPING_START";
GatewayDispatchEvents["UserUpdate"] = "USER_UPDATE";
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 = {}));
// #endregion Shared
//# sourceMappingURL=v9.js.map

View File

@@ -1 +0,0 @@
{"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;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;;GAEG;AACH,IAAY,iBA8EX;AA9ED,WAAY,iBAAiB;IAC5B;;OAEG;IACH,4EAAoB,CAAA;IACpB;;;;OAIG;IACH,8EAAa,CAAA;IACb;;;;OAIG;IACH,0EAAW,CAAA;IACX;;;;OAIG;IACH,oFAAgB,CAAA;IAChB;;;;OAIG;IACH,4FAAoB,CAAA;IACpB;;OAEG;IACH,4FAAoB,CAAA;IACpB;;;;OAIG;IACH,wEAAkB,CAAA;IAClB;;OAEG;IACH,0EAAW,CAAA;IACX;;OAEG;IACH,kFAAe,CAAA;IACf;;;;OAIG;IACH,4EAAY,CAAA;IACZ;;;;OAIG;IACH,oFAAgB,CAAA;IAChB;;OAEG;IACH,sFAAiB,CAAA;IACjB;;;;OAIG;IACH,gFAAc,CAAA;IACd;;;;;;;OAOG;IACH,sFAAiB,CAAA;AAClB,CAAC,EA9EW,iBAAiB,iCAAjB,iBAAiB,QA8E5B;AAED;;GAEG;AACH,IAAY,iBAyBX;AAzBD,WAAY,iBAAiB;IAC5B,6DAAe,CAAA;IACf,yEAAqB,CAAA;IACrB,+EAAwB,CAAA;IACxB;;OAEG;IACH,mEAA2B,CAAA;IAC3B,6FAA+B,CAAA;IAC/B,oFAA0B,CAAA;IAC1B,4EAAsB,CAAA;IACtB,0EAAqB,CAAA;IACrB,mFAAyB,CAAA;IACzB,+EAAuB,CAAA;IACvB,6EAAsB,CAAA;IACtB,8FAA+B,CAAA;IAC/B,wFAA4B,CAAA;IAC5B,gFAAwB,CAAA;IACxB,gGAAgC,CAAA;IAChC,2FAA6B,CAAA;IAC7B,6FAA8B,CAAA;IAC9B,6GAAqC,CAAA;IACrC,qGAAiC,CAAA;IACjC,0FAA2B,CAAA;IAC3B,4FAA4B,CAAA;AAC7B,CAAC,EAzBW,iBAAiB,iCAAjB,iBAAiB,QAyB5B;AAED;;GAEG;AACH,IAAY,qBAmEX;AAnED,WAAY,qBAAqB;IAChC,uGAA8E,CAAA;IAC9E,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,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,4DAAmC,CAAA;IACnC,sEAA6C,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"}

View File

@@ -1,8 +0,0 @@
import mod from "./v9.js";
export default mod;
export const GatewayCloseCodes = mod.GatewayCloseCodes;
export const GatewayDispatchEvents = mod.GatewayDispatchEvents;
export const GatewayIntentBits = mod.GatewayIntentBits;
export const GatewayOpcodes = mod.GatewayOpcodes;
export const GatewayVersion = mod.GatewayVersion;

View File

@@ -1,92 +0,0 @@
/**
* https://discord.com/developers/docs/reference#snowflakes
*/
export type Snowflake = string;
/**
* https://discord.com/developers/docs/topics/permissions
*
* @internal
*/
export type Permissions = string;
/**
* https://discord.com/developers/docs/reference#message-formatting-formats
*/
export declare const FormattingPatterns: {
/**
* Regular expression for matching a user mention, strictly without a nickname
*
* The `id` group property is present on the `exec` result of this expression
*/
readonly User: RegExp;
/**
* Regular expression for matching a user mention, strictly with a nickname
*
* The `id` group property is present on the `exec` result of this expression
*
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
*/
readonly UserWithNickname: RegExp;
/**
* Regular expression for matching a user mention, with or without a nickname
*
* The `id` group property is present on the `exec` result of this expression
*
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
*/
readonly UserWithOptionalNickname: RegExp;
/**
* Regular expression for matching a channel mention
*
* The `id` group property is present on the `exec` result of this expression
*/
readonly Channel: RegExp;
/**
* Regular expression for matching a role mention
*
* The `id` group property is present on the `exec` result of this expression
*/
readonly Role: RegExp;
/**
* Regular expression for matching a application command mention
*
* The `fullName` (possibly including `name`, `subcommandOrGroup` and `subcommand`) and `id` group properties are present on the `exec` result of this expression
*/
readonly SlashCommand: RegExp;
/**
* Regular expression for matching a custom emoji, either static or animated
*
* The `animated`, `name` and `id` group properties are present on the `exec` result of this expression
*/
readonly Emoji: RegExp;
/**
* Regular expression for matching strictly an animated custom emoji
*
* The `animated`, `name` and `id` group properties are present on the `exec` result of this expression
*/
readonly AnimatedEmoji: RegExp;
/**
* Regular expression for matching strictly a static custom emoji
*
* The `name` and `id` group properties are present on the `exec` result of this expression
*/
readonly StaticEmoji: RegExp;
/**
* Regular expression for matching a timestamp, either default or custom styled
*
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
*/
readonly Timestamp: RegExp;
/**
* Regular expression for matching strictly default styled timestamps
*
* The `timestamp` group property is present on the `exec` result of this expression
*/
readonly DefaultStyledTimestamp: RegExp;
/**
* Regular expression for matching strictly custom styled timestamps
*
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
*/
readonly StyledTimestamp: RegExp;
};
//# sourceMappingURL=globals.d.ts.map

View File

@@ -1 +0,0 @@
{"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"}

View File

@@ -1,94 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormattingPatterns = void 0;
/**
* https://discord.com/developers/docs/reference#message-formatting-formats
*/
exports.FormattingPatterns = {
/**
* Regular expression for matching a user mention, strictly without a nickname
*
* The `id` group property is present on the `exec` result of this expression
*/
User: /<@(?<id>\d{17,20})>/,
/**
* Regular expression for matching a user mention, strictly with a nickname
*
* The `id` group property is present on the `exec` result of this expression
*
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
*/
UserWithNickname: /<@!(?<id>\d{17,20})>/,
/**
* Regular expression for matching a user mention, with or without a nickname
*
* The `id` group property is present on the `exec` result of this expression
*
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
*/
UserWithOptionalNickname: /<@!?(?<id>\d{17,20})>/,
/**
* Regular expression for matching a channel mention
*
* The `id` group property is present on the `exec` result of this expression
*/
Channel: /<#(?<id>\d{17,20})>/,
/**
* Regular expression for matching a role mention
*
* The `id` group property is present on the `exec` result of this expression
*/
Role: /<@&(?<id>\d{17,20})>/,
/**
* Regular expression for matching a application command mention
*
* 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
/<\/(?<fullName>(?<name>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32})(?: (?<subcommandOrGroup>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?(?: (?<subcommand>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?):(?<id>\d{17,20})>/u,
/**
* Regular expression for matching a custom emoji, either static or animated
*
* The `animated`, `name` and `id` group properties are present on the `exec` result of this expression
*/
Emoji: /<(?<animated>a)?:(?<name>\w{2,32}):(?<id>\d{17,20})>/,
/**
* Regular expression for matching strictly an animated custom emoji
*
* The `animated`, `name` and `id` group properties are present on the `exec` result of this expression
*/
AnimatedEmoji: /<(?<animated>a):(?<name>\w{2,32}):(?<id>\d{17,20})>/,
/**
* Regular expression for matching strictly a static custom emoji
*
* The `name` and `id` group properties are present on the `exec` result of this expression
*/
StaticEmoji: /<:(?<name>\w{2,32}):(?<id>\d{17,20})>/,
/**
* Regular expression for matching a timestamp, either default or custom styled
*
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
*/
// eslint-disable-next-line prefer-named-capture-group
Timestamp: /<t:(?<timestamp>-?\d{1,13})(:(?<style>[DFRTdft]))?>/,
/**
* Regular expression for matching strictly default styled timestamps
*
* The `timestamp` group property is present on the `exec` result of this expression
*/
DefaultStyledTimestamp: /<t:(?<timestamp>-?\d{1,13})>/,
/**
* Regular expression for matching strictly custom styled timestamps
*
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
*/
StyledTimestamp: /<t:(?<timestamp>-?\d{1,13}):(?<style>[DFRTdft])>/,
};
/**
* Freezes the formatting patterns
*
* @internal
*/
Object.freeze(exports.FormattingPatterns);
//# sourceMappingURL=globals.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"globals.js","sourceRoot":"","sources":["globals.ts"],"names":[],"mappings":";;;AAYA;;GAEG;AACU,QAAA,kBAAkB,GAAG;IACjC;;;;OAIG;IACH,IAAI,EAAE,qBAAqB;IAC3B;;;;;;OAMG;IACH,gBAAgB,EAAE,sBAAsB;IACxC;;;;;;OAMG;IACH,wBAAwB,EAAE,uBAAuB;IACjD;;;;OAIG;IACH,OAAO,EAAE,qBAAqB;IAC9B;;;;OAIG;IACH,IAAI,EAAE,sBAAsB;IAC5B;;;;OAIG;IACH,YAAY;IACX,mDAAmD;IACnD,2PAA2P;IAC5P;;;;OAIG;IACH,KAAK,EAAE,sDAAsD;IAC7D;;;;OAIG;IACH,aAAa,EAAE,qDAAqD;IACpE;;;;OAIG;IACH,WAAW,EAAE,uCAAuC;IACpD;;;;OAIG;IACH,sDAAsD;IACtD,SAAS,EAAE,qDAAqD;IAChE;;;;OAIG;IACH,sBAAsB,EAAE,8BAA8B;IACtD;;;;OAIG;IACH,eAAe,EAAE,kDAAkD;CAC1D,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,CAAC,0BAAkB,CAAC,CAAC"}

View File

@@ -1,4 +0,0 @@
import mod from "./globals.js";
export default mod;
export const FormattingPatterns = mod.FormattingPatterns;

View File

@@ -1,204 +0,0 @@
{
"name": "discord-api-types",
"version": "0.37.83",
"description": "Discord API typings that are kept up to date for use in bot library creation.",
"homepage": "https://discord-api-types.dev",
"exports": {
"./globals": {
"types": "./globals.d.ts",
"require": "./globals.js",
"import": "./globals.mjs"
},
"./v6": {
"types": "./v6.d.ts",
"require": "./v6.js",
"import": "./v6.mjs"
},
"./v8": {
"types": "./v8.d.ts",
"require": "./v8.js",
"import": "./v8.mjs"
},
"./v9": {
"types": "./v9.d.ts",
"require": "./v9.js",
"import": "./v9.mjs"
},
"./v10": {
"types": "./v10.d.ts",
"require": "./v10.js",
"import": "./v10.mjs"
},
"./gateway": {
"types": "./gateway/index.d.ts",
"require": "./gateway/index.js",
"import": "./gateway/index.mjs"
},
"./gateway/v*": {
"types": "./gateway/v*.d.ts",
"require": "./gateway/v*.js",
"import": "./gateway/v*.mjs"
},
"./payloads": {
"types": "./payloads/index.d.ts",
"require": "./payloads/index.js",
"import": "./payloads/index.mjs"
},
"./payloads/v*": {
"types": "./payloads/v*/index.d.ts",
"require": "./payloads/v*/index.js",
"import": "./payloads/v*/index.mjs"
},
"./rest": {
"types": "./rest/index.d.ts",
"require": "./rest/index.js",
"import": "./rest/index.mjs"
},
"./rest/v*": {
"types": "./rest/v*/index.d.ts",
"require": "./rest/v*/index.js",
"import": "./rest/v*/index.mjs"
},
"./rpc": {
"types": "./rpc/index.d.ts",
"require": "./rpc/index.js",
"import": "./rpc/index.mjs"
},
"./rpc/v*": {
"types": "./rpc/v*.d.ts",
"require": "./rpc/v*.js",
"import": "./rpc/v*.mjs"
},
"./voice": {
"types": "./voice/index.d.ts",
"require": "./voice/index.js",
"import": "./voice/index.mjs"
},
"./voice/v*": {
"types": "./voice/v*.d.ts",
"require": "./voice/v*.js",
"import": "./voice/v*.mjs"
},
"./utils": {
"types": "./utils/index.d.ts",
"require": "./utils/index.js",
"import": "./utils/index.mjs"
},
"./utils/v*": {
"types": "./utils/v*.d.ts",
"require": "./utils/v*.js",
"import": "./utils/v*.mjs"
}
},
"scripts": {
"build:ci": "tsc --noEmit --incremental false",
"build:deno": "node ./scripts/deno.mjs",
"build:node": "tsc && run-p esm:*",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
"ci:pr": "run-s changelog lint build:deno && node ./scripts/bump-website-version.mjs",
"clean:deno": "rimraf deno/",
"clean:node": "rimraf --glob \"{gateway,payloads,rest,rpc,voice,utils}/**/*.{js,mjs,d.ts,*map}\" \"{globals,v*}.{js,mjs,d.ts,*map}\"",
"clean": "run-p clean:*",
"esm:gateway": "gen-esm-wrapper ./gateway/index.js ./gateway/index.mjs",
"esm:globals": "gen-esm-wrapper ./globals.js ./globals.mjs",
"esm:payloads": "gen-esm-wrapper ./payloads/index.js ./payloads/index.mjs",
"esm:rest": "gen-esm-wrapper ./rest/index.js ./rest/index.mjs",
"esm:rpc": "gen-esm-wrapper ./rpc/index.js ./rpc/index.mjs",
"esm:utils": "gen-esm-wrapper ./utils/index.js ./utils/index.mjs",
"esm:versions": "node ./scripts/versions.mjs",
"esm:voice": "gen-esm-wrapper ./voice/index.js ./voice/index.mjs",
"lint": "prettier --write . && eslint --fix --ext mjs,ts \"{gateway,payloads,rest,rpc,voice,utils}/**/*.ts\" \"{globals,v*}.ts\" \"scripts/**/*.mjs\"",
"postpublish": "run-s clean:node build:deno",
"prepare": "tsc -p ./.eslint-plugin-local && (is-ci || husky)",
"prepublishOnly": "run-s clean test:lint build:node",
"test:lint": "prettier --check . && eslint --ext mjs,ts \"{gateway,payloads,rest,rpc,voice,utils}/**/*.ts\" \"{globals,v*}.ts\" \"scripts/**/*.mjs\"",
"pretest:types": "tsc",
"test:types": "tsd -t ./v10.d.ts",
"posttest:types": "npm run clean:node"
},
"keywords": [
"discord",
"discord api",
"types",
"discordjs"
],
"author": "Vlad Frangu <kingdgrizzle@gmail.com>",
"license": "MIT",
"files": [
"{gateway,payloads,rest,rpc,voice,utils}/**/*.{js,js.map,d.ts,d.ts.map,mjs}",
"{globals,v*}.{js,js.map,d.ts,d.ts.map,mjs}"
],
"devDependencies": {
"@commitlint/cli": "^19.0.3",
"@commitlint/config-angular": "^19.0.3",
"@favware/npm-deprecate": "^1.0.7",
"@octokit/action": "^6.0.7",
"@octokit/webhooks-types": "^7.3.2",
"@sapphire/prettier-config": "^2.0.0",
"@types/conventional-recommended-bump": "^9.0.3",
"@types/node": "^20.11.24",
"@typescript-eslint/utils": "^7.1.1",
"conventional-changelog-cli": "^4.1.0",
"conventional-recommended-bump": "^9.0.0",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.59",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-local": "^4.2.1",
"gen-esm-wrapper": "^1.1.3",
"husky": "^9.0.11",
"is-ci": "^3.0.1",
"lint-staged": "^15.2.2",
"npm-run-all2": "^6.0.0",
"prettier": "^3.2.5",
"pretty-quick": "^4.0.0",
"rimraf": "^5.0.5",
"tsd": "^0.31.0",
"tsutils": "^3.21.0",
"typescript": "^5.3.3"
},
"publishConfig": {
"provenance": true
},
"repository": {
"type": "git",
"url": "https://github.com/discordjs/discord-api-types"
},
"lint-staged": {
"{gateway,payloads,rest,rpc,voice,utils}/**/*.{mjs,js,ts}": "eslint --fix --ext mjs,js,ts",
"{globals,v*}.ts": "eslint --fix --ext mjs,js,ts"
},
"commitlint": {
"extends": [
"@commitlint/config-angular"
],
"rules": {
"type-enum": [
2,
"always",
[
"chore",
"build",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
"types",
"wip"
]
],
"scope-case": [
1,
"always",
"pascal-case"
]
}
},
"tsd": {
"directory": "tests"
}
}

View File

@@ -1,326 +0,0 @@
import type { LocaleString } from '../rest/common';
/**
* https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
*
* These flags are exported as `BigInt`s and NOT numbers. Wrapping them in `Number()`
* may cause issues, try to use BigInts as much as possible or modules that can
* replicate them in some way
*/
export declare const PermissionFlagsBits: {
/**
* Allows creation of instant invites
*
* Applies to channel types: Text, Voice, Stage
*/
readonly CreateInstantInvite: bigint;
/**
* Allows kicking members
*/
readonly KickMembers: bigint;
/**
* Allows banning members
*/
readonly BanMembers: bigint;
/**
* Allows all permissions and bypasses channel permission overwrites
*/
readonly Administrator: bigint;
/**
* Allows management and editing of channels
*
* Applies to channel types: Text, Voice, Stage
*/
readonly ManageChannels: bigint;
/**
* Allows management and editing of the guild
*/
readonly ManageGuild: bigint;
/**
* Allows for the addition of reactions to messages
*
* Applies to channel types: Text, Voice, Stage
*/
readonly AddReactions: bigint;
/**
* Allows for viewing of audit logs
*/
readonly ViewAuditLog: bigint;
/**
* Allows for using priority speaker in a voice channel
*
* Applies to channel types: Voice
*/
readonly PrioritySpeaker: bigint;
/**
* Allows the user to go live
*
* Applies to channel types: Voice, Stage
*/
readonly Stream: bigint;
/**
* Allows guild members to view a channel, which includes reading messages in text channels and joining voice channels
*
* Applies to channel types: Text, Voice, Stage
*/
readonly ViewChannel: bigint;
/**
* Allows for sending messages in a channel and creating threads in a forum
* (does not allow sending messages in threads)
*
* Applies to channel types: Text, Voice, Stage
*/
readonly SendMessages: bigint;
/**
* Allows for sending of `/tts` messages
*
* Applies to channel types: Text, Voice, Stage
*/
readonly SendTTSMessages: bigint;
/**
* Allows for deletion of other users messages
*
* Applies to channel types: Text, Voice, Stage
*/
readonly ManageMessages: bigint;
/**
* Links sent by users with this permission will be auto-embedded
*
* Applies to channel types: Text, Voice, Stage
*/
readonly EmbedLinks: bigint;
/**
* Allows for uploading images and files
*
* Applies to channel types: Text, Voice, Stage
*/
readonly AttachFiles: bigint;
/**
* Allows for reading of message history
*
* Applies to channel types: Text, Voice, Stage
*/
readonly ReadMessageHistory: bigint;
/**
* Allows for using the `@everyone` tag to notify all users in a channel,
* and the `@here` tag to notify all online users in a channel
*
* Applies to channel types: Text, Voice, Stage
*/
readonly MentionEveryone: bigint;
/**
* Allows the usage of custom emojis from other servers
*
* Applies to channel types: Text, Voice, Stage
*/
readonly UseExternalEmojis: bigint;
/**
* Allows for viewing guild insights
*/
readonly ViewGuildInsights: bigint;
/**
* Allows for joining of a voice channel
*
* Applies to channel types: Voice, Stage
*/
readonly Connect: bigint;
/**
* Allows for speaking in a voice channel
*
* Applies to channel types: Voice
*/
readonly Speak: bigint;
/**
* Allows for muting members in a voice channel
*
* Applies to channel types: Voice, Stage
*/
readonly MuteMembers: bigint;
/**
* Allows for deafening of members in a voice channel
*
* Applies to channel types: Voice
*/
readonly DeafenMembers: bigint;
/**
* Allows for moving of members between voice channels
*
* Applies to channel types: Voice, Stage
*/
readonly MoveMembers: bigint;
/**
* Allows for using voice-activity-detection in a voice channel
*
* Applies to channel types: Voice
*/
readonly UseVAD: bigint;
/**
* Allows for modification of own nickname
*/
readonly ChangeNickname: bigint;
/**
* Allows for modification of other users nicknames
*/
readonly ManageNicknames: bigint;
/**
* Allows management and editing of roles
*
* Applies to channel types: Text, Voice, Stage
*/
readonly ManageRoles: bigint;
/**
* Allows management and editing of webhooks
*
* Applies to channel types: Text, Voice, Stage
*/
readonly ManageWebhooks: bigint;
/**
* Allows management and editing of emojis, stickers, and soundboard sounds
*
* @deprecated This is the old name for {@apilink PermissionFlagsBits#ManageGuildExpressions}
*/
readonly ManageEmojisAndStickers: bigint;
/**
* Allows for editing and deleting emojis, stickers, and soundboard sounds created by all users
*/
readonly ManageGuildExpressions: bigint;
/**
* Allows members to use application commands, including slash commands and context menu commands
*
* Applies to channel types: Text, Voice, Stage
*/
readonly UseApplicationCommands: bigint;
/**
* Allows for requesting to speak in stage channels
*
* Applies to channel types: Stage
*/
readonly RequestToSpeak: bigint;
/**
* Allows for editing and deleting scheduled events created by all users
*
* Applies to channel types: Voice, Stage
*/
readonly ManageEvents: bigint;
/**
* Allows for deleting and archiving threads, and viewing all private threads
*
* Applies to channel types: Text
*/
readonly ManageThreads: bigint;
/**
* Allows for creating public and announcement threads
*
* Applies to channel types: Text
*/
readonly CreatePublicThreads: bigint;
/**
* Allows for creating private threads
*
* Applies to channel types: Text
*/
readonly CreatePrivateThreads: bigint;
/**
* Allows the usage of custom stickers from other servers
*
* Applies to channel types: Text, Voice, Stage
*/
readonly UseExternalStickers: bigint;
/**
* Allows for sending messages in threads
*
* Applies to channel types: Text
*/
readonly SendMessagesInThreads: bigint;
/**
* Allows for using Activities (applications with the {@apilink ApplicationFlags.Embedded} flag) in a voice channel
*
* Applies to channel types: Voice
*/
readonly UseEmbeddedActivities: bigint;
/**
* Allows for timing out users to prevent them from sending or reacting to messages in chat and threads,
* and from speaking in voice and stage channels
*/
readonly ModerateMembers: bigint;
/**
* Allows for viewing role subscription insights
*/
readonly ViewCreatorMonetizationAnalytics: bigint;
/**
* Allows for using soundboard in a voice channel
*
* Applies to channel types: Voice
*/
readonly UseSoundboard: bigint;
/**
* Allows for creating emojis, stickers, and soundboard sounds, and editing and deleting those created by the current user
*/
readonly CreateGuildExpressions: bigint;
/**
* Allows for creating scheduled events, and editing and deleting those created by the current user
*
* Applies to channel types: Voice, Stage
*/
readonly CreateEvents: bigint;
/**
* Allows the usage of custom soundboard sounds from other servers
*
* Applies to channel types: Voice
*/
readonly UseExternalSounds: bigint;
/**
* Allows sending voice messages
*
* Applies to channel types: Text, Voice, Stage
*/
readonly SendVoiceMessages: bigint;
/**
* Allows sending polls
*
* Applies to channel types: Text, Voice, Stage
*/
readonly SendPolls: bigint;
};
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json
*/
export interface RESTError {
code: number;
message: string;
errors?: RESTErrorData;
}
export interface RESTErrorFieldInformation {
code: string;
message: string;
}
export interface RESTErrorGroupWrapper {
_errors: RESTErrorData[];
}
export type RESTErrorData = RESTErrorFieldInformation | RESTErrorGroupWrapper | string | {
[k: string]: RESTErrorData;
};
/**
* https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit-rate-limit-response-structure
*/
export interface RESTRateLimit {
/**
* An error code for some limits
*
* {@link RESTJSONErrorCodes}
*/
code?: number;
/**
* A value indicating if you are being globally rate limited or not
*/
global: boolean;
/**
* A message saying you are being rate limited.
*/
message: string;
/**
* The number of seconds to wait before submitting another request.
*/
retry_after: number;
}
//# sourceMappingURL=common.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;IAC/B;;;;OAIG;;IAEH;;OAEG;;IAGH;;OAEG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;;OAKG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;;OAKG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;CAEM,CAAC;AASX,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,MAAM,WAAW,yBAAyB;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACrC,OAAO,EAAE,aAAa,EAAE,CAAC;CACzB;AAED,MAAM,MAAM,aAAa,GAAG,yBAAyB,GAAG,qBAAqB,GAAG,MAAM,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,CAAC;AAExH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACpB"}

View File

@@ -1,293 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PermissionFlagsBits = void 0;
/**
* https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
*
* These flags are exported as `BigInt`s and NOT numbers. Wrapping them in `Number()`
* may cause issues, try to use BigInts as much as possible or modules that can
* replicate them in some way
*/
exports.PermissionFlagsBits = {
/**
* Allows creation of instant invites
*
* Applies to channel types: Text, Voice, Stage
*/
CreateInstantInvite: 1n << 0n,
/**
* Allows kicking members
*/
// eslint-disable-next-line sonarjs/no-identical-expressions
KickMembers: 1n << 1n,
/**
* Allows banning members
*/
BanMembers: 1n << 2n,
/**
* Allows all permissions and bypasses channel permission overwrites
*/
Administrator: 1n << 3n,
/**
* Allows management and editing of channels
*
* Applies to channel types: Text, Voice, Stage
*/
ManageChannels: 1n << 4n,
/**
* Allows management and editing of the guild
*/
ManageGuild: 1n << 5n,
/**
* Allows for the addition of reactions to messages
*
* Applies to channel types: Text, Voice, Stage
*/
AddReactions: 1n << 6n,
/**
* Allows for viewing of audit logs
*/
ViewAuditLog: 1n << 7n,
/**
* Allows for using priority speaker in a voice channel
*
* Applies to channel types: Voice
*/
PrioritySpeaker: 1n << 8n,
/**
* Allows the user to go live
*
* Applies to channel types: Voice, Stage
*/
Stream: 1n << 9n,
/**
* Allows guild members to view a channel, which includes reading messages in text channels and joining voice channels
*
* Applies to channel types: Text, Voice, Stage
*/
ViewChannel: 1n << 10n,
/**
* Allows for sending messages in a channel and creating threads in a forum
* (does not allow sending messages in threads)
*
* Applies to channel types: Text, Voice, Stage
*/
SendMessages: 1n << 11n,
/**
* Allows for sending of `/tts` messages
*
* Applies to channel types: Text, Voice, Stage
*/
SendTTSMessages: 1n << 12n,
/**
* Allows for deletion of other users messages
*
* Applies to channel types: Text, Voice, Stage
*/
ManageMessages: 1n << 13n,
/**
* Links sent by users with this permission will be auto-embedded
*
* Applies to channel types: Text, Voice, Stage
*/
EmbedLinks: 1n << 14n,
/**
* Allows for uploading images and files
*
* Applies to channel types: Text, Voice, Stage
*/
AttachFiles: 1n << 15n,
/**
* Allows for reading of message history
*
* Applies to channel types: Text, Voice, Stage
*/
ReadMessageHistory: 1n << 16n,
/**
* Allows for using the `@everyone` tag to notify all users in a channel,
* and the `@here` tag to notify all online users in a channel
*
* Applies to channel types: Text, Voice, Stage
*/
MentionEveryone: 1n << 17n,
/**
* Allows the usage of custom emojis from other servers
*
* Applies to channel types: Text, Voice, Stage
*/
UseExternalEmojis: 1n << 18n,
/**
* Allows for viewing guild insights
*/
ViewGuildInsights: 1n << 19n,
/**
* Allows for joining of a voice channel
*
* Applies to channel types: Voice, Stage
*/
Connect: 1n << 20n,
/**
* Allows for speaking in a voice channel
*
* Applies to channel types: Voice
*/
Speak: 1n << 21n,
/**
* Allows for muting members in a voice channel
*
* Applies to channel types: Voice, Stage
*/
MuteMembers: 1n << 22n,
/**
* Allows for deafening of members in a voice channel
*
* Applies to channel types: Voice
*/
DeafenMembers: 1n << 23n,
/**
* Allows for moving of members between voice channels
*
* Applies to channel types: Voice, Stage
*/
MoveMembers: 1n << 24n,
/**
* Allows for using voice-activity-detection in a voice channel
*
* Applies to channel types: Voice
*/
UseVAD: 1n << 25n,
/**
* Allows for modification of own nickname
*/
ChangeNickname: 1n << 26n,
/**
* Allows for modification of other users nicknames
*/
ManageNicknames: 1n << 27n,
/**
* Allows management and editing of roles
*
* Applies to channel types: Text, Voice, Stage
*/
ManageRoles: 1n << 28n,
/**
* Allows management and editing of webhooks
*
* Applies to channel types: Text, Voice, Stage
*/
ManageWebhooks: 1n << 29n,
/**
* Allows management and editing of emojis, stickers, and soundboard sounds
*
* @deprecated This is the old name for {@apilink PermissionFlagsBits#ManageGuildExpressions}
*/
ManageEmojisAndStickers: 1n << 30n,
/**
* Allows for editing and deleting emojis, stickers, and soundboard sounds created by all users
*/
ManageGuildExpressions: 1n << 30n,
/**
* Allows members to use application commands, including slash commands and context menu commands
*
* Applies to channel types: Text, Voice, Stage
*/
UseApplicationCommands: 1n << 31n,
/**
* Allows for requesting to speak in stage channels
*
* Applies to channel types: Stage
*/
RequestToSpeak: 1n << 32n,
/**
* Allows for editing and deleting scheduled events created by all users
*
* Applies to channel types: Voice, Stage
*/
ManageEvents: 1n << 33n,
/**
* Allows for deleting and archiving threads, and viewing all private threads
*
* Applies to channel types: Text
*/
ManageThreads: 1n << 34n,
/**
* Allows for creating public and announcement threads
*
* Applies to channel types: Text
*/
CreatePublicThreads: 1n << 35n,
/**
* Allows for creating private threads
*
* Applies to channel types: Text
*/
CreatePrivateThreads: 1n << 36n,
/**
* Allows the usage of custom stickers from other servers
*
* Applies to channel types: Text, Voice, Stage
*/
UseExternalStickers: 1n << 37n,
/**
* Allows for sending messages in threads
*
* Applies to channel types: Text
*/
SendMessagesInThreads: 1n << 38n,
/**
* Allows for using Activities (applications with the {@apilink ApplicationFlags.Embedded} flag) in a voice channel
*
* Applies to channel types: Voice
*/
UseEmbeddedActivities: 1n << 39n,
/**
* Allows for timing out users to prevent them from sending or reacting to messages in chat and threads,
* and from speaking in voice and stage channels
*/
ModerateMembers: 1n << 40n,
/**
* Allows for viewing role subscription insights
*/
ViewCreatorMonetizationAnalytics: 1n << 41n,
/**
* Allows for using soundboard in a voice channel
*
* Applies to channel types: Voice
*/
UseSoundboard: 1n << 42n,
/**
* Allows for creating emojis, stickers, and soundboard sounds, and editing and deleting those created by the current user
*/
CreateGuildExpressions: 1n << 43n,
/**
* Allows for creating scheduled events, and editing and deleting those created by the current user
*
* Applies to channel types: Voice, Stage
*/
CreateEvents: 1n << 44n,
/**
* Allows the usage of custom soundboard sounds from other servers
*
* Applies to channel types: Voice
*/
UseExternalSounds: 1n << 45n,
/**
* Allows sending voice messages
*
* Applies to channel types: Text, Voice, Stage
*/
SendVoiceMessages: 1n << 46n,
/**
* Allows sending polls
*
* Applies to channel types: Text, Voice, Stage
*/
SendPolls: 1n << 49n,
};
/**
* Freeze the object of bits, preventing any modifications to it
*
* @internal
*/
Object.freeze(exports.PermissionFlagsBits);
//# sourceMappingURL=common.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"common.js","sourceRoot":"","sources":["common.ts"],"names":[],"mappings":"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"}

View File

@@ -1,2 +0,0 @@
export * from './v10/index';
//# sourceMappingURL=index.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAGA,cAAc,aAAa,CAAC"}

View File

@@ -1,20 +0,0 @@
"use strict";
// This file exports all the payloads available in the recommended API version
// Thereby, things MAY break in the future. Try sticking to imports from a specific version
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 });
__exportStar(require("./v10/index"), exports);
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,2FAA2F;;;;;;;;;;;;;;;;AAE3F,8CAA4B"}

View File

@@ -1,76 +0,0 @@
import mod from "./index.js";
export default mod;
export const APIApplicationCommandPermissionsConstant = mod.APIApplicationCommandPermissionsConstant;
export const ActivityFlags = mod.ActivityFlags;
export const ActivityPlatform = mod.ActivityPlatform;
export const ActivityType = mod.ActivityType;
export const AllowedMentionsTypes = mod.AllowedMentionsTypes;
export const ApplicationCommandOptionType = mod.ApplicationCommandOptionType;
export const ApplicationCommandPermissionType = mod.ApplicationCommandPermissionType;
export const ApplicationCommandType = mod.ApplicationCommandType;
export const ApplicationFlags = mod.ApplicationFlags;
export const ApplicationRoleConnectionMetadataType = mod.ApplicationRoleConnectionMetadataType;
export const AttachmentFlags = mod.AttachmentFlags;
export const AuditLogEvent = mod.AuditLogEvent;
export const AuditLogOptionsType = mod.AuditLogOptionsType;
export const AutoModerationActionType = mod.AutoModerationActionType;
export const AutoModerationRuleEventType = mod.AutoModerationRuleEventType;
export const AutoModerationRuleKeywordPresetType = mod.AutoModerationRuleKeywordPresetType;
export const AutoModerationRuleTriggerType = mod.AutoModerationRuleTriggerType;
export const ButtonStyle = mod.ButtonStyle;
export const ChannelFlags = mod.ChannelFlags;
export const ChannelType = mod.ChannelType;
export const ComponentType = mod.ComponentType;
export const ConnectionService = mod.ConnectionService;
export const ConnectionVisibility = mod.ConnectionVisibility;
export const EmbedType = mod.EmbedType;
export const EntitlementType = mod.EntitlementType;
export const ForumLayoutType = mod.ForumLayoutType;
export const GuildDefaultMessageNotifications = mod.GuildDefaultMessageNotifications;
export const GuildExplicitContentFilter = mod.GuildExplicitContentFilter;
export const GuildFeature = mod.GuildFeature;
export const GuildHubType = mod.GuildHubType;
export const GuildMFALevel = mod.GuildMFALevel;
export const GuildMemberFlags = mod.GuildMemberFlags;
export const GuildNSFWLevel = mod.GuildNSFWLevel;
export const GuildOnboardingMode = mod.GuildOnboardingMode;
export const GuildOnboardingPromptType = mod.GuildOnboardingPromptType;
export const GuildPremiumTier = mod.GuildPremiumTier;
export const GuildScheduledEventEntityType = mod.GuildScheduledEventEntityType;
export const GuildScheduledEventPrivacyLevel = mod.GuildScheduledEventPrivacyLevel;
export const GuildScheduledEventStatus = mod.GuildScheduledEventStatus;
export const GuildSystemChannelFlags = mod.GuildSystemChannelFlags;
export const GuildVerificationLevel = mod.GuildVerificationLevel;
export const GuildWidgetStyle = mod.GuildWidgetStyle;
export const IntegrationExpireBehavior = mod.IntegrationExpireBehavior;
export const InteractionResponseType = mod.InteractionResponseType;
export const InteractionType = mod.InteractionType;
export const InviteTargetType = mod.InviteTargetType;
export const InviteType = mod.InviteType;
export const MembershipScreeningFieldType = mod.MembershipScreeningFieldType;
export const MessageActivityType = mod.MessageActivityType;
export const MessageFlags = mod.MessageFlags;
export const MessageType = mod.MessageType;
export const OAuth2Scopes = mod.OAuth2Scopes;
export const OverwriteType = mod.OverwriteType;
export const PermissionFlagsBits = mod.PermissionFlagsBits;
export const PollLayoutType = mod.PollLayoutType;
export const PresenceUpdateStatus = mod.PresenceUpdateStatus;
export const RoleFlags = mod.RoleFlags;
export const SKUFlags = mod.SKUFlags;
export const SKUType = mod.SKUType;
export const SelectMenuDefaultValueType = mod.SelectMenuDefaultValueType;
export const SortOrderType = mod.SortOrderType;
export const StageInstancePrivacyLevel = mod.StageInstancePrivacyLevel;
export const StickerFormatType = mod.StickerFormatType;
export const StickerType = mod.StickerType;
export const TeamMemberMembershipState = mod.TeamMemberMembershipState;
export const TeamMemberRole = mod.TeamMemberRole;
export const TextInputStyle = mod.TextInputStyle;
export const ThreadAutoArchiveDuration = mod.ThreadAutoArchiveDuration;
export const ThreadMemberFlags = mod.ThreadMemberFlags;
export const UserFlags = mod.UserFlags;
export const UserPremiumType = mod.UserPremiumType;
export const VideoQualityMode = mod.VideoQualityMode;
export const WebhookType = mod.WebhookType;

View File

@@ -1,6 +0,0 @@
import type { Snowflake } from '../../../../../globals';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base';
import type { ApplicationCommandOptionType } from './shared';
export type APIApplicationCommandAttachmentOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;
export type APIApplicationCommandInteractionDataAttachmentOption = APIInteractionDataOptionBase<ApplicationCommandOptionType.Attachment, Snowflake>;
//# sourceMappingURL=attachment.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,+BAA+B,EAAE,4BAA4B,EAAE,MAAM,QAAQ,CAAC;AAC5F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAE7D,MAAM,MAAM,qCAAqC,GAChD,+BAA+B,CAAC,4BAA4B,CAAC,UAAU,CAAC,CAAC;AAE1E,MAAM,MAAM,oDAAoD,GAAG,4BAA4B,CAC9F,4BAA4B,CAAC,UAAU,EACvC,SAAS,CACT,CAAC"}

View File

@@ -1,3 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=attachment.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"attachment.js","sourceRoot":"","sources":["attachment.ts"],"names":[],"mappings":""}

View File

@@ -1,23 +0,0 @@
import type { LocalizationMap } from '../../../../../v10';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared';
export interface APIApplicationCommandOptionBase<Type extends ApplicationCommandOptionType> {
type: Type;
name: string;
name_localizations?: LocalizationMap | null;
description: string;
description_localizations?: LocalizationMap | null;
required?: boolean;
}
export interface APIInteractionDataOptionBase<T extends ApplicationCommandOptionType, D> {
name: string;
type: T;
value: D;
}
export type APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<Base extends APIApplicationCommandOptionBase<ApplicationCommandOptionType>, ChoiceType extends APIApplicationCommandOptionChoice> = (Base & {
autocomplete: true;
choices?: [];
}) | (Base & {
autocomplete?: false;
choices?: ChoiceType[];
});
//# sourceMappingURL=base.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,iCAAiC,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEhG,MAAM,WAAW,+BAA+B,CAAC,IAAI,SAAS,4BAA4B;IACzF,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B,CAAC,CAAC,SAAS,4BAA4B,EAAE,CAAC;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,CAAC,CAAC;CACT;AAED,MAAM,MAAM,2DAA2D,CACtE,IAAI,SAAS,+BAA+B,CAAC,4BAA4B,CAAC,EAC1E,UAAU,SAAS,iCAAiC,IAElD,CAAC,IAAI,GAAG;IACR,YAAY,EAAE,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,EAAE,CAAC;CACZ,CAAC,GACF,CAAC,IAAI,GAAG;IACR,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;CACtB,CAAC,CAAC"}

View File

@@ -1,3 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=base.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"base.js","sourceRoot":"","sources":["base.ts"],"names":[],"mappings":""}

View File

@@ -1,5 +0,0 @@
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base';
import type { ApplicationCommandOptionType } from './shared';
export type APIApplicationCommandBooleanOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Boolean>;
export type APIApplicationCommandInteractionDataBooleanOption = APIInteractionDataOptionBase<ApplicationCommandOptionType.Boolean, boolean>;
//# sourceMappingURL=boolean.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["boolean.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,4BAA4B,EAAE,MAAM,QAAQ,CAAC;AAC5F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAE7D,MAAM,MAAM,kCAAkC,GAAG,+BAA+B,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;AAEvH,MAAM,MAAM,iDAAiD,GAAG,4BAA4B,CAC3F,4BAA4B,CAAC,OAAO,EACpC,OAAO,CACP,CAAC"}

View File

@@ -1,3 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=boolean.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"boolean.js","sourceRoot":"","sources":["boolean.ts"],"names":[],"mappings":""}

Some files were not shown because too many files have changed in this diff Show More