Compare commits

..

98 Commits

Author SHA1 Message Date
Vlad Frangu
b7e8a9f527 chore(release): 0.38.19 🎉 (#1329)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-12 14:56:27 +03:00
Jiralite
e428c7590f refactor(APIInvite): expires_at always present (#1328) 2025-08-12 14:41:50 +03:00
lew
5f9c1e1b1c feat(GatewayActivity): add url & status display type fields (#1326) 2025-08-10 19:44:35 +03:00
renovate[bot]
87b52b7890 chore(deps): lock file maintenance (#1325)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-08 17:30:35 +00:00
renovate[bot]
256911b9ad chore(deps): lock file maintenance (#1324)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-08 12:55:08 +00:00
renovate[bot]
26a6dd5c77 chore(deps): update patch/minor dependencies (#1323)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-08 08:30:04 +00:00
renovate[bot]
a45f0161e7 chore(deps): update eslint/prettier to v8.39.0 (#1322)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-08 04:56:58 +00:00
renovate[bot]
53f47105dc chore(deps): lock file maintenance (#1320)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-01 15:59:51 +03:00
renovate[bot]
36b23c126b chore(deps): update patch/minor dependencies (#1319)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-01 11:49:39 +00:00
renovate[bot]
53ac69e1a7 chore(deps): update dependency eslint to v9.32.0 (#1318)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-01 05:47:39 +00:00
Vlad Frangu
fe08e2d1e2 chore(release): 0.38.18 🎉 (#1317)
Build ran for 4afd0c13fd

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-31 15:37:09 +03:00
Jiralite
4afd0c13fd fix: Deprecate API related to guild ownership (#1316) 2025-07-30 14:39:10 +03:00
Jiralite
03f02a5a9e feat(GuildFeature): add GUILD_TAGS (#1315) 2025-07-30 14:38:21 +03:00
renovate[bot]
b4285c1d7e chore(deps): lock file maintenance (#1314)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-25 15:41:03 +03:00
Vlad Frangu
295276a581 chore(release): 0.38.17 🎉 (#1311)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-25 11:59:26 +03:00
Vlad Frangu
46bb280690 chore: enable automerge for more things
cuz i am lazy
2025-07-25 11:59:04 +03:00
renovate[bot]
cda030d74e chore(deps): update patch/minor dependencies (#1313)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-25 11:58:15 +03:00
renovate[bot]
79534f2e9d chore(deps): update eslint/prettier to v8.38.0 (#1312)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-25 06:24:27 +00:00
Jiralite
e6c12634e9 ci: disallow changes to these directories (#829) 2025-07-24 14:58:31 +03:00
Jiralite
a41e646d3d feat(GuildMemberFlags): add AutoModQuarantinedGuildTag (#1309) 2025-07-24 14:57:06 +03:00
Jiralite
a72e4545a3 feat(auditLog): add AUTO_MODERATION_QUARANTINE_USER (#1310) 2025-07-24 14:56:34 +03:00
Vlad Frangu
0785436e2f chore: find replace? 2025-07-23 00:21:44 +03:00
Vlad Frangu
5cd2511798 docs: generate routes interfaces automatically on build (#1308) 2025-07-23 00:15:59 +03:00
renovate[bot]
b760be279a chore(deps): lock file maintenance (#1305)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-18 15:22:54 +03:00
renovate[bot]
c47e14570d chore(deps): update patch/minor dependencies (#1304)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-18 13:58:06 +03:00
renovate[bot]
30f95bc938 chore(deps): update eslint/prettier (#1303)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-18 13:57:48 +03:00
dependabot[bot]
fe220db046 chore(deps): bump on-headers and compression in /website (#1302)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-18 13:57:38 +03:00
Vlad Frangu
2f3b892feb chore(release): 0.38.16 🎉 (#1301)
Build ran for 574e5c12bd

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-13 19:41:15 +03:00
Jiralite
574e5c12bd fix(APIApplicationCommandChannelOption): exclude directory channels (#1300) 2025-07-13 19:33:21 +03:00
renovate[bot]
3eb77eb89e chore(deps): lock file maintenance (#1299)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-11 13:45:21 +03:00
renovate[bot]
cbee43cdcd chore(deps): update patch/minor dependencies (#1298)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-11 13:37:43 +03:00
renovate[bot]
ecb4c336c0 chore(deps): update eslint/prettier to v8.36.0 (#1297)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-11 13:37:36 +03:00
renovate[bot]
9b68f04fb7 chore(deps): lock file maintenance (#1296)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-10 14:01:32 +03:00
renovate[bot]
82f8ec4366 chore(deps): update eslint/prettier (#1294)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-05 22:42:26 +03:00
renovate[bot]
92b6632981 chore(deps): update patch/minor dependencies (#1295)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-05 22:42:16 +03:00
Vlad Frangu
a8faa02857 chore(release): 0.38.15 🎉 (#1293)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-03 15:33:22 +03:00
Danial Raza
1fee6339bf fix(CDNRoutes): correct guildTagBadge route (#1291) 2025-07-02 19:17:33 +03:00
Danial Raza
3245f7de92 feat: user guild tags (#1287) 2025-07-02 12:39:15 +03:00
Vlad Frangu
b238cc5b67 chore(release): 0.38.14 🎉 (#1288)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-01 00:10:38 +03:00
renovate[bot]
e2ce6a3d2d chore(deps): lock file maintenance (#1286)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-27 13:07:17 +03:00
renovate[bot]
f1d456de8c chore(deps): update eslint/prettier (#1284)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vlad Frangu <me@vladfrangu.dev>
2025-06-27 13:04:35 +03:00
Jiralite
71c6d2609f feat: support new pinned messages routes (#1254) 2025-06-27 13:01:20 +03:00
Danial Raza
7fbb3e3310 feat: role gradient colors (#1281) 2025-06-27 12:58:57 +03:00
renovate[bot]
ef1f32acd0 chore(deps): update patch/minor dependencies (#1285)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-27 12:57:05 +03:00
Snazzah
6b05db5a2f feat(voice): add close codes 4021 and 4022 (#1283) 2025-06-27 12:56:39 +03:00
Qjuh
ab926eb038 chore: fix weird issue with api-extractor (#1282) 2025-06-27 01:18:07 +03:00
Vlad Frangu
3e394aa44b chore(release): 0.38.13 🎉 (#1280)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-23 15:32:39 +03:00
renovate[bot]
077623299d chore(deps): lock file maintenance (#1279)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-20 13:59:52 +03:00
renovate[bot]
fa5ab47b5e chore(deps): lock file maintenance (#1278)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-20 13:57:30 +03:00
Almeida
77cb32746f feat(APIUser): add collectibles (#1274) 2025-06-20 13:57:05 +03:00
renovate[bot]
60e2b679f8 chore(deps): update patch/minor dependencies (#1277)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-20 13:47:28 +03:00
renovate[bot]
818d4ee6e7 chore(deps): update eslint/prettier (#1276)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-20 13:47:08 +03:00
Vlad Frangu
31f07f9e5b chore(release): 0.38.12 🎉 (#1275)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-16 15:33:24 +03:00
Danial Raza
91d851628d feat(APIApplication): add approximate_user_authorization_count (#1272) 2025-06-14 18:30:28 +03:00
Danial Raza
b2da18c634 feat(APIUnfurledMediaItem): add attachment_id (#1273) 2025-06-14 17:44:06 +03:00
renovate[bot]
9ae89dd9d8 chore(deps): lock file maintenance (#1269)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-07 16:20:42 +03:00
renovate[bot]
c60f8d2e29 chore(deps): update patch/minor dependencies (#1268)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-07 16:16:23 +03:00
renovate[bot]
bb713c0aec chore(deps): update eslint/prettier (#1267)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-07 16:15:50 +03:00
renovate[bot]
28bb65f85a chore(config): migrate config renovate.json (#1266)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-07 16:12:13 +03:00
Almeida
c76dd317b4 docs: resolved api-extractor warnings (#1265) 2025-06-07 00:52:14 +03:00
Qjuh
6df612809b refactor: omit most omits (#1249) 2025-06-06 23:42:44 +03:00
Jiralite
7a18245abf refactor: remove @unstable (#1264) 2025-06-06 21:09:25 +03:00
Vlad Frangu
ba70b0573c chore(release): 0.38.11 🎉 (#1263)
Build ran for d71276cb5f

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-04 10:17:27 +03:00
Snazzah
d71276cb5f fix(voice): fix remaining payload typos (#1262) 2025-06-04 10:01:32 +03:00
Snazzah
121fb47f4c fix(voice): add clients connect and client disconnect recieve payload (#1261) 2025-06-04 02:06:39 +03:00
Snazzah
83d34ef00c fix(voice): add max_dave_protocol_version to identify (#1260) 2025-06-03 08:46:14 +03:00
Snazzah
c670a2551a chore(docs): add voice v8 to docs (#1259) 2025-06-03 01:09:08 +03:00
Snazzah
ebf313c49c feat: voice v8 payloads & MLS voice opcodes (#1257) 2025-06-03 00:07:22 +03:00
Vlad Frangu
1d8f79e6b2 chore(release): 0.38.10 🎉 (#1258)
Build ran for 7d92c012c7

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-02 15:31:09 +03:00
Vlad Frangu
7d92c012c7 chore: move to ts eslint config 2025-05-31 16:18:18 +03:00
Vlad Frangu
5d72696e20 chore(release): 0.38.9 🎉 (#1256)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-31 14:15:15 +03:00
Vlad Frangu
10bf20b000 chore: ci pains 2025-05-31 14:12:26 +03:00
Vlad Frangu
b16b065d04 chore: too much yarn 2025-05-31 14:11:06 +03:00
Vlad Frangu
61cda0c1fb chore: eslint 9 (#1255) 2025-05-31 14:07:16 +03:00
Vlad Frangu
7020afbe84 chore: fin 2025-05-31 13:22:17 +03:00
Vlad Frangu
a2f3a7e79b chore: yarn why 2025-05-31 13:19:58 +03:00
Vlad Frangu
a51261d2f2 chore: yarn please publish 2025-05-31 13:09:28 +03:00
Vlad Frangu
de98a67b41 chore: ci 2025-05-31 13:02:22 +03:00
Vlad Frangu
a822bc3f77 chore: pains 2025-05-31 12:59:01 +03:00
Vlad Frangu
923aae517f chore: fix yarn postinstallDev 2025-05-31 12:51:05 +03:00
Vlad Frangu
8c61ed12dc chore: now it all works 2025-05-31 12:45:54 +03:00
Vlad Frangu
e37ebed680 chore: move to yarn
fuck npm
2025-05-31 12:41:31 +03:00
Vlad Frangu
3cfa7f8ea7 chore: ?? 2025-05-31 12:24:56 +03:00
Vlad Frangu
f4b750062d chore: bumper move 2025-05-31 12:20:00 +03:00
Vlad Frangu
0909412254 chore: bump conventional stuff 2025-05-31 12:16:19 +03:00
renovate[bot]
58fa897069 chore(deps): lock file maintenance (#1207)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-31 11:57:39 +03:00
renovate[bot]
b7857315c4 chore(deps): update dependency @octokit/action to v8 (#1252)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-31 11:37:50 +03:00
Vlad Frangu
64855f3451 chore: no typechecking node_modules 2025-05-31 11:32:34 +03:00
renovate[bot]
da23f132f4 chore(deps): update patch/minor dependencies (#1251)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-31 11:24:02 +03:00
Jiralite
9daac44f1d feat: deauthorised webhook events (#1253) 2025-05-31 11:23:46 +03:00
Qjuh
72b8c830ee fix: discriminated thread channel types (#1247) 2025-05-25 14:47:12 +03:00
Almeida
b360b2e6a7 fix: optional client_id and client_secret in access token data (#1248) 2025-05-17 19:22:57 +03:00
renovate[bot]
544bd94be5 chore(deps): update dependency lint-staged to v16 (#1246)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-16 08:43:33 +03:00
dependabot[bot]
f25ea9dd1f chore(deps): bump undici from 6.21.1 to 6.21.3 (#1244)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-16 08:43:23 +03:00
renovate[bot]
c531fe2ff1 chore(deps): update dependency eslint-import-resolver-typescript to v4 (#1211)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-16 08:43:10 +03:00
renovate[bot]
8d56c85160 chore(deps): update patch/minor dependencies (#1245)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-16 08:42:23 +03:00
Vlad Frangu
653bba0bad chore(release): 0.38.8 🎉 (#1243)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-15 16:09:54 +03:00
Vlad Frangu
90711463b6 chore: fix docs ci 2 2025-05-15 16:03:09 +03:00
186 changed files with 18272 additions and 19105 deletions

View File

@@ -1,187 +0,0 @@
import { AST_NODE_TYPES, ESLintUtils, TSESTree } from '@typescript-eslint/utils';
import * as typescript from 'typescript';
import * as tsutils from 'tsutils';
type Options = [
{
interfaceEndings: string[];
},
];
function shouldRun(eslNode: TSESTree.TSPropertySignature, interfaceEndings: string[]): boolean {
// The first parent is the TSInterfaceBody, the second is the TSInterfaceDeclaration
const interfaceNode = eslNode.parent?.parent;
if (!(interfaceNode && 'id' in interfaceNode && interfaceNode.id?.type === AST_NODE_TYPES.Identifier)) {
return false;
}
const { name } = interfaceNode.id;
if (typeof name !== 'string') {
return false;
}
return interfaceEndings.some((ending) => name.endsWith(ending));
}
const schema = [
{
type: 'object',
properties: {
interfaceEndings: {
type: 'array',
items: {
type: 'string',
},
},
},
},
] as const;
const REST_TYPE_NAME_REGEX =
/^REST(?:Get|Patch|Post|Put|Delete)[a-zA-Z0-9]+(?:JSONBody|FormDataBody|URLEncodedData|Result|Query)$/;
export = {
rules: {
'explicitly-optional-undefined-properties': ESLintUtils.RuleCreator.withoutDocs<Options, 'missingOptional'>({
create: (context) => {
const { interfaceEndings } = context.options[0];
return {
TSPropertySignature: (eslNode) => {
if (!shouldRun(eslNode, interfaceEndings)) {
return;
}
if (eslNode.optional) {
return;
}
const parserServices = ESLintUtils.getParserServices(context);
const checker = parserServices.program.getTypeChecker();
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(eslNode);
const type = checker.getApparentType(checker.getTypeAtLocation(tsNode));
const unionParts = tsutils.unionTypeParts(type);
// If our prop is not optional, but has undefined in its union, we should report
if (!unionParts.some((ty) => tsutils.isTypeFlagSet(ty, typescript.TypeFlags.Undefined))) {
return;
}
context.report({
node: eslNode,
messageId: 'missingOptional',
fix: (fixer) => fixer.insertTextAfter(eslNode.key, '?'),
});
},
};
},
meta: {
fixable: 'code',
messages: {
missingOptional: 'When a property has `| undefined`, it should be marked as optional.',
},
type: 'problem',
schema: schema,
},
defaultOptions: [{ interfaceEndings: [] }],
}),
'explicit-undefined-on-optional-properties': ESLintUtils.RuleCreator.withoutDocs<Options, 'missingUndefined'>({
create: (context) => {
const { interfaceEndings } = context.options[0];
return {
// This is done naively because type-checking the node will always include `| undefined`
// due to it being optional. ideally, we'd have a way to get the type of the node disregarding
// the optional flag, which would make this check a lot more trivial
TSPropertySignature: (eslNode) => {
if (!shouldRun(eslNode, interfaceEndings)) {
return;
}
// If our prop is't optional or if it doesn't have a type annotation, we don't need to do anything
if (!eslNode.optional || !eslNode.typeAnnotation) {
return;
}
const { typeAnnotation } = eslNode.typeAnnotation;
switch (typeAnnotation.type) {
case AST_NODE_TYPES.TSUnionType: {
if (typeAnnotation.types.some((t) => t.type === AST_NODE_TYPES.TSUndefinedKeyword)) {
return;
}
break;
}
case AST_NODE_TYPES.TSUndefinedKeyword: {
return;
}
}
context.report({
node: eslNode,
messageId: 'missingUndefined',
fix: (fixer) => fixer.insertTextAfter(eslNode.typeAnnotation!, ' | undefined'),
});
},
};
},
meta: {
fixable: 'code',
messages: {
missingUndefined: 'When a property is optional, explicitly include `undefined` in the union.',
},
type: 'suggestion',
schema: schema,
},
defaultOptions: [{ interfaceEndings: [] }],
}),
'rest-type-naming-convention': ESLintUtils.RuleCreator.withoutDocs<[{ whitelist: string[] }], 'invalidName'>({
create: (context) => {
const { whitelist } = context.options[0];
const whitelistSet = new Set(whitelist);
return {
'TSTypeAliasDeclaration, TSInterfaceDeclaration': (
node: TSESTree.TSTypeAliasDeclaration | TSESTree.TSInterfaceDeclaration,
) => {
if (node.id.type !== AST_NODE_TYPES.Identifier) {
return;
}
const { name } = node.id;
if (whitelistSet.has(name)) {
return;
}
if (!REST_TYPE_NAME_REGEX.test(name)) {
context.report({
node: node.id,
messageId: 'invalidName',
data: { name },
});
}
},
};
},
meta: {
messages: {
invalidName: `{{ name }} does not match REST type naming convention. Must match ${REST_TYPE_NAME_REGEX.source}.`,
},
type: 'problem',
schema: [
{
type: 'object',
properties: {
whitelist: {
type: 'array',
items: {
type: 'string',
},
},
},
},
] as const,
},
defaultOptions: [{ whitelist: [] }],
}),
},
};

View File

@@ -1,9 +0,0 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"declaration": false,
"declarationMap": false,
"skipLibCheck": true
},
"include": ["./index.ts"]
}

View File

@@ -1,14 +0,0 @@
deno/
gateway/v6/*
payloads/v6/*
rest/v6/*
v6.ts
gateway/v8/*
payloads/v8/*
rest/v8/*
utils/v8.ts
v8.ts
djs/**/*

View File

@@ -1,73 +0,0 @@
{
"extends": ["neon/common", "neon/node", "neon/typescript", "neon/prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.eslint.json"
},
"plugins": ["local"],
"rules": {
"local/explicit-undefined-on-optional-properties": ["error", { "interfaceEndings": ["JSONBody"] }],
"local/explicitly-optional-undefined-properties": ["error", { "interfaceEndings": ["JSONBody"] }],
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/prefer-literal-enum-member": "off",
"@typescript-eslint/sort-type-union-intersection-members": "off",
"import/extensions": "off",
"tsdoc/syntax": "off",
"typescript-sort-keys/interface": "off",
"typescript-sort-keys/string-enum": "off",
"unicorn/prefer-math-trunc": "off",
"jsdoc/no-undefined-types": "off"
},
"overrides": [
{
"files": ["rest/v10/*.ts", "rest/v9/*.ts"],
"excludedFiles": ["rest/v10/index.ts", "rest/v9/index.ts"],
"rules": {
"local/rest-type-naming-convention": [
"error",
{
"whitelist": [
"RESTAPIAttachment",
"RESTAPIChannelPatchOverwrite",
"RESTAPIGuildChannelResolvable",
"RESTAPIGuildCreateOverwrite",
"RESTAPIGuildCreatePartialChannel",
"RESTAPIGuildCreateRole",
"RESTAPIGuildOnboardingPrompt",
"RESTAPIGuildOnboardingPromptOption",
"RESTAPIInteractionCallbackActivityInstanceResource",
"RESTAPIInteractionCallbackObject",
"RESTAPIInteractionCallbackResourceObject",
"RESTAPIMessageReference",
"RESTAPIPartialCurrentUserGuild",
"RESTAPIPoll",
"RESTOAuth2AdvancedBotAuthorizationQuery",
"RESTOAuth2AdvancedBotAuthorizationQueryResult",
"RESTOAuth2AuthorizationQuery",
"RESTOAuth2BotAuthorizationQuery",
"RESTOAuth2ImplicitAuthorizationQuery",
"RESTOAuth2ImplicitAuthorizationURLFragmentResult",
// Deprecated types
"APIChannelPatchOverwrite",
"APIGuildChannelResolvable",
"APIGuildCreateOverwrite",
"APIGuildCreatePartialChannel",
"APIGuildCreateRole",
"APIMessageReferenceSend",
"GetAPIVoiceRegionsResult",
"RESTAPIModifyGuildOnboardingPromptData",
"RESTAPIModifyGuildOnboardingPromptOptionData",
"RESTAPIPollCreate",
"RESTDeleteAPIChannelMessageOwnReaction",
"RESTGetAPIStickerPack",
"RESTOAuth2AuthorizationQueryResult",
"RESTPostAPIEntitlementBody"
]
}
]
}
}
]
}

View File

@@ -13,11 +13,9 @@
- Checkout a topic branch from a base branch, e.g. `main`, and merge back against that branch.
- If adding a new feature:
- Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it.
- If fixing a bug:
- If you are resolving a special issue, add `fix/close #xxxx[,#xxxx]` (#xxxx is the issue id) in your PR body for a better release log, e.g.
```

View File

@@ -1,32 +0,0 @@
name: Deno
on:
pull_request:
types:
- opened
- synchronize
jobs:
check_deno:
name: Ensure Deno types are in sync with the code
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Use Node.js v20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
run: npm ci
- name: Run Check Script
run: node ./scripts/actions/report-deno-not-ran.mjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -17,21 +17,20 @@ jobs:
- name: Add problem matcher
run: echo "::add-matcher::.github/problemMatchers/eslint.json" && echo "::add-matcher::.github/problemMatchers/tsc.json"
- name: Use Node.js v20
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
registry-url: https://registry.npmjs.org/
cache: 'yarn'
node-version-file: package.json
- name: Install dependencies
run: npm ci
- name: Install Dependencies
run: yarn
- name: Check lint on discord-api-types
run: npm run test:lint
run: yarn test:lint
- name: Run TSC
run: npm run build:ci
run: yarn build:ci
- name: Run Type Tests
run: npm run test:types
run: yarn test:types

View File

@@ -21,14 +21,14 @@ jobs:
with:
fetch-depth: 0
- name: Install Node v20
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
cache: 'yarn'
node-version-file: package.json
- name: Install dependencies
run: npm ci
- name: Install Dependencies
run: yarn
- name: Install website dependencies
run: pushd website && npm ci --ignore-scripts && popd
@@ -48,7 +48,7 @@ jobs:
git checkout -b "chore/release/$(jq --raw-output '.version' package.json)"
# Run changelog generation, deno script, website version bump
npm run ci:pr
yarn ci:pr
# Add all changes, commit and push
git add --all .
@@ -77,19 +77,20 @@ jobs:
with:
fetch-depth: 0
- name: Install Node v20
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
cache: 'yarn'
node-version-file: package.json
- name: Install dependencies
run: npm ci
- name: Install Dependencies
run: yarn
- name: Publish release to npm
run: npm publish
run: |
yarn npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Create GitHub release
run: node ./scripts/actions/create-release.mjs

View File

@@ -26,6 +26,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
ACTION_PACKAGE: discord-api-types
jobs:
build-docs:
name: Build & upload documentation
@@ -40,13 +43,14 @@ jobs:
with:
ref: ${{ inputs.ref || '' }}
- name: Install Node.js v22
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'yarn'
node-version-file: package.json
- name: Install dependencies for discord-api-types
run: npm ci
- name: Install Dependencies for discord-api-types
run: yarn
#region DJS start (mostly from discord.js/packages/actions/src/pnpmCache)
# pnpm --filter="*api-*" --filter="scripts" --filter="actions" run build
@@ -119,10 +123,10 @@ jobs:
- name: Build docs
shell: bash
run: |
npm run prepublishOnly
yarn prepack
./djs/packages/api-extractor/bin/api-extractor run --local --minify
./djs/packages/scripts/bin/generateSplitDocumentation.js
npm run postpublish
yarn postpack
- name: Upload documentation to database
if: ${{ env.REF_TYPE == 'tag' && (!inputs.ref || inputs.ref == 'main') }}
@@ -135,10 +139,10 @@ jobs:
CF_R2_DOCS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_DOCS_SECRET_ACCESS_KEY }}
CF_R2_DOCS_BUCKET: ${{ secrets.CF_R2_DOCS_BUCKET }}
CF_R2_DOCS_BUCKET_URL: ${{ secrets.CF_R2_DOCS_BUCKET_URL }}
ACTION_PACKAGE: ${{ steps.extract-tag.outputs.package }}
ACTION_PACKAGE: ${{ env.ACTION_PACKAGE }}
ACTION_VERSION: ${{ steps.extract-tag.outputs.semver }}
run: |
npx tsx ./scripts/actions/documentation/uploadDocumentation.ts
yarn tsx ./scripts/actions/documentation/uploadDocumentation.ts
- name: Upload documentation to database
if: ${{ env.REF_TYPE == 'tag' && inputs.ref && inputs.ref != 'main' }}
@@ -151,10 +155,10 @@ jobs:
CF_R2_DOCS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_DOCS_SECRET_ACCESS_KEY }}
CF_R2_DOCS_BUCKET: ${{ secrets.CF_R2_DOCS_BUCKET }}
CF_R2_DOCS_BUCKET_URL: ${{ secrets.CF_R2_DOCS_BUCKET_URL }}
ACTION_PACKAGE: ${{ steps.extract-tag.outputs.package }}
ACTION_PACKAGE: ${{ env.ACTION_PACKAGE }}
ACTION_VERSION: ${{ steps.extract-tag.outputs.semver }}
run: |
npx tsx ./scripts/actions/documentation/uploadDocumentation.ts
yarn tsx ./scripts/actions/documentation/uploadDocumentation.ts
- name: Upload split documentation to blob storage
if: ${{ env.REF_TYPE == 'tag' && (!inputs.ref || inputs.ref == 'main') }}
@@ -163,10 +167,10 @@ jobs:
CF_R2_DOCS_ACCESS_KEY_ID: ${{ secrets.CF_R2_DOCS_ACCESS_KEY_ID }}
CF_R2_DOCS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_DOCS_SECRET_ACCESS_KEY }}
CF_R2_DOCS_BUCKET: ${{ secrets.CF_R2_DOCS_BUCKET }}
ACTION_PACKAGE: ${{ steps.extract-tag.outputs.package }}
ACTION_PACKAGE: ${{ env.ACTION_PACKAGE }}
ACTION_VERSION: ${{ steps.extract-tag.outputs.semver }}
run: |
npx tsx ./scripts/actions/documentation/uploadSplitDocumentation.ts
yarn tsx ./scripts/actions/documentation/uploadSplitDocumentation.ts
- name: Upload split documentation to blob storage
if: ${{ env.REF_TYPE == 'tag' && inputs.ref && inputs.ref != 'main' }}
@@ -175,10 +179,10 @@ jobs:
CF_R2_DOCS_ACCESS_KEY_ID: ${{ secrets.CF_R2_DOCS_ACCESS_KEY_ID }}
CF_R2_DOCS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_DOCS_SECRET_ACCESS_KEY }}
CF_R2_DOCS_BUCKET: ${{ secrets.CF_R2_DOCS_BUCKET }}
ACTION_PACKAGE: ${{ steps.extract-tag.outputs.package }}
ACTION_PACKAGE: ${{ env.ACTION_PACKAGE }}
ACTION_VERSION: ${{ steps.extract-tag.outputs.semver }}
run: |
npx tsx ./scripts/actions/documentation/uploadSplitDocumentation.ts
yarn tsx ./scripts/actions/documentation/uploadSplitDocumentation.ts
- name: Upload documentation to database
if: ${{ env.REF_TYPE == 'branch' && (!inputs.ref || inputs.ref == 'main') }}
@@ -191,10 +195,10 @@ jobs:
CF_R2_DOCS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_DOCS_SECRET_ACCESS_KEY }}
CF_R2_DOCS_BUCKET: ${{ secrets.CF_R2_DOCS_BUCKET }}
CF_R2_DOCS_BUCKET_URL: ${{ secrets.CF_R2_DOCS_BUCKET_URL }}
ACTION_PACKAGE: ${{ steps.extract-tag.outputs.package }}
ACTION_PACKAGE: ${{ env.ACTION_PACKAGE }}
ACTION_VERSION: ${{ steps.extract-tag.outputs.semver }}
run: |
npx tsx ./scripts/actions/documentation/uploadDocumentation.ts
yarn tsx ./scripts/actions/documentation/uploadDocumentation.ts
- name: Upload documentation to database
if: ${{ env.REF_TYPE == 'branch' && inputs.ref && inputs.ref != 'main' }}
@@ -207,10 +211,10 @@ jobs:
CF_R2_DOCS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_DOCS_SECRET_ACCESS_KEY }}
CF_R2_DOCS_BUCKET: ${{ secrets.CF_R2_DOCS_BUCKET }}
CF_R2_DOCS_BUCKET_URL: ${{ secrets.CF_R2_DOCS_BUCKET_URL }}
ACTION_PACKAGE: ${{ steps.extract-tag.outputs.package }}
ACTION_PACKAGE: ${{ env.ACTION_PACKAGE }}
ACTION_VERSION: ${{ steps.extract-tag.outputs.semver }}
run: |
npx tsx ./scripts/actions/documentation/uploadDocumentation.ts
yarn tsx ./scripts/actions/documentation/uploadDocumentation.ts
- name: Upload split documentation to blob storage
if: ${{ env.REF_TYPE == 'branch' && (!inputs.ref || inputs.ref == 'main') }}
@@ -219,10 +223,10 @@ jobs:
CF_R2_DOCS_ACCESS_KEY_ID: ${{ secrets.CF_R2_DOCS_ACCESS_KEY_ID }}
CF_R2_DOCS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_DOCS_SECRET_ACCESS_KEY }}
CF_R2_DOCS_BUCKET: ${{ secrets.CF_R2_DOCS_BUCKET }}
ACTION_PACKAGE: ${{ steps.extract-tag.outputs.package }}
ACTION_PACKAGE: ${{ env.ACTION_PACKAGE }}
ACTION_VERSION: ${{ steps.extract-tag.outputs.semver }}
run: |
npx tsx ./scripts/actions/documentation/uploadSplitDocumentation.ts
yarn tsx ./scripts/actions/documentation/uploadSplitDocumentation.ts
- name: Upload split documentation to blob storage
if: ${{ env.REF_TYPE == 'branch' && inputs.ref && inputs.ref != 'main' }}
@@ -231,7 +235,7 @@ jobs:
CF_R2_DOCS_ACCESS_KEY_ID: ${{ secrets.CF_R2_DOCS_ACCESS_KEY_ID }}
CF_R2_DOCS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_DOCS_SECRET_ACCESS_KEY }}
CF_R2_DOCS_BUCKET: ${{ secrets.CF_R2_DOCS_BUCKET }}
ACTION_PACKAGE: ${{ steps.extract-tag.outputs.package }}
ACTION_PACKAGE: ${{ env.ACTION_PACKAGE }}
ACTION_VERSION: ${{ steps.extract-tag.outputs.semver }}
run: |
npx tsx ./scripts/actions/documentation/uploadSplitDocumentation.ts
yarn tsx ./scripts/actions/documentation/uploadSplitDocumentation.ts

View File

@@ -13,41 +13,40 @@ jobs:
cancel-in-progress: true
name: Publish @next release to npm
runs-on: ubuntu-latest
permissions:
id-token: write
if: github.repository_owner == 'discordjs' && !(github.event_name == 'push' && startsWith(github.event.head_commit.message, 'chore(release)'))
steps:
# - name: Cancel previous publish attempts
# uses: styfle/cancel-workflow-action@0.12.1
# with:
# access_token: ${{ github.token }}
if: github.repository_owner == 'discordjs' && !(github.event_name == 'push' && startsWith(github.event.head_commit.message, 'chore(release)'))
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Node v20
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
cache: 'yarn'
node-version-file: package.json
- name: Install dependencies
run: npm ci
- name: Install Dependencies
run: yarn
- name: Bump version
run: node ./scripts/bump-version.mjs
- name: Deprecate old @next versions
run: npx npm-deprecate --name "*next*" --package discord-api-types --message "No longer supported. Install the latest @next release" || true
run: yarn npm-deprecate --name "*next*" --package discord-api-types --message "No longer supported. Install the latest @next release" || true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Publish new @next version
run: |
npm version $(jq --raw-output '.version' package.json)-next.$(git rev-parse --short HEAD).$(date +%s)
npm publish --tag next
yarn version $(jq --raw-output '.version' package.json)-next.$(git rev-parse --short HEAD).$(date +%s)
yarn npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

View File

@@ -0,0 +1,41 @@
name: Validate Pull Request
on:
pull_request:
jobs:
deno:
name: Ensure Deno types are synchronized
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: 'yarn'
node-version-file: package.json
- name: Install Dependencies
run: yarn
- name: Run Check Script
run: node ./scripts/actions/report-deno-not-ran.mjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
validate-supported-versions:
runs-on: ubuntu-latest
name: Disallow unsupported API versions
steps:
- name: Check for unsupported API changes
env:
GH_TOKEN: ${{ github.token }}
run: |
PATTERNS="gateway/v6.ts|gateway/v8.ts|payloads/v6/|payloads/v8/|rest/v6/|rest/v8/|rpc/v8.ts|utils/v8.ts|voice/v8.ts|^v6.ts$|^v8.ts$"
if gh pr view ${{ github.event.pull_request.number }} --repo ${{github.repository}} --json files --jq ".files[].path | select(test(\"$PATTERNS\"))" | grep -q .; then
echo "::error::Unsupported API versions modified. Please make changes to current API versions only."
exit 1
fi

3
.gitignore vendored
View File

@@ -1,4 +1,5 @@
node_modules/
.yarn/install-state.gz
# Custom ESLint rules
.eslint-plugin-local/*
@@ -65,3 +66,5 @@ docs/*
# djs repo clone
djs
_generated_

View File

@@ -1 +1 @@
npx --no-install commitlint --edit $1
yarn commitlint --edit $1

View File

@@ -1 +1 @@
npx --no-install pretty-quick --staged && npx --no-install lint-staged && npm run build:deno && git add deno
yarn pretty-quick --staged && yarn lint-staged && yarn build:deno && git add deno

View File

@@ -13,12 +13,12 @@ website/build
# Don't format build outputs
*.js
!eslint.config.js
*.d.ts
*.mjs
# Miscellaneous
CODEOWNERS
renovate.json
CHANGELOG.md
# Format all of scripts
@@ -36,3 +36,7 @@ payloads/v8/*
rest/v8/*
utils/v8.ts
v8.ts
.yarn/*
djs/*
_generated_

67
.yarn/plugins/postinstallDev.cjs vendored Normal file
View File

@@ -0,0 +1,67 @@
/**
* Altered from https://github.com/sachinraja/yarn-plugin-postinstall-dev/blob/main/sources/index.ts
MIT License
Copyright (c) 2021-2022 Sachin Raja
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.
*/
const scriptName = 'postinstallDev';
module.exports = {
name: 'postinstall-dev-script',
factory: (require) => ({
hooks: {
/**
* @param {import('@yarnpkg/core').Project} project
* @param {Parameters<import('@yarnpkg/core').Hooks['afterAllInstalled']>[1]} options
*/
async afterAllInstalled(project, options) {
/**
* @type {import('@yarnpkg/core')}
*/
const { scriptUtils, InstallMode } = require('@yarnpkg/core');
if (options.mode === InstallMode.UpdateLockfile) {
return;
}
const locator = project.topLevelWorkspace.anchoredLocator;
if (await scriptUtils.hasPackageScript(locator, scriptName, { project })) {
const exitCode = await scriptUtils.executePackageScript(locator, scriptName, [], {
project,
stdin: process.stdin,
stdout: process.stdout,
stderr: process.stderr,
});
if (exitCode !== 0) {
const error = new Error(`${scriptName} script failed with exit code ${exitCode}`);
error.stack = undefined;
throw error;
}
}
},
},
}),
};

942
.yarn/releases/yarn-4.9.2.cjs vendored Executable file

File diff suppressed because one or more lines are too long

8
.yarnrc.yml Normal file
View File

@@ -0,0 +1,8 @@
enableGlobalCache: true
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-4.9.2.cjs
plugins:
- path: ./.yarn/plugins/postinstallDev.cjs

View File

@@ -1,3 +1,128 @@
## [0.38.19](https://github.com/discordjs/discord-api-types/compare/0.38.18...0.38.19) (2025-08-12)
### Features
* **GatewayActivity:** add url & status display type fields ([#1326](https://github.com/discordjs/discord-api-types/issues/1326)) ([5f9c1e1](https://github.com/discordjs/discord-api-types/commit/5f9c1e1b1c9f1a63d80718629fb2775b7bae62b3))
## [0.38.18](https://github.com/discordjs/discord-api-types/compare/0.38.17...0.38.18) (2025-07-31)
### Bug Fixes
* Deprecate API related to guild ownership ([#1316](https://github.com/discordjs/discord-api-types/issues/1316)) ([4afd0c1](https://github.com/discordjs/discord-api-types/commit/4afd0c13fde05fa7117ecdeaf20534545cfdb005))
### Features
* **GuildFeature:** add `GUILD_TAGS` ([#1315](https://github.com/discordjs/discord-api-types/issues/1315)) ([03f02a5](https://github.com/discordjs/discord-api-types/commit/03f02a5a9ee2e533b58b7790c4deb7ad571e5a92))
## [0.38.17](https://github.com/discordjs/discord-api-types/compare/0.38.16...0.38.17) (2025-07-24)
### Features
* **auditLog:** add `AUTO_MODERATION_QUARANTINE_USER` ([#1310](https://github.com/discordjs/discord-api-types/issues/1310)) ([a72e454](https://github.com/discordjs/discord-api-types/commit/a72e4545a3409388a9c5ec0b5555ecc258de0ac2))
* **GuildMemberFlags:** add `AutoModQuarantinedGuildTag` ([#1309](https://github.com/discordjs/discord-api-types/issues/1309)) ([a41e646](https://github.com/discordjs/discord-api-types/commit/a41e646d3d9b9f6bb15c2f6165043ef8042b26bf))
## [0.38.16](https://github.com/discordjs/discord-api-types/compare/0.38.15...0.38.16) (2025-07-13)
### Bug Fixes
* **APIApplicationCommandChannelOption:** exclude directory channels ([#1300](https://github.com/discordjs/discord-api-types/issues/1300)) ([574e5c1](https://github.com/discordjs/discord-api-types/commit/574e5c12bddd2c515fd2b96b5705b5ef9f9d2787))
## [0.38.15](https://github.com/discordjs/discord-api-types/compare/0.38.14...0.38.15) (2025-07-03)
### Bug Fixes
* **CDNRoutes:** correct `guildTagBadge` route ([#1291](https://github.com/discordjs/discord-api-types/issues/1291)) ([1fee633](https://github.com/discordjs/discord-api-types/commit/1fee6339bf05a98900d8703207c77b8e6d047f24))
### Features
* user guild tags ([#1287](https://github.com/discordjs/discord-api-types/issues/1287)) ([3245f7d](https://github.com/discordjs/discord-api-types/commit/3245f7de92c40d3b74014dbf97a2c0eafea8bcd2))
## [0.38.14](https://github.com/discordjs/discord-api-types/compare/0.38.13...0.38.14) (2025-06-30)
### Features
* role gradient colors ([#1281](https://github.com/discordjs/discord-api-types/issues/1281)) ([7fbb3e3](https://github.com/discordjs/discord-api-types/commit/7fbb3e3310bde5ea0e977afb83ea21bda0220633))
* support new pinned messages routes ([#1254](https://github.com/discordjs/discord-api-types/issues/1254)) ([71c6d26](https://github.com/discordjs/discord-api-types/commit/71c6d2609f1713827e95c5f617011c053cd3eb6a))
* **voice:** add close codes 4021 and 4022 ([#1283](https://github.com/discordjs/discord-api-types/issues/1283)) ([6b05db5](https://github.com/discordjs/discord-api-types/commit/6b05db5a2f9ea540e34e8429c07b96411d418b73))
## [0.38.13](https://github.com/discordjs/discord-api-types/compare/0.38.12...0.38.13) (2025-06-23)
### Features
* **APIUser:** add `collectibles` ([#1274](https://github.com/discordjs/discord-api-types/issues/1274)) ([77cb327](https://github.com/discordjs/discord-api-types/commit/77cb32746f47247a4229910db8ec64f844038529))
## [0.38.12](https://github.com/discordjs/discord-api-types/compare/0.38.11...0.38.12) (2025-06-16)
### Features
* **APIApplication:** add `approximate_user_authorization_count` ([#1272](https://github.com/discordjs/discord-api-types/issues/1272)) ([91d8516](https://github.com/discordjs/discord-api-types/commit/91d851628d2078e70b79e4aa7e464297eca745ce))
* **APIUnfurledMediaItem:** add `attachment_id` ([#1273](https://github.com/discordjs/discord-api-types/issues/1273)) ([b2da18c](https://github.com/discordjs/discord-api-types/commit/b2da18c634c4e20112ce13a8e0a5e6db50063acc))
## [0.38.11](https://github.com/discordjs/discord-api-types/compare/0.38.10...0.38.11) (2025-06-04)
### Bug Fixes
* **voice:** add `max_dave_protocol_version` to identify ([#1260](https://github.com/discordjs/discord-api-types/issues/1260)) ([83d34ef](https://github.com/discordjs/discord-api-types/commit/83d34ef00c4e25d5050c7fc47562b3faa9125215))
* **voice:** add clients connect and client disconnect recieve payload ([#1261](https://github.com/discordjs/discord-api-types/issues/1261)) ([121fb47](https://github.com/discordjs/discord-api-types/commit/121fb47f4c0c51d6149bcf051ffc5bae04b1bba8))
* **voice:** fix remaining payload typos ([#1262](https://github.com/discordjs/discord-api-types/issues/1262)) ([d71276c](https://github.com/discordjs/discord-api-types/commit/d71276cb5f3423a81780494d041694356b8cb49c))
### Features
* voice v8 payloads & MLS voice opcodes ([#1257](https://github.com/discordjs/discord-api-types/issues/1257)) ([ebf313c](https://github.com/discordjs/discord-api-types/commit/ebf313c49c1d78cb1aaf238cfbae7c114f6215cf))
## [0.38.10](https://github.com/discordjs/discord-api-types/compare/0.38.9...0.38.10) (2025-06-02)
## [0.38.9](https://github.com/discordjs/discord-api-types/compare/0.38.8...0.38.9) (2025-05-31)
### Bug Fixes
* discriminated thread channel types ([#1247](https://github.com/discordjs/discord-api-types/issues/1247)) ([72b8c83](https://github.com/discordjs/discord-api-types/commit/72b8c830ee6ed369085644e93b3e27849b0274ed))
* optional `client_id` and `client_secret` in access token data ([#1248](https://github.com/discordjs/discord-api-types/issues/1248)) ([b360b2e](https://github.com/discordjs/discord-api-types/commit/b360b2e6a767fa34d48b2f02fd19511a2db98ecb))
### Features
* deauthorised webhook events ([#1253](https://github.com/discordjs/discord-api-types/issues/1253)) ([9daac44](https://github.com/discordjs/discord-api-types/commit/9daac44f1d056115755e92fcc22995a9c05012be))
## [0.38.8](https://github.com/discordjs/discord-api-types/compare/0.38.7...0.38.8) (2025-05-15)
## [0.38.7](https://github.com/discordjs/discord-api-types/compare/0.38.6...0.38.7) (2025-05-15)

View File

@@ -82,15 +82,12 @@ The exports of each API version is split into three main parts:
- 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).

View File

@@ -7,7 +7,8 @@
"additionalEntryPoints": [
{ "modulePath": "v9", "filePath": "<projectFolder>/v9.d.ts" },
{ "modulePath": "rpc/v10", "filePath": "<projectFolder>/rpc/v10.d.ts" },
{ "modulePath": "voice/v4", "filePath": "<projectFolder>/voice/v4.d.ts" }
{ "modulePath": "voice/v4", "filePath": "<projectFolder>/voice/v4.d.ts" },
{ "modulePath": "voice/v8", "filePath": "<projectFolder>/voice/v8.d.ts" }
],
"bundledPackages": [],

125
deno/CHANGELOG.md generated
View File

@@ -1,3 +1,128 @@
## [0.38.19](https://github.com/discordjs/discord-api-types/compare/0.38.18...0.38.19) (2025-08-12)
### Features
* **GatewayActivity:** add url & status display type fields ([#1326](https://github.com/discordjs/discord-api-types/issues/1326)) ([5f9c1e1](https://github.com/discordjs/discord-api-types/commit/5f9c1e1b1c9f1a63d80718629fb2775b7bae62b3))
## [0.38.18](https://github.com/discordjs/discord-api-types/compare/0.38.17...0.38.18) (2025-07-31)
### Bug Fixes
* Deprecate API related to guild ownership ([#1316](https://github.com/discordjs/discord-api-types/issues/1316)) ([4afd0c1](https://github.com/discordjs/discord-api-types/commit/4afd0c13fde05fa7117ecdeaf20534545cfdb005))
### Features
* **GuildFeature:** add `GUILD_TAGS` ([#1315](https://github.com/discordjs/discord-api-types/issues/1315)) ([03f02a5](https://github.com/discordjs/discord-api-types/commit/03f02a5a9ee2e533b58b7790c4deb7ad571e5a92))
## [0.38.17](https://github.com/discordjs/discord-api-types/compare/0.38.16...0.38.17) (2025-07-24)
### Features
* **auditLog:** add `AUTO_MODERATION_QUARANTINE_USER` ([#1310](https://github.com/discordjs/discord-api-types/issues/1310)) ([a72e454](https://github.com/discordjs/discord-api-types/commit/a72e4545a3409388a9c5ec0b5555ecc258de0ac2))
* **GuildMemberFlags:** add `AutoModQuarantinedGuildTag` ([#1309](https://github.com/discordjs/discord-api-types/issues/1309)) ([a41e646](https://github.com/discordjs/discord-api-types/commit/a41e646d3d9b9f6bb15c2f6165043ef8042b26bf))
## [0.38.16](https://github.com/discordjs/discord-api-types/compare/0.38.15...0.38.16) (2025-07-13)
### Bug Fixes
* **APIApplicationCommandChannelOption:** exclude directory channels ([#1300](https://github.com/discordjs/discord-api-types/issues/1300)) ([574e5c1](https://github.com/discordjs/discord-api-types/commit/574e5c12bddd2c515fd2b96b5705b5ef9f9d2787))
## [0.38.15](https://github.com/discordjs/discord-api-types/compare/0.38.14...0.38.15) (2025-07-03)
### Bug Fixes
* **CDNRoutes:** correct `guildTagBadge` route ([#1291](https://github.com/discordjs/discord-api-types/issues/1291)) ([1fee633](https://github.com/discordjs/discord-api-types/commit/1fee6339bf05a98900d8703207c77b8e6d047f24))
### Features
* user guild tags ([#1287](https://github.com/discordjs/discord-api-types/issues/1287)) ([3245f7d](https://github.com/discordjs/discord-api-types/commit/3245f7de92c40d3b74014dbf97a2c0eafea8bcd2))
## [0.38.14](https://github.com/discordjs/discord-api-types/compare/0.38.13...0.38.14) (2025-06-30)
### Features
* role gradient colors ([#1281](https://github.com/discordjs/discord-api-types/issues/1281)) ([7fbb3e3](https://github.com/discordjs/discord-api-types/commit/7fbb3e3310bde5ea0e977afb83ea21bda0220633))
* support new pinned messages routes ([#1254](https://github.com/discordjs/discord-api-types/issues/1254)) ([71c6d26](https://github.com/discordjs/discord-api-types/commit/71c6d2609f1713827e95c5f617011c053cd3eb6a))
* **voice:** add close codes 4021 and 4022 ([#1283](https://github.com/discordjs/discord-api-types/issues/1283)) ([6b05db5](https://github.com/discordjs/discord-api-types/commit/6b05db5a2f9ea540e34e8429c07b96411d418b73))
## [0.38.13](https://github.com/discordjs/discord-api-types/compare/0.38.12...0.38.13) (2025-06-23)
### Features
* **APIUser:** add `collectibles` ([#1274](https://github.com/discordjs/discord-api-types/issues/1274)) ([77cb327](https://github.com/discordjs/discord-api-types/commit/77cb32746f47247a4229910db8ec64f844038529))
## [0.38.12](https://github.com/discordjs/discord-api-types/compare/0.38.11...0.38.12) (2025-06-16)
### Features
* **APIApplication:** add `approximate_user_authorization_count` ([#1272](https://github.com/discordjs/discord-api-types/issues/1272)) ([91d8516](https://github.com/discordjs/discord-api-types/commit/91d851628d2078e70b79e4aa7e464297eca745ce))
* **APIUnfurledMediaItem:** add `attachment_id` ([#1273](https://github.com/discordjs/discord-api-types/issues/1273)) ([b2da18c](https://github.com/discordjs/discord-api-types/commit/b2da18c634c4e20112ce13a8e0a5e6db50063acc))
## [0.38.11](https://github.com/discordjs/discord-api-types/compare/0.38.10...0.38.11) (2025-06-04)
### Bug Fixes
* **voice:** add `max_dave_protocol_version` to identify ([#1260](https://github.com/discordjs/discord-api-types/issues/1260)) ([83d34ef](https://github.com/discordjs/discord-api-types/commit/83d34ef00c4e25d5050c7fc47562b3faa9125215))
* **voice:** add clients connect and client disconnect recieve payload ([#1261](https://github.com/discordjs/discord-api-types/issues/1261)) ([121fb47](https://github.com/discordjs/discord-api-types/commit/121fb47f4c0c51d6149bcf051ffc5bae04b1bba8))
* **voice:** fix remaining payload typos ([#1262](https://github.com/discordjs/discord-api-types/issues/1262)) ([d71276c](https://github.com/discordjs/discord-api-types/commit/d71276cb5f3423a81780494d041694356b8cb49c))
### Features
* voice v8 payloads & MLS voice opcodes ([#1257](https://github.com/discordjs/discord-api-types/issues/1257)) ([ebf313c](https://github.com/discordjs/discord-api-types/commit/ebf313c49c1d78cb1aaf238cfbae7c114f6215cf))
## [0.38.10](https://github.com/discordjs/discord-api-types/compare/0.38.9...0.38.10) (2025-06-02)
## [0.38.9](https://github.com/discordjs/discord-api-types/compare/0.38.8...0.38.9) (2025-05-31)
### Bug Fixes
* discriminated thread channel types ([#1247](https://github.com/discordjs/discord-api-types/issues/1247)) ([72b8c83](https://github.com/discordjs/discord-api-types/commit/72b8c830ee6ed369085644e93b3e27849b0274ed))
* optional `client_id` and `client_secret` in access token data ([#1248](https://github.com/discordjs/discord-api-types/issues/1248)) ([b360b2e](https://github.com/discordjs/discord-api-types/commit/b360b2e6a767fa34d48b2f02fd19511a2db98ecb))
### Features
* deauthorised webhook events ([#1253](https://github.com/discordjs/discord-api-types/issues/1253)) ([9daac44](https://github.com/discordjs/discord-api-types/commit/9daac44f1d056115755e92fcc22995a9c05012be))
## [0.38.8](https://github.com/discordjs/discord-api-types/compare/0.38.7...0.38.8) (2025-05-15)
## [0.38.7](https://github.com/discordjs/discord-api-types/compare/0.38.6...0.38.7) (2025-05-15)

3
deno/README.md generated
View File

@@ -82,15 +82,12 @@ The exports of each API version is split into three main parts:
- 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).

214
deno/gateway/v10.ts generated
View File

@@ -3,7 +3,6 @@
*/
import type { Snowflake } from '../globals.ts';
import type { GatewayPresenceUpdate } from '../payloads/v10/gateway.ts';
import type {
APIApplication,
APIApplicationCommandPermission,
@@ -16,7 +15,6 @@ import type {
APIGuildMember,
APIGuildScheduledEvent,
APIInteraction,
APIMessage,
APIRole,
APIStageInstance,
APISticker,
@@ -25,8 +23,8 @@ import type {
APIUnavailableGuild,
APIUser,
GatewayActivity,
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
GatewayThreadListSync as RawGatewayThreadListSync,
GatewayPresenceUpdate,
GatewayThreadListSync,
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
APIVoiceState,
InviteTargetType,
@@ -39,11 +37,21 @@ import type {
APISoundboardSound,
GuildChannelType,
ThreadChannelType,
APIBaseGuild,
APIBaseGuildMember,
APIBaseVoiceState,
APIBaseVoiceGuildMember,
APIGuildMemberJoined,
APIFlaggedGuildMember,
APIGuildMemberAvatar,
APIGuildMemberUser,
GatewayGuildMembersChunkPresence,
APIBaseMessage,
} from '../payloads/v10/mod.ts';
import type { ReactionType } from '../rest/v10/mod.ts';
import type { _Nullable } from '../utils/internals.ts';
export * from './common.ts';
export type * from './common.ts';
export const GatewayVersion = '10';
@@ -789,9 +797,7 @@ export type GatewayEntitlementModifyDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
*/
export type GatewayEntitlementCreateDispatchData = Omit<GatewayEntitlementModifyDispatchData, 'ends_at'> & {
ends_at: GatewayEntitlementModifyDispatchData['ends_at'] | null;
};
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
@@ -873,7 +879,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
*/
voice_states: Omit<APIVoiceState, 'guild_id'>[];
voice_states: APIBaseVoiceState[];
/**
* Users in the guild
*
@@ -953,7 +959,7 @@ export type GatewayGuildDeleteDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-delete}
*/
export interface GatewayGuildDeleteDispatchData extends Omit<APIUnavailableGuild, 'unavailable'> {
export interface GatewayGuildDeleteDispatchData extends APIBaseGuild {
/**
* `true` if this guild is unavailable due to an outage
*
@@ -1127,15 +1133,18 @@ export type GatewayGuildMemberUpdateDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-update}
*/
export type GatewayGuildMemberUpdateDispatchData = _Nullable<Pick<APIGuildMember, 'joined_at'>> &
Omit<APIGuildMember, 'deaf' | 'flags' | 'joined_at' | 'mute' | 'user'> &
Partial<Pick<APIGuildMember, 'deaf' | 'flags' | 'mute'>> &
Required<Pick<APIGuildMember, 'avatar' | 'banner' | 'user'>> & {
/**
* The id of the guild
*/
guild_id: Snowflake;
};
export interface GatewayGuildMemberUpdateDispatchData
extends _Nullable<APIGuildMemberJoined>,
APIBaseGuildMember,
Partial<APIBaseVoiceGuildMember>,
Partial<APIFlaggedGuildMember>,
Required<APIGuildMemberAvatar>,
Required<APIGuildMemberUser> {
/**
* The id of the guild
*/
guild_id: Snowflake;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
@@ -1145,11 +1154,6 @@ export type GatewayGuildMembersChunkDispatch = _DataPayload<
GatewayGuildMembersChunkDispatchData
>;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
*/
export type GatewayGuildMembersChunkPresence = Omit<RawGatewayPresenceUpdate, 'guild_id'>;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
*/
@@ -1597,7 +1601,7 @@ export type GatewayMessageCreateDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create}
*/
export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
export interface GatewayMessageCreateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage {}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
@@ -1610,7 +1614,24 @@ export type GatewayMessageUpdateDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
*/
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
export interface GatewayMessageUpdateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage {}
export interface APIGuildMemberNoUser
extends APIBaseGuildMember,
APIFlaggedGuildMember,
APIGuildMemberAvatar,
APIGuildMemberJoined,
APIBaseVoiceGuildMember {}
export interface APIUserWithMember extends APIUser {
/**
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
member?: APIGuildMemberNoUser;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create-message-create-extra-fields}
@@ -1628,17 +1649,13 @@ export interface GatewayMessageEventExtraFields {
*
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
member?: Omit<APIGuildMember, 'user'>;
member?: APIGuildMemberNoUser;
/**
* Users specifically mentioned in the message
*
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
mentions: APIUserWithMember[];
}
/**
@@ -1696,25 +1713,74 @@ export interface GatewayMessageDeleteBulkDispatchData {
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
*/
export type GatewayMessageReactionAddDispatch = GatewayMessageReactionData<GatewayDispatchEvents.MessageReactionAdd>;
export interface GatewayMessageReactionAddDispatchData extends GatewayMessageReactionRemoveDispatchData {
/**
* The member who reacted if this happened in a guild
*
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
member?: APIGuildMember;
/**
* The id of the user that posted the message that was reacted to
*/
message_author_id?: Snowflake;
/**
* Colors used for super-reaction animation in "#rrggbb" format
*/
burst_colors?: string[];
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
*/
export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDispatch['d'];
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
*/
export type GatewayMessageReactionRemoveDispatch = GatewayMessageReactionData<
GatewayDispatchEvents.MessageReactionRemove,
'burst_colors' | 'member' | 'message_author_id'
export type GatewayMessageReactionAddDispatch = _DataPayload<
GatewayDispatchEvents.MessageReactionAdd,
GatewayMessageReactionAddDispatchData
>;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
*/
export type GatewayMessageReactionRemoveDispatchData = GatewayMessageReactionRemoveDispatch['d'];
export interface GatewayMessageReactionRemoveDispatchData {
/**
* The id of the user
*/
user_id: Snowflake;
/**
* The id of the channel
*/
channel_id: Snowflake;
/**
* The id of the message
*/
message_id: Snowflake;
/**
* The id of the guild
*/
guild_id?: Snowflake;
/**
* The emoji used to react
*
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
*/
emoji: APIEmoji;
/**
* True if this is a super-reaction
*/
burst: boolean;
/**
* The type of reaction
*/
type: ReactionType;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
*/
export type GatewayMessageReactionRemoveDispatch = _DataPayload<
GatewayDispatchEvents.MessageReactionRemove,
GatewayMessageReactionRemoveDispatchData
>;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all}
@@ -1758,7 +1824,7 @@ export type GatewayPresenceUpdateDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update}
*/
export type GatewayPresenceUpdateDispatchData = RawGatewayPresenceUpdate;
export type GatewayPresenceUpdateDispatchData = GatewayPresenceUpdate;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-create}
@@ -1810,7 +1876,7 @@ export type GatewayThreadListSyncDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-list-sync}
*/
export type GatewayThreadListSyncDispatchData = RawGatewayThreadListSync;
export type GatewayThreadListSyncDispatchData = GatewayThreadListSync;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-members-update}
@@ -2415,7 +2481,7 @@ export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'state' |
// #endregion Sendable Payloads
// #region Shared
export interface _BasePayload {
export interface _BaseBasePayload {
/**
* Opcode for the payload
*/
@@ -2424,6 +2490,9 @@ export interface _BasePayload {
* Event data
*/
d?: unknown;
}
export interface _BasePayload {
/**
* Sequence number, used for resuming sessions and heartbeats
*/
@@ -2434,10 +2503,10 @@ export interface _BasePayload {
t?: string;
}
export type _NonDispatchPayload = Omit<_BasePayload, 's' | 't'> & {
export interface _NonDispatchPayload extends _BaseBasePayload {
t: null;
s: null;
};
}
export interface _DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends _BasePayload {
op: GatewayOpcodes.Dispatch;
@@ -2445,57 +2514,10 @@ export interface _DataPayload<Event extends GatewayDispatchEvents, D = unknown>
d: D;
}
// This is not used internally anymore, just remains to be non-breaking
export type GatewayMessageReactionData<E extends GatewayDispatchEvents, O extends string = never> = _DataPayload<
E,
Omit<
{
/**
* The id of the user
*/
user_id: Snowflake;
/**
* The id of the channel
*/
channel_id: Snowflake;
/**
* The id of the message
*/
message_id: Snowflake;
/**
* The id of the guild
*/
guild_id?: Snowflake;
/**
* The member who reacted if this happened in a guild
*
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
member?: APIGuildMember;
/**
* The emoji used to react
*
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
*/
emoji: APIEmoji;
/**
* The id of the user that posted the message that was reacted to
*/
message_author_id?: Snowflake;
/**
* True if this is a super-reaction
*/
burst: boolean;
/**
* Colors used for super-reaction animation in "#rrggbb" format
*/
burst_colors: string[];
/**
* The type of reaction
*/
type: ReactionType;
},
O
>
Omit<GatewayMessageReactionAddDispatchData, O>
>;
export interface GatewayMessageReactionRemoveData {

4
deno/gateway/v6.ts generated
View File

@@ -18,7 +18,7 @@ import type {
PresenceUpdateStatus,
} from '../payloads/v6/mod.ts';
export * from './common.ts';
export type * from './common.ts';
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
@@ -313,7 +313,6 @@ export type GatewayReadyDispatch = DataPayload<
*/
export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed, never>;
/* eslint-disable @typescript-eslint/indent */
/**
* https://discord.com/developers/docs/topics/gateway#channel-create
* https://discord.com/developers/docs/topics/gateway#channel-update
@@ -325,7 +324,6 @@ export type GatewayChannelModifyDispatch = DataPayload<
GatewayDispatchEvents.ChannelCreate | GatewayDispatchEvents.ChannelDelete | GatewayDispatchEvents.ChannelUpdate,
APIChannel
>;
/* eslint-enable @typescript-eslint/indent */
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.

2
deno/gateway/v8.ts generated
View File

@@ -26,7 +26,7 @@ import type {
} from '../payloads/v8/mod.ts';
import type { _Nullable } from '../utils/internals.ts';
export * from './common.ts';
export type * from './common.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.

214
deno/gateway/v9.ts generated
View File

@@ -3,7 +3,6 @@
*/
import type { Snowflake } from '../globals.ts';
import type { GatewayPresenceUpdate } from '../payloads/v9/gateway.ts';
import type {
APIApplication,
APIApplicationCommandPermission,
@@ -16,7 +15,6 @@ import type {
APIGuildMember,
APIGuildScheduledEvent,
APIInteraction,
APIMessage,
APIRole,
APIStageInstance,
APISticker,
@@ -25,8 +23,8 @@ import type {
APIUnavailableGuild,
APIUser,
GatewayActivity,
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
GatewayThreadListSync as RawGatewayThreadListSync,
GatewayPresenceUpdate,
GatewayThreadListSync,
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
APIVoiceState,
InviteTargetType,
@@ -39,11 +37,21 @@ import type {
GuildChannelType,
ThreadChannelType,
APIEntitlement,
APIBaseGuild,
APIBaseGuildMember,
APIBaseVoiceState,
APIBaseVoiceGuildMember,
APIFlaggedGuildMember,
APIGuildMemberUser,
APIGuildMemberAvatar,
GatewayGuildMembersChunkPresence,
APIBaseMessage,
APIGuildMemberJoined,
} from '../payloads/v9/mod.ts';
import type { ReactionType } from '../rest/v9/mod.ts';
import type { _Nullable } from '../utils/internals.ts';
export * from './common.ts';
export type * from './common.ts';
export const GatewayVersion = '9';
@@ -788,9 +796,7 @@ export type GatewayEntitlementModifyDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
*/
export type GatewayEntitlementCreateDispatchData = Omit<GatewayEntitlementModifyDispatchData, 'ends_at'> & {
ends_at: GatewayEntitlementModifyDispatchData['ends_at'] | null;
};
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
@@ -872,7 +878,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
*/
voice_states: Omit<APIVoiceState, 'guild_id'>[];
voice_states: APIBaseVoiceState[];
/**
* Users in the guild
*
@@ -952,7 +958,7 @@ export type GatewayGuildDeleteDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-delete}
*/
export interface GatewayGuildDeleteDispatchData extends Omit<APIUnavailableGuild, 'unavailable'> {
export interface GatewayGuildDeleteDispatchData extends APIBaseGuild {
/**
* `true` if this guild is unavailable due to an outage
*
@@ -1126,15 +1132,18 @@ export type GatewayGuildMemberUpdateDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-update}
*/
export type GatewayGuildMemberUpdateDispatchData = _Nullable<Pick<APIGuildMember, 'joined_at'>> &
Omit<APIGuildMember, 'deaf' | 'flags' | 'joined_at' | 'mute' | 'user'> &
Partial<Pick<APIGuildMember, 'deaf' | 'flags' | 'mute'>> &
Required<Pick<APIGuildMember, 'avatar' | 'banner' | 'user'>> & {
/**
* The id of the guild
*/
guild_id: Snowflake;
};
export interface GatewayGuildMemberUpdateDispatchData
extends _Nullable<APIGuildMemberJoined>,
APIBaseGuildMember,
Partial<APIBaseVoiceGuildMember>,
Partial<APIFlaggedGuildMember>,
Required<APIGuildMemberUser>,
Required<APIGuildMemberAvatar> {
/**
* The id of the guild
*/
guild_id: Snowflake;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
@@ -1144,11 +1153,6 @@ export type GatewayGuildMembersChunkDispatch = _DataPayload<
GatewayGuildMembersChunkDispatchData
>;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
*/
export type GatewayGuildMembersChunkPresence = Omit<RawGatewayPresenceUpdate, 'guild_id'>;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
*/
@@ -1596,7 +1600,7 @@ export type GatewayMessageCreateDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create}
*/
export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
export interface GatewayMessageCreateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage {}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
@@ -1609,7 +1613,24 @@ export type GatewayMessageUpdateDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
*/
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
export interface GatewayMessageUpdateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage {}
export interface APIGuildMemberNoUser
extends APIBaseGuildMember,
APIFlaggedGuildMember,
APIGuildMemberAvatar,
APIGuildMemberJoined,
APIBaseVoiceGuildMember {}
export interface APIUserWithMember extends APIUser {
/**
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
member?: APIGuildMemberNoUser;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create-message-create-extra-fields}
@@ -1627,17 +1648,13 @@ export interface GatewayMessageEventExtraFields {
*
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
member?: Omit<APIGuildMember, 'user'>;
member?: APIGuildMemberNoUser;
/**
* Users specifically mentioned in the message
*
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
mentions: APIUserWithMember[];
}
/**
@@ -1695,25 +1712,74 @@ export interface GatewayMessageDeleteBulkDispatchData {
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
*/
export type GatewayMessageReactionAddDispatch = GatewayMessageReactionData<GatewayDispatchEvents.MessageReactionAdd>;
export interface GatewayMessageReactionAddDispatchData extends GatewayMessageReactionRemoveDispatchData {
/**
* The member who reacted if this happened in a guild
*
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
member?: APIGuildMember;
/**
* The id of the user that posted the message that was reacted to
*/
message_author_id?: Snowflake;
/**
* Colors used for super-reaction animation in "#rrggbb" format
*/
burst_colors?: string[];
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
*/
export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDispatch['d'];
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
*/
export type GatewayMessageReactionRemoveDispatch = GatewayMessageReactionData<
GatewayDispatchEvents.MessageReactionRemove,
'burst_colors' | 'member' | 'message_author_id'
export type GatewayMessageReactionAddDispatch = _DataPayload<
GatewayDispatchEvents.MessageReactionAdd,
GatewayMessageReactionAddDispatchData
>;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
*/
export type GatewayMessageReactionRemoveDispatchData = GatewayMessageReactionRemoveDispatch['d'];
export interface GatewayMessageReactionRemoveDispatchData {
/**
* The id of the user
*/
user_id: Snowflake;
/**
* The id of the channel
*/
channel_id: Snowflake;
/**
* The id of the message
*/
message_id: Snowflake;
/**
* The id of the guild
*/
guild_id?: Snowflake;
/**
* The emoji used to react
*
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
*/
emoji: APIEmoji;
/**
* True if this is a super-reaction
*/
burst: boolean;
/**
* The type of reaction
*/
type: ReactionType;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
*/
export type GatewayMessageReactionRemoveDispatch = _DataPayload<
GatewayDispatchEvents.MessageReactionRemove,
GatewayMessageReactionRemoveDispatchData
>;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all}
@@ -1757,7 +1823,7 @@ export type GatewayPresenceUpdateDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update}
*/
export type GatewayPresenceUpdateDispatchData = RawGatewayPresenceUpdate;
export type GatewayPresenceUpdateDispatchData = GatewayPresenceUpdate;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-create}
@@ -1809,7 +1875,7 @@ export type GatewayThreadListSyncDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-list-sync}
*/
export type GatewayThreadListSyncDispatchData = RawGatewayThreadListSync;
export type GatewayThreadListSyncDispatchData = GatewayThreadListSync;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-members-update}
@@ -2414,7 +2480,8 @@ export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'state' |
// #endregion Sendable Payloads
// #region Shared
export interface _BasePayload {
export interface _BaseBasePayload {
/**
* Opcode for the payload
*/
@@ -2423,6 +2490,8 @@ export interface _BasePayload {
* Event data
*/
d?: unknown;
}
export interface _BasePayload extends _BaseBasePayload {
/**
* Sequence number, used for resuming sessions and heartbeats
*/
@@ -2433,10 +2502,10 @@ export interface _BasePayload {
t?: string;
}
export type _NonDispatchPayload = Omit<_BasePayload, 's' | 't'> & {
export interface _NonDispatchPayload extends _BaseBasePayload {
t: null;
s: null;
};
}
export interface _DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends _BasePayload {
op: GatewayOpcodes.Dispatch;
@@ -2444,57 +2513,10 @@ export interface _DataPayload<Event extends GatewayDispatchEvents, D = unknown>
d: D;
}
// This is not used internally anymore, just remains to be non-breaking
export type GatewayMessageReactionData<E extends GatewayDispatchEvents, O extends string = never> = _DataPayload<
E,
Omit<
{
/**
* The id of the user
*/
user_id: Snowflake;
/**
* The id of the channel
*/
channel_id: Snowflake;
/**
* The id of the message
*/
message_id: Snowflake;
/**
* The id of the guild
*/
guild_id?: Snowflake;
/**
* The member who reacted if this happened in a guild
*
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
member?: APIGuildMember;
/**
* The emoji used to react
*
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
*/
emoji: APIEmoji;
/**
* The id of the user that posted the message that was reacted to
*/
message_author_id?: Snowflake;
/**
* True if this is a super-reaction
*/
burst: boolean;
/**
* Colors used for super-reaction animation in "#rrggbb" format
*/
burst_colors?: string[];
/**
* The type of reaction
*/
type: ReactionType;
},
O
>
Omit<GatewayMessageReactionAddDispatchData, O>
>;
export interface GatewayMessageReactionRemoveData {

1
deno/globals.ts generated
View File

@@ -52,7 +52,6 @@ export const FormattingPatterns = {
* The `fullName` (possibly including `name`, `subcommandOrGroup` and `subcommand`) and `id` group properties are present on the `exec` result of this expression
*/
SlashCommand:
// eslint-disable-next-line unicorn/no-unsafe-regex
/<\/(?<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

View File

@@ -17,7 +17,7 @@ export const PermissionFlagsBits = {
/**
* Allows kicking members
*/
// eslint-disable-next-line sonarjs/no-identical-expressions
KickMembers: 1n << 1n,
/**
* Allows banning members

View File

@@ -5,7 +5,7 @@ import type { ApplicationCommandOptionType } from './shared.ts';
export interface APIApplicationCommandChannelOption
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Channel> {
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM | ChannelType.GuildDirectory>[];
}
export type APIApplicationCommandInteractionDataChannelOption = APIInteractionDataOptionBase<

View File

@@ -47,19 +47,19 @@ import type {
} from './_chatInput/user.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
export * from './_chatInput/attachment.ts';
export * from './_chatInput/base.ts';
export * from './_chatInput/boolean.ts';
export * from './_chatInput/channel.ts';
export * from './_chatInput/integer.ts';
export * from './_chatInput/mentionable.ts';
export * from './_chatInput/number.ts';
export * from './_chatInput/role.ts';
export type * from './_chatInput/attachment.ts';
export type * from './_chatInput/base.ts';
export type * from './_chatInput/boolean.ts';
export type * from './_chatInput/channel.ts';
export type * from './_chatInput/integer.ts';
export type * from './_chatInput/mentionable.ts';
export type * from './_chatInput/number.ts';
export type * from './_chatInput/role.ts';
export * from './_chatInput/shared.ts';
export * from './_chatInput/string.ts';
export * from './_chatInput/subcommand.ts';
export * from './_chatInput/subcommandGroup.ts';
export * from './_chatInput/user.ts';
export type * from './_chatInput/string.ts';
export type * from './_chatInput/subcommand.ts';
export type * from './_chatInput/subcommandGroup.ts';
export type * from './_chatInput/user.ts';
/**
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure}

View File

@@ -23,10 +23,10 @@ import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
export * from './_applicationCommands/chatInput.ts';
export * from './_applicationCommands/contextMenu.ts';
export type * from './_applicationCommands/contextMenu.ts';
export * from './_applicationCommands/permissions.ts';
export * from './_applicationCommands/entryPoint.ts';
export * from './_applicationCommands/internals.ts';
export type * from './_applicationCommands/entryPoint.ts';
export type * from './_applicationCommands/internals.ts';
/**
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object}

View File

@@ -9,7 +9,14 @@ import type {
ChannelType,
ThreadChannelType,
} from '../channel.ts';
import type { APIGuildMember, APIPartialInteractionGuild } from '../guild.ts';
import type {
APIBaseGuildMember,
APIFlaggedGuildMember,
APIGuildMember,
APIGuildMemberAvatar,
APIGuildMemberJoined,
APIPartialInteractionGuild,
} from '../guild.ts';
import type { APIEntitlement } from '../monetization.ts';
import type { APIUser } from '../user.ts';
import type { InteractionType } from './responses.ts';
@@ -253,7 +260,11 @@ export type APIInteractionDataResolvedChannel =
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'deaf' | 'mute' | 'user'> {
export interface APIInteractionDataResolvedGuildMember
extends APIBaseGuildMember,
APIFlaggedGuildMember,
APIGuildMemberAvatar,
APIGuildMemberJoined {
permissions: Permissions;
}

View File

@@ -1,4 +1,4 @@
import type { APIActionRowComponent, APIComponentInModalActionRow } from '../channel.ts';
import type { APIBaseComponent } from '../channel.ts';
import type {
APIBaseInteraction,
APIDMInteractionWrapper,
@@ -13,8 +13,7 @@ export interface ModalSubmitComponent {
value: string;
}
export interface ModalSubmitActionRowComponent
extends Omit<APIActionRowComponent<APIComponentInModalActionRow>, 'components'> {
export interface ModalSubmitActionRowComponent extends APIBaseComponent<ComponentType.ActionRow> {
components: ModalSubmitComponent[];
}

View File

@@ -111,9 +111,13 @@ export interface APIApplication {
*/
approximate_guild_count?: number;
/**
* Approximate count of users that have installed the app
* Approximate count of users that have installed the app (authorized with `application.commands` as a scope)
*/
approximate_user_install_count?: number;
/**
* Approximate count of users that have OAuth2 authorizations for the app
*/
approximate_user_authorization_count?: number;
/**
* Array of redirect URIs for the application
*/

View File

@@ -207,6 +207,7 @@ export enum AuditLogEvent {
AutoModerationBlockMessage,
AutoModerationFlagToChannel,
AutoModerationUserCommunicationDisabled,
AutoModerationQuarantineUser,
CreatorMonetizationRequestCreated = 150,
CreatorMonetizationTermsAccepted,
@@ -232,6 +233,7 @@ export interface APIAuditLogOptions {
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
* - AUTO_MODERATION_QUARANTINE_USER
*/
auto_moderation_rule_name?: string;
/**
@@ -241,6 +243,7 @@ export interface APIAuditLogOptions {
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
* - AUTO_MODERATION_QUARANTINE_USER
*/
auto_moderation_rule_trigger_type?: AuditLogRuleTriggerType;
/**
@@ -272,6 +275,7 @@ export interface APIAuditLogOptions {
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
* - AUTO_MODERATION_QUARANTINE_USER
*/
channel_id?: Snowflake;

View File

@@ -13,10 +13,7 @@ import type { APIPoll } from './poll.ts';
import type { APISticker, APIStickerItem } from './sticker.ts';
import type { APIUser } from './user.ts';
/**
* Not documented, but partial only includes id, name, and type
*/
export interface APIPartialChannel {
export interface APIBasePartialChannel {
/**
* The id of the channel
*/
@@ -27,12 +24,20 @@ export interface APIPartialChannel {
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-types}
*/
type: ChannelType;
}
export interface APINameableChannel {
/**
* The name of the channel (1-100 characters)
*/
name?: string | null;
}
/**
* Not documented, but partial only includes id, name, and type
*/
export interface APIPartialChannel extends APIBasePartialChannel, APINameableChannel {}
/**
* A channel obtained from fetching an invite.
*/
@@ -58,7 +63,7 @@ export type APIWebhookSourceChannel = Required<_NonNullableFields<Pick<APIPartia
* This interface is used to allow easy extension for other channel types. While
* also allowing `APIPartialChannel` to be used without breaking.
*/
export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel {
export interface APIChannelBase<T extends ChannelType> extends APIBasePartialChannel {
type: T;
flags?: ChannelFlags;
}
@@ -76,16 +81,7 @@ export type TextChannelType =
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* The id of the last message sent in this channel (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
/**
* When the last pinned message was pinned.
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
*/
last_pin_timestamp?: string | null;
export interface APISlowmodeChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
@@ -98,7 +94,29 @@ export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBa
rate_limit_per_user?: number;
}
export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelBase<T>, 'name'> {
export interface APISortableChannel {
/**
* Sorting position of the channel
*/
position: number;
}
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T>, APISlowmodeChannel<T> {
/**
* The id of the last message sent in this channel (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
}
export interface APIPinChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* When the last pinned message was pinned.
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
*/
last_pin_timestamp?: string | null;
}
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* The name of the channel (1-100 characters)
*/
@@ -113,10 +131,6 @@ export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelB
* @see {@link https://discord.com/developers/docs/resources/channel#overwrite-object}
*/
permission_overwrites?: APIOverwrite[];
/**
* Sorting position of the channel
*/
position: number;
/**
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
*
@@ -134,8 +148,10 @@ export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelB
export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia | GuildTextChannelType>
extends Omit<APITextBasedChannel<T>, 'name'>,
APIGuildChannel<T> {
extends APITextBasedChannel<T>,
APIGuildChannel<T>,
APISortableChannel,
APIPinChannel<T> {
/**
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
*/
@@ -153,11 +169,13 @@ export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelT
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.GuildCategory>, APISortableChannel {}
export interface APIVoiceChannelBase<T extends ChannelType>
extends APIGuildChannel<T>,
Omit<APITextBasedChannel<T>, 'last_pin_timestamp' | 'name'> {
APISortableChannel,
APITextBasedChannel<T>,
APISlowmodeChannel<T> {
/**
* The bitrate (in bits) of the voice or stage channel
*/
@@ -184,7 +202,7 @@ export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
export interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>, APIPinChannel<T> {
/**
* The recipients of the DM
*
@@ -193,14 +211,14 @@ export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBas
recipients?: APIUser[];
}
export interface APIDMChannel extends Omit<APIDMChannelBase<ChannelType.DM>, 'name'> {
export interface APIDMChannel extends APIDMChannelBase<ChannelType.DM> {
/**
* The name of the channel (always null for DM channels)
*/
name: null;
}
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM> {
/**
* The name of the channel (1-100 characters)
*/
@@ -229,9 +247,10 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
export type ThreadChannelType = ChannelType.AnnouncementThread | ChannelType.PrivateThread | ChannelType.PublicThread;
export interface APIThreadChannel
extends Omit<APITextBasedChannel<ThreadChannelType>, 'name'>,
APIGuildChannel<ThreadChannelType> {
export interface APIThreadChannel<Type extends ThreadChannelType = ThreadChannelType>
extends APITextBasedChannel<Type>,
APIGuildChannel<Type>,
APIPinChannel<Type> {
/**
* The client users member for the thread, only included in select endpoints
*/
@@ -266,6 +285,10 @@ export interface APIThreadChannel
applied_tags: Snowflake[];
}
export type APIPublicThreadChannel = APIThreadChannel<ChannelType.PublicThread>;
export type APIPrivateThreadChannel = APIThreadChannel<ChannelType.PrivateThread>;
export type APIAnnouncementThreadChannel = APIThreadChannel<ChannelType.AnnouncementThread>;
/**
* @see {@link https://discord.com/developers/docs/resources/channel#forum-tag-object-forum-tag-structure}
*/
@@ -339,7 +362,8 @@ export enum ForumLayoutType {
}
export interface APIThreadOnlyChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia>
extends APIGuildChannel<T> {
extends APIGuildChannel<T>,
APISortableChannel {
/**
* The channel topic (0-4096 characters)
*/
@@ -398,6 +422,7 @@ export type APIGuildMediaChannel = APIThreadOnlyChannel<ChannelType.GuildMedia>;
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-structure}
*/
export type APIChannel =
| APIAnnouncementThreadChannel
| APIDMChannel
| APIGroupDMChannel
| APIGuildCategoryChannel
@@ -406,8 +431,9 @@ export type APIChannel =
| APIGuildStageVoiceChannel
| APIGuildVoiceChannel
| APINewsChannel
| APITextChannel
| APIThreadChannel;
| APIPrivateThreadChannel
| APIPublicThreadChannel
| APITextChannel;
/**
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-types}
@@ -517,18 +543,27 @@ export enum VideoQualityMode {
Full,
}
export interface APIMessageMentions {
/**
* Users specifically mentioned in the message
*
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
mentions: APIUser[];
}
/**
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
*/
export interface APIMessage {
export interface APIBaseMessageNoChannel {
/**
* ID of the message
*/
id: Snowflake;
/**
* ID of the channel the message was sent in
*/
channel_id: Snowflake;
/**
* The author of this message (only a valid user in the case where the message is generated by a user or bot user)
*
@@ -565,16 +600,6 @@ export interface APIMessage {
* Whether this message mentions everyone
*/
mention_everyone: boolean;
/**
* Users specifically mentioned in the message
*
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
mentions: APIUser[];
/**
* Roles specifically mentioned in this message
*
@@ -722,7 +747,7 @@ export interface APIMessage {
* The stickers sent with the message
*
* @see {@link https://discord.com/developers/docs/resources/sticker#sticker-object}
* @deprecated Use {@link APIMessage.sticker_items} instead
* @deprecated Use {@link APIBaseMessageNoChannel.sticker_items} instead
*/
stickers?: APISticker[];
/**
@@ -762,6 +787,21 @@ export interface APIMessage {
call?: APIMessageCall;
}
/**
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
*/
export interface APIBaseMessage extends APIBaseMessageNoChannel {
/**
* ID of the channel the message was sent in
*/
channel_id: Snowflake;
}
/**
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
*/
export interface APIMessage extends APIBaseMessage, APIMessageMentions {}
/**
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-types}
*/
@@ -1689,28 +1729,31 @@ export interface APIActionRowComponent<T extends APIComponentInActionRow>
components: T[];
}
/**
* @see {@link https://discord.com/developers/docs/components/reference#button}
*/
export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
/**
* The label to be displayed on the button
*/
label?: string;
export interface APIButtonBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
/**
* The style of the button
*/
style: Style;
/**
* The emoji to display to the left of the text
*/
emoji?: APIMessageComponentEmoji;
/**
* The status of the button
*/
disabled?: boolean;
}
/**
* @see {@link https://discord.com/developers/docs/components/reference#button}
*/
export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIButtonBase<Style> {
/**
* The label to be displayed on the button
*/
label?: string;
/**
* The emoji to display to the left of the text
*/
emoji?: APIMessageComponentEmoji;
}
export interface APIMessageComponentEmoji {
/**
* Emoji id
@@ -1752,8 +1795,7 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
/**
* @see {@link https://discord.com/developers/docs/components/reference#button}
*/
export interface APIButtonComponentWithSKUId
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
export interface APIButtonComponentWithSKUId extends APIButtonBase<ButtonStyle.Premium> {
/**
* The id for a purchasable SKU
*/
@@ -2090,6 +2132,10 @@ export interface APIUnfurledMediaItem {
content_type?: string | null;
loading_state?: UnfurledMediaItemLoadingState;
flags?: number;
/**
* The id of the uploaded attachment. This field is ignored and provided by the API as part of the response
*/
attachment_id?: Snowflake;
}
/**
@@ -2408,3 +2454,17 @@ export type APIMessageSnapshotFields = Pick<
| 'timestamp'
| 'type'
>;
/**
* @see {@link https://discord.com/developers/docs/resources/message#message-pin-object}
*/
export interface APIMessagePin {
/**
* The time the message was pinned
*/
pinned_at: string;
/**
* The pinned message
*/
message: APIMessage;
}

View File

@@ -60,9 +60,9 @@ export interface APIGatewaySessionStartLimit {
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields}
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
*/
export interface GatewayPresenceUpdate {
export interface GatewayGuildMembersChunkPresence {
/**
* The user presence is being updated for
*
@@ -72,10 +72,6 @@ export interface GatewayPresenceUpdate {
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
*/
user: Partial<APIUser> & Pick<APIUser, 'id'>;
/**
* ID of the guild
*/
guild_id: Snowflake;
/**
* Either "idle", "dnd", "online", or "offline"
*/
@@ -94,6 +90,16 @@ export interface GatewayPresenceUpdate {
client_status?: GatewayPresenceClientStatus;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields}
*/
export interface GatewayPresenceUpdate extends GatewayGuildMembersChunkPresence {
/**
* ID of the guild
*/
guild_id: Snowflake;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types}
*/
@@ -176,14 +182,28 @@ export interface GatewayActivity {
* Application id for the game
*/
application_id?: Snowflake;
/**
* Controls which field is displayed in the user's status text in the member list
*
* @see {@link https://discord.com/developers/docs/events/gateway-events#activity-object-status-display-types}
*/
status_display_type?: StatusDisplayType | null;
/**
* What the player is currently doing
*/
details?: string | null;
/**
* URL that is linked when clicking on the details text
*/
details_url?: string | null;
/**
* The user's current party status, or the text used for a custom status
*/
state?: string | null;
/**
* URL that is linked when clicking on the state text
*/
state_url?: string | null;
/**
* The emoji used for a custom status
*
@@ -274,6 +294,26 @@ export enum ActivityType {
Competing,
}
/**
* Controls which field is used in the user's status message
*
* @see {@link https://discord.com/developers/docs/events/gateway-events#activity-object-status-display-types}
*/
export enum StatusDisplayType {
/**
* Playing \{name\}
*/
Name,
/**
* Playing \{state\}
*/
State,
/**
* Playing \{details\}
*/
Details,
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-timestamps}
*/
@@ -311,7 +351,7 @@ export interface GatewayActivityParty {
* @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-assets}
*/
export type GatewayActivityAssets = Partial<
Record<'large_image' | 'large_text' | 'small_image' | 'small_text', string>
Record<'large_image' | 'large_text' | 'large_url' | 'small_image' | 'small_text' | 'small_url', string>
>;
/**

View File

@@ -11,14 +11,17 @@ import type { APIRole } from './permissions.ts';
import type { APISticker } from './sticker.ts';
import type { APIAvatarDecorationData, APIUser } from './user.ts';
/**
* @see {@link https://discord.com/developers/docs/resources/guild#unavailable-guild-object}
*/
export interface APIUnavailableGuild {
export interface APIBaseGuild {
/**
* Guild id
*/
id: Snowflake;
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#unavailable-guild-object}
*/
export interface APIUnavailableGuild extends APIBaseGuild {
/**
* `true` if this guild is unavailable due to an outage
*/
@@ -28,7 +31,7 @@ export interface APIUnavailableGuild {
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-object-guild-structure}
*/
export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'>, Pick<APIGuild, 'welcome_screen'> {
export interface APIPartialGuild extends APIBaseGuild {
/**
* Guild name (2-100 characters, excluding trailing and leading whitespace)
*/
@@ -71,6 +74,12 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
* The vanity url code for the guild
*/
vanity_url_code?: string | null;
/**
* The welcome screen of a Community guild, shown to new members
*
* Returned in the invite object
*/
welcome_screen?: APIGuildWelcomeScreen;
}
/**
@@ -255,12 +264,6 @@ export interface APIGuild extends APIPartialGuild {
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
*/
approximate_presence_count?: number;
/**
* The welcome screen of a Community guild, shown to new members
*
* Returned in the invite object
*/
welcome_screen?: APIGuildWelcomeScreen;
/**
* The nsfw level of the guild
*
@@ -562,6 +565,14 @@ export enum GuildFeature {
* Guild has enabled the welcome screen
*/
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
/**
* Guild has access to set guild tags
*/
GuildTags = 'GUILD_TAGS',
/**
* Guild is able to set gradient colors to roles
*/
EnhancedRoleColors = 'ENHANCED_ROLE_COLORS',
}
/**
@@ -641,57 +652,23 @@ export interface APIGuildWidgetSettings {
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
export interface APIGuildMember {
/**
* The user this guild member represents
*
* **This field won't be included in the member object attached to `MESSAGE_CREATE` and `MESSAGE_UPDATE` gateway events.**
*
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
*/
user: APIUser;
export interface APIBaseGuildMember {
/**
* This users guild nickname
*/
nick?: string | null;
/**
* The member's guild avatar hash
*/
avatar?: string | null;
/**
* The member's guild banner hash
*/
banner?: string | null;
/**
* Array of role object ids
*
* @see {@link https://discord.com/developers/docs/topics/permissions#role-object}
*/
roles: Snowflake[];
/**
* When the user joined the guild
*/
joined_at: string;
/**
* When the user started boosting the guild
*
* @see {@link https://support.discord.com/hc/articles/360028038352}
*/
premium_since?: string | null;
/**
* Whether the user is deafened in voice channels
*/
deaf: boolean;
/**
* Whether the user is muted in voice channels
*/
mute: boolean;
/**
* Guild member flags represented as a bit set
*
* @defaultValue `0`
*/
flags: GuildMemberFlags;
/**
* Whether the user has not yet passed the guild's Membership Screening requirements
*
@@ -710,6 +687,81 @@ export interface APIGuildMember {
avatar_decoration_data?: APIAvatarDecorationData | null;
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
export interface APIFlaggedGuildMember {
/**
* Guild member flags represented as a bit set
*
* @defaultValue `0`
*/
flags: GuildMemberFlags;
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
export interface APIGuildMemberJoined {
/**
* When the user joined the guild
*/
joined_at: string;
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
export interface APIGuildMemberAvatar {
/**
* The member's guild avatar hash
*/
avatar?: string | null;
/**
* The member's guild banner hash
*/
banner?: string | null;
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
export interface APIBaseVoiceGuildMember {
/**
* Whether the user is deafened in voice channels
*/
deaf: boolean;
/**
* Whether the user is muted in voice channels
*/
mute: boolean;
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
export interface APIGuildMemberUser {
/**
* The user this guild member represents
*
* **This field won't be included in the member object attached to `MESSAGE_CREATE` and `MESSAGE_UPDATE` gateway events.**
*
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
*/
user: APIUser;
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
export interface APIGuildMember
extends APIBaseGuildMember,
APIBaseVoiceGuildMember,
APIFlaggedGuildMember,
APIGuildMemberAvatar,
APIGuildMemberJoined,
APIGuildMemberUser {}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-flags}
*/
@@ -755,6 +807,10 @@ export enum GuildMemberFlags {
* Member has dismissed the DM settings upsell
*/
DmSettingsUpsellAcknowledged = 1 << 9,
/**
* Member's guild tag is blocked by AutoMod
*/
AutoModQuarantinedGuildTag = 1 << 10,
}
/**

View File

@@ -21,11 +21,11 @@ import type {
import type { APIPingInteraction } from './_interactions/ping.ts';
export * from './_interactions/applicationCommands.ts';
export * from './_interactions/autocomplete.ts';
export * from './_interactions/base.ts';
export * from './_interactions/messageComponents.ts';
export * from './_interactions/modalSubmit.ts';
export * from './_interactions/ping.ts';
export type * from './_interactions/autocomplete.ts';
export type * from './_interactions/base.ts';
export type * from './_interactions/messageComponents.ts';
export type * from './_interactions/modalSubmit.ts';
export type * from './_interactions/ping.ts';
export * from './_interactions/responses.ts';
/**

View File

@@ -77,9 +77,9 @@ export interface APIInvite {
*/
approximate_member_count?: number;
/**
* The expiration date of this invite, returned from the `GET /invites/<code>` endpoint when `with_expiration` is `true`
* The expiration date of this invite
*/
expires_at?: string | null;
expires_at: string | null;
/**
* The stage instance data if there is a public stage instance in the stage channel this invite is for
*

View File

@@ -3,7 +3,7 @@ export * from './application.ts';
export * from './auditLog.ts';
export * from './autoModeration.ts';
export * from './channel.ts';
export * from './emoji.ts';
export type * from './emoji.ts';
export * from './gateway.ts';
export * from './guild.ts';
export * from './guildScheduledEvent.ts';
@@ -13,11 +13,11 @@ export * from './monetization.ts';
export * from './oauth2.ts';
export * from './permissions.ts';
export * from './poll.ts';
export * from './soundboard.ts';
export type * from './soundboard.ts';
export * from './stageInstance.ts';
export * from './sticker.ts';
export * from './teams.ts';
export * from './template.ts';
export type * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export type * from './voice.ts';
export * from './webhook.ts';

View File

@@ -18,8 +18,14 @@ export interface APIRole {
name: string;
/**
* Integer representation of hexadecimal color code
*
* @remarks `color` will still be returned by the API, but using the `colors` field is recommended when doing requests.
*/
color: number;
/**
* The role's colors
*/
colors?: APIRoleColors;
/**
* If this role is pinned in the user listing
*/
@@ -99,3 +105,23 @@ export enum RoleFlags {
*/
InPrompt = 1 << 0,
}
/**
* @see {@link https://discord.com/developers/docs/topics/permissions#role-colors-object}
*/
export interface APIRoleColors {
/**
* The primary color for the role
*/
primary_color: number;
/**
* The secondary color for the role, this will make the role a gradient between the other provided colors
*/
secondary_color: number | null;
/**
* The tertiary color for the role, this will turn the gradient into a holographic style
*
* @remarks When sending `tertiary_color` the API enforces the role color to be a holographic style with values of `primary_color = 11127295`, `secondary_color = 16759788`, and `tertiary_color = 16761760`.
*/
tertiary_color: number | null;
}

View File

@@ -4,22 +4,14 @@
import type { APIPartialEmoji } from './emoji.ts';
/**
* @see {@link https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure}
*/
export interface APIPoll {
export interface APIBasePoll {
/**
* The question of the poll
*/
question: APIPollMedia;
/**
* Each of the answers available in the poll, up to 10
*/
answers: APIPollAnswer[];
/**
* The time when the poll ends (IS08601 timestamp)
*/
expiry: string;
}
export interface APIPollDefaults {
/**
* Whether a user can select multiple answers
*
@@ -32,6 +24,20 @@ export interface APIPoll {
* @defaultValue `PollLayoutType.Default`
*/
layout_type: PollLayoutType;
}
/**
* @see {@link https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure}
*/
export interface APIPoll extends APIBasePoll, APIPollDefaults {
/**
* Each of the answers available in the poll, up to 10
*/
answers: APIPollAnswer[];
/**
* The time when the poll ends (IS08601 timestamp)
*/
expiry: string;
/**
* The results of the poll
*/
@@ -64,20 +70,23 @@ export interface APIPollMedia {
emoji?: APIPartialEmoji;
}
/**
* @see {@link https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure}
*/
export interface APIPollAnswer {
/**
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
*/
answer_id: number;
export interface APIBasePollAnswer {
/**
* The data of the answer
*/
poll_media: APIPollMedia;
}
/**
* @see {@link https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure}
*/
export interface APIPollAnswer extends APIBasePollAnswer {
/**
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
*/
answer_id: number;
}
/**
* @see {@link https://discord.com/developers/docs/resources/poll#poll-results-object-poll-results-object-structure}
*/

View File

@@ -96,6 +96,18 @@ export interface APIUser {
* @see {@link https://discord.com/developers/docs/resources/user#avatar-decoration-data-object}
*/
avatar_decoration_data?: APIAvatarDecorationData | null;
/**
* The data for the user's collectibles
*
* @see {@link https://discord.com/developers/docs/resources/user#collectibles}
*/
collectibles?: APICollectibles | null;
/**
* The user's primary guild
*
* @see {@link https://discord.com/developers/docs/resources/user#user-object-user-primary-guild}
*/
primary_guild?: APIUserPrimaryGuild | null;
}
/**
@@ -348,3 +360,81 @@ export interface APIAvatarDecorationData {
*/
sku_id: Snowflake;
}
/**
* The collectibles the user has, excluding Avatar Decorations and Profile Effects.
*
* @see {@link https://discord.com/developers/docs/resources/user#collectibles}
*/
export interface APICollectibles {
/**
* Object mapping of {@link APINameplateData}
*/
nameplate?: APINameplateData;
}
/**
* @see {@link https://discord.com/developers/docs/resources/user#nameplate}
*/
export interface APINameplateData {
/**
* ID of the nameplate SKU
*/
sku_id: Snowflake;
/**
* Path to the nameplate asset
*
* @example `nameplates/nameplates/twilight/`
*/
asset: string;
/**
* The label of this nameplate. Currently unused
*/
label: string;
/**
* Background color of the nameplate
*/
palette: NameplatePalette;
}
/**
* Background color of a nameplate.
*/
export enum NameplatePalette {
Berry = 'berry',
BubbleGum = 'bubble_gum',
Clover = 'clover',
Cobalt = 'cobalt',
Crimson = 'crimson',
Forest = 'forest',
Lemon = 'lemon',
Sky = 'sky',
Teal = 'teal',
Violet = 'violet',
White = 'white',
}
/**
* @see {@link https://discord.com/developers/docs/resources/user#user-object-user-primary-guild}
*/
export interface APIUserPrimaryGuild {
/**
* The id of the user's primary guild
*/
identity_guild_id: Snowflake | null;
/**
* Whether the user is displaying the primary guild's server tag.
* This can be `null` if the system clears the identity, e.g. because the server no longer supports tags
*/
identity_enabled: boolean | null;
/**
* The text of the user's server tag. Limited to 4 characters
*/
tag: string | null;
/**
* The server tag badge hash
*
* @see {@link https://discord.com/developers/docs/reference#image-formatting}
*/
badge: string | null;
}

View File

@@ -14,11 +14,7 @@ export type GatewayVoiceState = APIVoiceState;
/**
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
*/
export interface APIVoiceState {
/**
* The guild id this voice state is for
*/
guild_id?: Snowflake;
export interface APIBaseVoiceState {
/**
* The channel id this user is connected to
*/
@@ -71,6 +67,16 @@ export interface APIVoiceState {
request_to_speak_timestamp: string | null;
}
/**
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
*/
export interface APIVoiceState extends APIBaseVoiceState {
/**
* The guild id this voice state is for
*/
guild_id?: Snowflake;
}
/**
* @see {@link https://discord.com/developers/docs/resources/voice#voice-region-object}
*/

View File

@@ -86,6 +86,10 @@ export type APIWebhookEventBody =
ApplicationWebhookEventType.ApplicationAuthorized,
APIWebhookEventApplicationAuthorizedData
>
| APIWebhookEventEventBase<
ApplicationWebhookEventType.ApplicationDeauthorized,
APIWebhookEventApplicationDeauthorizedData
>
| APIWebhookEventEventBase<ApplicationWebhookEventType.EntitlementCreate, APIWebhookEventEntitlementCreateData>
| APIWebhookEventEventBase<ApplicationWebhookEventType.QuestUserEnrollment, APIWebhookEventQuestUserEnrollmentData>;
@@ -108,6 +112,13 @@ export interface APIWebhookEventApplicationAuthorizedData {
guild?: APIGuild;
}
export interface APIWebhookEventApplicationDeauthorizedData {
/**
* User who deauthorized the app
*/
user: APIUser;
}
export type APIWebhookEventEntitlementCreateData = APIEntitlement;
export type APIWebhookEventQuestUserEnrollmentData = never;
@@ -168,6 +179,10 @@ export enum ApplicationWebhookEventType {
* Sent when an app was authorized by a user to a server or their account
*/
ApplicationAuthorized = 'APPLICATION_AUTHORIZED',
/**
* Sent when an app was deauthorized by a user
*/
ApplicationDeauthorized = 'APPLICATION_DEAUTHORIZED',
/**
* Entitlement was created
*/

View File

@@ -5,7 +5,7 @@ import type { ApplicationCommandOptionType } from './shared.ts';
export interface APIApplicationCommandChannelOption
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Channel> {
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM | ChannelType.GuildDirectory>[];
}
export type APIApplicationCommandInteractionDataChannelOption = APIInteractionDataOptionBase<

View File

@@ -47,19 +47,19 @@ import type {
} from './_chatInput/user.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
export * from './_chatInput/attachment.ts';
export * from './_chatInput/base.ts';
export * from './_chatInput/boolean.ts';
export * from './_chatInput/channel.ts';
export * from './_chatInput/integer.ts';
export * from './_chatInput/mentionable.ts';
export * from './_chatInput/number.ts';
export * from './_chatInput/role.ts';
export type * from './_chatInput/attachment.ts';
export type * from './_chatInput/base.ts';
export type * from './_chatInput/boolean.ts';
export type * from './_chatInput/channel.ts';
export type * from './_chatInput/integer.ts';
export type * from './_chatInput/mentionable.ts';
export type * from './_chatInput/number.ts';
export type * from './_chatInput/role.ts';
export * from './_chatInput/shared.ts';
export * from './_chatInput/string.ts';
export * from './_chatInput/subcommand.ts';
export * from './_chatInput/subcommandGroup.ts';
export * from './_chatInput/user.ts';
export type * from './_chatInput/string.ts';
export type * from './_chatInput/subcommand.ts';
export type * from './_chatInput/subcommandGroup.ts';
export type * from './_chatInput/user.ts';
/**
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure}

View File

@@ -23,10 +23,10 @@ import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
export * from './_applicationCommands/chatInput.ts';
export * from './_applicationCommands/contextMenu.ts';
export type * from './_applicationCommands/contextMenu.ts';
export * from './_applicationCommands/permissions.ts';
export * from './_applicationCommands/entryPoint.ts';
export * from './_applicationCommands/internals.ts';
export type * from './_applicationCommands/entryPoint.ts';
export type * from './_applicationCommands/internals.ts';
/**
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object}

View File

@@ -9,7 +9,14 @@ import type {
ChannelType,
ThreadChannelType,
} from '../channel.ts';
import type { APIGuildMember, APIPartialInteractionGuild } from '../guild.ts';
import type {
APIBaseGuildMember,
APIFlaggedGuildMember,
APIGuildMember,
APIGuildMemberAvatar,
APIGuildMemberJoined,
APIPartialInteractionGuild,
} from '../guild.ts';
import type { APIEntitlement } from '../monetization.ts';
import type { APIUser } from '../user.ts';
import type { InteractionType } from './responses.ts';
@@ -256,7 +263,11 @@ export type APIInteractionDataResolvedChannel =
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'deaf' | 'mute' | 'user'> {
export interface APIInteractionDataResolvedGuildMember
extends APIBaseGuildMember,
APIFlaggedGuildMember,
APIGuildMemberAvatar,
APIGuildMemberJoined {
permissions: Permissions;
}

View File

@@ -1,4 +1,4 @@
import type { APIActionRowComponent, APIComponentInModalActionRow } from '../channel.ts';
import type { APIBaseComponent } from '../channel.ts';
import type {
APIBaseInteraction,
APIDMInteractionWrapper,
@@ -13,8 +13,7 @@ export interface ModalSubmitComponent {
value: string;
}
export interface ModalSubmitActionRowComponent
extends Omit<APIActionRowComponent<APIComponentInModalActionRow>, 'components'> {
export interface ModalSubmitActionRowComponent extends APIBaseComponent<ComponentType.ActionRow> {
components: ModalSubmitComponent[];
}

View File

@@ -111,9 +111,13 @@ export interface APIApplication {
*/
approximate_guild_count?: number;
/**
* Approximate count of users that have installed the app
* Approximate count of users that have installed the app (authorized with `application.commands` as a scope)
*/
approximate_user_install_count?: number;
/**
* Approximate count of users that have OAuth2 authorizations for the app
*/
approximate_user_authorization_count?: number;
/**
* Array of redirect URIs for the application
*/

View File

@@ -207,6 +207,7 @@ export enum AuditLogEvent {
AutoModerationBlockMessage,
AutoModerationFlagToChannel,
AutoModerationUserCommunicationDisabled,
AutoModerationQuarantineUser,
CreatorMonetizationRequestCreated = 150,
CreatorMonetizationTermsAccepted,
@@ -232,6 +233,7 @@ export interface APIAuditLogOptions {
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
* - AUTO_MODERATION_QUARANTINE_USER
*/
auto_moderation_rule_name?: string;
/**
@@ -241,6 +243,7 @@ export interface APIAuditLogOptions {
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
* - AUTO_MODERATION_QUARANTINE_USER
*/
auto_moderation_rule_trigger_type?: AuditLogRuleTriggerType;
/**
@@ -272,6 +275,7 @@ export interface APIAuditLogOptions {
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
* - AUTO_MODERATION_QUARANTINE_USER
*/
channel_id?: Snowflake;
@@ -325,7 +329,7 @@ export interface APIAuditLogOptions {
* - CHANNEL_OVERWRITE_UPDATE
* - CHANNEL_OVERWRITE_DELETE
*
* **Present only if the {@link APIAuditLogOptions.type | entry type} is "0"**
* **Present only if the {@link APIAuditLogOptions."type" | entry type} is "0"**
*/
role_name?: string;

View File

@@ -13,10 +13,7 @@ import type { APIPoll } from './poll.ts';
import type { APISticker, APIStickerItem } from './sticker.ts';
import type { APIUser } from './user.ts';
/**
* Not documented, but partial only includes id, name, and type
*/
export interface APIPartialChannel {
export interface APIBasePartialChannel {
/**
* The id of the channel
*/
@@ -27,12 +24,20 @@ export interface APIPartialChannel {
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-types}
*/
type: ChannelType;
}
export interface APINameableChannel {
/**
* The name of the channel (1-100 characters)
*/
name?: string | null;
}
/**
* Not documented, but partial only includes id, name, and type
*/
export interface APIPartialChannel extends APIBasePartialChannel, APINameableChannel {}
/**
* A channel obtained from fetching an invite.
*/
@@ -58,7 +63,7 @@ export type APIWebhookSourceChannel = Required<_NonNullableFields<Pick<APIPartia
* This interface is used to allow easy extension for other channel types. While
* also allowing `APIPartialChannel` to be used without breaking.
*/
export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel {
export interface APIChannelBase<T extends ChannelType> extends APIBasePartialChannel {
type: T;
flags?: ChannelFlags;
}
@@ -76,16 +81,7 @@ export type TextChannelType =
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* The id of the last message sent in this channel (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
/**
* When the last pinned message was pinned.
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
*/
last_pin_timestamp?: string | null;
export interface APISlowmodeChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
@@ -98,7 +94,29 @@ export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBa
rate_limit_per_user?: number;
}
export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelBase<T>, 'name'> {
export interface APISortableChannel {
/**
* Sorting position of the channel
*/
position: number;
}
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T>, APISlowmodeChannel<T> {
/**
* The id of the last message sent in this channel (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
}
export interface APIPinChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* When the last pinned message was pinned.
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
*/
last_pin_timestamp?: string | null;
}
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* The name of the channel (1-100 characters)
*/
@@ -113,10 +131,6 @@ export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelB
* @see {@link https://discord.com/developers/docs/resources/channel#overwrite-object}
*/
permission_overwrites?: APIOverwrite[];
/**
* Sorting position of the channel
*/
position: number;
/**
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
*
@@ -134,8 +148,10 @@ export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelB
export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia | GuildTextChannelType>
extends Omit<APITextBasedChannel<T>, 'name'>,
APIGuildChannel<T> {
extends APITextBasedChannel<T>,
APISortableChannel,
APIGuildChannel<T>,
APIPinChannel<T> {
/**
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
*/
@@ -153,11 +169,13 @@ export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelT
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.GuildCategory>, APISortableChannel {}
export interface APIVoiceChannelBase<T extends ChannelType>
extends APIGuildChannel<T>,
Omit<APITextBasedChannel<T>, 'last_pin_timestamp' | 'name'> {
APISortableChannel,
APITextBasedChannel<T>,
APISlowmodeChannel<T> {
/**
* The bitrate (in bits) of the voice or stage channel
*/
@@ -184,7 +202,7 @@ export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
export interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>, APIPinChannel<T> {
/**
* The recipients of the DM
*
@@ -193,14 +211,14 @@ export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBas
recipients?: APIUser[];
}
export interface APIDMChannel extends Omit<APIDMChannelBase<ChannelType.DM>, 'name'> {
export interface APIDMChannel extends APIDMChannelBase<ChannelType.DM> {
/**
* The name of the channel (always null for DM channels)
*/
name: null;
}
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM> {
/**
* The name of the channel (1-100 characters)
*/
@@ -229,9 +247,10 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
export type ThreadChannelType = ChannelType.AnnouncementThread | ChannelType.PrivateThread | ChannelType.PublicThread;
export interface APIThreadChannel
extends Omit<APITextBasedChannel<ThreadChannelType>, 'name'>,
APIGuildChannel<ThreadChannelType> {
export interface APIThreadChannel<Type extends ThreadChannelType = ThreadChannelType>
extends APITextBasedChannel<Type>,
APIGuildChannel<Type>,
APIPinChannel<Type> {
/**
* The client users member for the thread, only included in select endpoints
*/
@@ -266,6 +285,10 @@ export interface APIThreadChannel
applied_tags: Snowflake[];
}
export type APIPublicThreadChannel = APIThreadChannel<ChannelType.PublicThread>;
export type APIPrivateThreadChannel = APIThreadChannel<ChannelType.PrivateThread>;
export type APIAnnouncementThreadChannel = APIThreadChannel<ChannelType.AnnouncementThread>;
/**
* @see {@link https://discord.com/developers/docs/resources/channel#forum-tag-object-forum-tag-structure}
*/
@@ -339,7 +362,8 @@ export enum ForumLayoutType {
}
export interface APIThreadOnlyChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia>
extends APIGuildChannel<T> {
extends APIGuildChannel<T>,
APISortableChannel {
/**
* The channel topic (0-4096 characters)
*/
@@ -398,6 +422,7 @@ export type APIGuildMediaChannel = APIThreadOnlyChannel<ChannelType.GuildMedia>;
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-structure}
*/
export type APIChannel =
| APIAnnouncementThreadChannel
| APIDMChannel
| APIGroupDMChannel
| APIGuildCategoryChannel
@@ -406,8 +431,9 @@ export type APIChannel =
| APIGuildStageVoiceChannel
| APIGuildVoiceChannel
| APINewsChannel
| APITextChannel
| APIThreadChannel;
| APIPrivateThreadChannel
| APIPublicThreadChannel
| APITextChannel;
/**
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-types}
@@ -517,18 +543,27 @@ export enum VideoQualityMode {
Full,
}
export interface APIMessageMentions {
/**
* Users specifically mentioned in the message
*
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
mentions: APIUser[];
}
/**
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
*/
export interface APIMessage {
export interface APIBaseMessageNoChannel {
/**
* ID of the message
*/
id: Snowflake;
/**
* ID of the channel the message was sent in
*/
channel_id: Snowflake;
/**
* The author of this message (only a valid user in the case where the message is generated by a user or bot user)
*
@@ -564,16 +599,6 @@ export interface APIMessage {
* Whether this message mentions everyone
*/
mention_everyone: boolean;
/**
* Users specifically mentioned in the message
*
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
mentions: APIUser[];
/**
* Roles specifically mentioned in this message
*
@@ -718,7 +743,7 @@ export interface APIMessage {
* The stickers sent with the message
*
* @see {@link https://discord.com/developers/docs/resources/sticker#sticker-object}
* @deprecated Use {@link APIMessage.sticker_items} instead
* @deprecated Use {@link APIBaseMessageNoChannel.sticker_items} instead
*/
stickers?: APISticker[];
/**
@@ -757,6 +782,21 @@ export interface APIMessage {
call?: APIMessageCall;
}
/**
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
*/
export interface APIBaseMessage extends APIBaseMessageNoChannel {
/**
* ID of the channel the message was sent in
*/
channel_id: Snowflake;
}
/**
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
*/
export interface APIMessage extends APIBaseMessage, APIMessageMentions {}
/**
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-types}
*/
@@ -1686,28 +1726,31 @@ export interface APIActionRowComponent<T extends APIComponentInActionRow>
components: T[];
}
/**
* @see {@link https://discord.com/developers/docs/components/reference#button}
*/
export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
/**
* The label to be displayed on the button
*/
label?: string;
export interface APIButtonBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
/**
* The style of the button
*/
style: Style;
/**
* The emoji to display to the left of the text
*/
emoji?: APIMessageComponentEmoji;
/**
* The status of the button
*/
disabled?: boolean;
}
/**
* @see {@link https://discord.com/developers/docs/components/reference#button}
*/
export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIButtonBase<Style> {
/**
* The label to be displayed on the button
*/
label?: string;
/**
* The emoji to display to the left of the text
*/
emoji?: APIMessageComponentEmoji;
}
export interface APIMessageComponentEmoji {
/**
* Emoji id
@@ -1749,8 +1792,7 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
/**
* @see {@link https://discord.com/developers/docs/components/reference#button}
*/
export interface APIButtonComponentWithSKUId
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
export interface APIButtonComponentWithSKUId extends APIButtonBase<ButtonStyle.Premium> {
/**
* The id for a purchasable SKU
*/
@@ -2087,6 +2129,10 @@ export interface APIUnfurledMediaItem {
content_type?: string | null;
loading_state?: UnfurledMediaItemLoadingState;
flags?: number;
/**
* The id of the uploaded attachment. This field is ignored and provided by the API as part of the response
*/
attachment_id?: Snowflake;
}
/**
@@ -2405,3 +2451,17 @@ export type APIMessageSnapshotFields = Pick<
| 'timestamp'
| 'type'
>;
/**
* @see {@link https://discord.com/developers/docs/resources/message#message-pin-object}
*/
export interface APIMessagePin {
/**
* The time the message was pinned
*/
pinned_at: string;
/**
* The pinned message
*/
message: APIMessage;
}

View File

@@ -60,9 +60,9 @@ export interface APIGatewaySessionStartLimit {
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields}
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
*/
export interface GatewayPresenceUpdate {
export interface GatewayGuildMembersChunkPresence {
/**
* The user presence is being updated for
*
@@ -72,10 +72,6 @@ export interface GatewayPresenceUpdate {
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
*/
user: Partial<APIUser> & Pick<APIUser, 'id'>;
/**
* ID of the guild
*/
guild_id: Snowflake;
/**
* Either "idle", "dnd", "online", or "offline"
*/
@@ -94,6 +90,16 @@ export interface GatewayPresenceUpdate {
client_status?: GatewayPresenceClientStatus;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields}
*/
export interface GatewayPresenceUpdate extends GatewayGuildMembersChunkPresence {
/**
* ID of the guild
*/
guild_id: Snowflake;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types}
*/
@@ -167,14 +173,28 @@ export interface GatewayActivity {
* Application id for the game
*/
application_id?: Snowflake;
/**
* Controls which field is displayed in the user's status text in the member list
*
* @see {@link https://discord.com/developers/docs/events/gateway-events#activity-object-status-display-types}
*/
status_display_type?: StatusDisplayType | null;
/**
* What the player is currently doing
*/
details?: string | null;
/**
* URL that is linked when clicking on the details text
*/
details_url?: string | null;
/**
* The user's current party status, or the text used for a custom status
*/
state?: string | null;
/**
* URL that is linked when clicking on the state text
*/
state_url?: string | null;
/**
* The emoji used for a custom status
*
@@ -262,6 +282,26 @@ export enum ActivityType {
Competing,
}
/**
* Controls which field is used in the user's status message
*
* @see {@link https://discord.com/developers/docs/events/gateway-events#activity-object-status-display-types}
*/
export enum StatusDisplayType {
/**
* Playing \{name\}
*/
Name,
/**
* Playing \{state\}
*/
State,
/**
* Playing \{details\}
*/
Details,
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-timestamps}
*/
@@ -299,7 +339,7 @@ export interface GatewayActivityParty {
* @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-assets}
*/
export type GatewayActivityAssets = Partial<
Record<'large_image' | 'large_text' | 'small_image' | 'small_text', string>
Record<'large_image' | 'large_text' | 'large_url' | 'small_image' | 'small_text' | 'small_url', string>
>;
/**

View File

@@ -11,14 +11,17 @@ import type { APIRole } from './permissions.ts';
import type { APISticker } from './sticker.ts';
import type { APIAvatarDecorationData, APIUser } from './user.ts';
/**
* @see {@link https://discord.com/developers/docs/resources/guild#unavailable-guild-object}
*/
export interface APIUnavailableGuild {
export interface APIBaseGuild {
/**
* Guild id
*/
id: Snowflake;
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#unavailable-guild-object}
*/
export interface APIUnavailableGuild extends APIBaseGuild {
/**
* `true` if this guild is unavailable due to an outage
*/
@@ -28,7 +31,7 @@ export interface APIUnavailableGuild {
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-object-guild-structure}
*/
export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'>, Pick<APIGuild, 'welcome_screen'> {
export interface APIPartialGuild extends APIBaseGuild {
/**
* Guild name (2-100 characters, excluding trailing and leading whitespace)
*/
@@ -71,6 +74,12 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
* The vanity url code for the guild
*/
vanity_url_code?: string | null;
/**
* The welcome screen of a Community guild, shown to new members
*
* Returned in the invite object
*/
welcome_screen?: APIGuildWelcomeScreen;
}
/**
@@ -255,12 +264,6 @@ export interface APIGuild extends APIPartialGuild {
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
*/
approximate_presence_count?: number;
/**
* The welcome screen of a Community guild, shown to new members
*
* Returned in the invite object
*/
welcome_screen?: APIGuildWelcomeScreen;
/**
* The nsfw level of the guild
*
@@ -554,6 +557,14 @@ export enum GuildFeature {
* Guild has enabled the welcome screen
*/
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
/**
* Guild has access to set guild tags
*/
GuildTags = 'GUILD_TAGS',
/**
* Guild is able to set gradient colors to roles
*/
EnhancedRoleColors = 'ENHANCED_ROLE_COLORS',
}
/**
@@ -633,57 +644,23 @@ export interface APIGuildWidgetSettings {
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
export interface APIGuildMember {
/**
* The user this guild member represents
*
* **This field won't be included in the member object attached to `MESSAGE_CREATE` and `MESSAGE_UPDATE` gateway events.**
*
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
*/
user: APIUser;
export interface APIBaseGuildMember {
/**
* This users guild nickname
*/
nick?: string | null;
/**
* The member's guild avatar hash
*/
avatar?: string | null;
/**
* The member's guild banner hash
*/
banner?: string | null;
/**
* Array of role object ids
*
* @see {@link https://discord.com/developers/docs/topics/permissions#role-object}
*/
roles: Snowflake[];
/**
* When the user joined the guild
*/
joined_at: string;
/**
* When the user started boosting the guild
*
* @see {@link https://support.discord.com/hc/articles/360028038352}
*/
premium_since?: string | null;
/**
* Whether the user is deafened in voice channels
*/
deaf: boolean;
/**
* Whether the user is muted in voice channels
*/
mute: boolean;
/**
* Guild member flags represented as a bit set
*
* @defaultValue `0`
*/
flags: GuildMemberFlags;
/**
* Whether the user has not yet passed the guild's Membership Screening requirements
*
@@ -702,6 +679,81 @@ export interface APIGuildMember {
avatar_decoration_data?: APIAvatarDecorationData | null;
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
export interface APIFlaggedGuildMember {
/**
* Guild member flags represented as a bit set
*
* @defaultValue `0`
*/
flags: GuildMemberFlags;
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
export interface APIGuildMemberJoined {
/**
* When the user joined the guild
*/
joined_at: string;
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
export interface APIGuildMemberAvatar {
/**
* The member's guild avatar hash
*/
avatar?: string | null;
/**
* The member's guild banner hash
*/
banner?: string | null;
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
export interface APIBaseVoiceGuildMember {
/**
* Whether the user is deafened in voice channels
*/
deaf: boolean;
/**
* Whether the user is muted in voice channels
*/
mute: boolean;
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
export interface APIGuildMemberUser {
/**
* The user this guild member represents
*
* **This field won't be included in the member object attached to `MESSAGE_CREATE` and `MESSAGE_UPDATE` gateway events.**
*
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
*/
user: APIUser;
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
export interface APIGuildMember
extends APIBaseGuildMember,
APIBaseVoiceGuildMember,
APIFlaggedGuildMember,
APIGuildMemberAvatar,
APIGuildMemberJoined,
APIGuildMemberUser {}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-flags}
*/
@@ -747,6 +799,10 @@ export enum GuildMemberFlags {
* Member has dismissed the DM settings upsell
*/
DmSettingsUpsellAcknowledged = 1 << 9,
/**
* Member's guild tag is blocked by AutoMod
*/
AutoModQuarantinedGuildTag = 1 << 10,
}
/**

View File

@@ -21,11 +21,11 @@ import type {
import type { APIPingInteraction } from './_interactions/ping.ts';
export * from './_interactions/applicationCommands.ts';
export * from './_interactions/autocomplete.ts';
export * from './_interactions/base.ts';
export * from './_interactions/messageComponents.ts';
export * from './_interactions/modalSubmit.ts';
export * from './_interactions/ping.ts';
export type * from './_interactions/autocomplete.ts';
export type * from './_interactions/base.ts';
export type * from './_interactions/messageComponents.ts';
export type * from './_interactions/modalSubmit.ts';
export type * from './_interactions/ping.ts';
export * from './_interactions/responses.ts';
/**

View File

@@ -77,9 +77,9 @@ export interface APIInvite {
*/
approximate_member_count?: number;
/**
* The expiration date of this invite, returned from the `GET /invites/<code>` endpoint when `with_expiration` is `true`
* The expiration date of this invite
*/
expires_at?: string | null;
expires_at: string | null;
/**
* The stage instance data if there is a public stage instance in the stage channel this invite is for
*

View File

@@ -3,7 +3,7 @@ export * from './application.ts';
export * from './auditLog.ts';
export * from './autoModeration.ts';
export * from './channel.ts';
export * from './emoji.ts';
export type * from './emoji.ts';
export * from './gateway.ts';
export * from './guild.ts';
export * from './guildScheduledEvent.ts';
@@ -13,11 +13,11 @@ export * from './monetization.ts';
export * from './oauth2.ts';
export * from './permissions.ts';
export * from './poll.ts';
export * from './soundboard.ts';
export type * from './soundboard.ts';
export * from './stageInstance.ts';
export * from './sticker.ts';
export * from './teams.ts';
export * from './template.ts';
export type * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export type * from './voice.ts';
export * from './webhook.ts';

View File

@@ -18,8 +18,14 @@ export interface APIRole {
name: string;
/**
* Integer representation of hexadecimal color code
*
* @remarks `color` will still be returned by the API, but using the `colors` field is recommended when doing requests.
*/
color: number;
/**
* The role's colors
*/
colors?: APIRoleColors;
/**
* If this role is pinned in the user listing
*/
@@ -99,3 +105,23 @@ export enum RoleFlags {
*/
InPrompt = 1 << 0,
}
/**
* @see {@link https://discord.com/developers/docs/topics/permissions#role-colors-object}
*/
export interface APIRoleColors {
/**
* The primary color for the role
*/
primary_color: number;
/**
* The secondary color for the role, this will make the role a gradient between the other provided colors
*/
secondary_color: number | null;
/**
* The tertiary color for the role, this will turn the gradient into a holographic style
*
* @remarks When sending `tertiary_color` the API enforces the role color to be a holographic style with values of `primary_color = 11127295`, `secondary_color = 16759788`, and `tertiary_color = 16761760`.
*/
tertiary_color: number | null;
}

View File

@@ -4,22 +4,14 @@
import type { APIPartialEmoji } from './emoji.ts';
/**
* @see {@link https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure}
*/
export interface APIPoll {
export interface APIBasePoll {
/**
* The question of the poll
*/
question: APIPollMedia;
/**
* Each of the answers available in the poll, up to 10
*/
answers: APIPollAnswer[];
/**
* The time when the poll ends (IS08601 timestamp)
*/
expiry: string;
}
export interface APIPollDefaults {
/**
* Whether a user can select multiple answers
*
@@ -32,6 +24,20 @@ export interface APIPoll {
* @defaultValue `PollLayoutType.Default`
*/
layout_type: PollLayoutType;
}
/**
* @see {@link https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure}
*/
export interface APIPoll extends APIBasePoll, APIPollDefaults {
/**
* Each of the answers available in the poll, up to 10
*/
answers: APIPollAnswer[];
/**
* The time when the poll ends (IS08601 timestamp)
*/
expiry: string;
/**
* The results of the poll
*/
@@ -64,20 +70,23 @@ export interface APIPollMedia {
emoji?: APIPartialEmoji;
}
/**
* @see {@link https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure}
*/
export interface APIPollAnswer {
/**
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
*/
answer_id: number;
export interface APIBasePollAnswer {
/**
* The data of the answer
*/
poll_media: APIPollMedia;
}
/**
* @see {@link https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure}
*/
export interface APIPollAnswer extends APIBasePollAnswer {
/**
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
*/
answer_id: number;
}
/**
* @see {@link https://discord.com/developers/docs/resources/poll#poll-results-object-poll-results-object-structure}
*/

View File

@@ -96,6 +96,18 @@ export interface APIUser {
* @see {@link https://discord.com/developers/docs/resources/user#avatar-decoration-data-object}
*/
avatar_decoration_data?: APIAvatarDecorationData | null;
/**
* The data for the user's collectibles
*
* @see {@link https://discord.com/developers/docs/resources/user#collectibles}
*/
collectibles?: APICollectibles | null;
/**
* The user's primary guild
*
* @see {@link https://discord.com/developers/docs/resources/user#user-object-user-primary-guild}
*/
primary_guild?: APIUserPrimaryGuild | null;
}
/**
@@ -348,3 +360,81 @@ export interface APIAvatarDecorationData {
*/
sku_id: Snowflake;
}
/**
* The collectibles the user has, excluding Avatar Decorations and Profile Effects.
*
* @see {@link https://discord.com/developers/docs/resources/user#collectibles}
*/
export interface APICollectibles {
/**
* Object mapping of {@link APINameplateData}
*/
nameplate?: APINameplateData;
}
/**
* @see {@link https://discord.com/developers/docs/resources/user#nameplate}
*/
export interface APINameplateData {
/**
* ID of the nameplate SKU
*/
sku_id: Snowflake;
/**
* Path to the nameplate asset
*
* @example `nameplates/nameplates/twilight/`
*/
asset: string;
/**
* The label of this nameplate. Currently unused
*/
label: string;
/**
* Background color of the nameplate
*/
palette: NameplatePalette;
}
/**
* Background color of a nameplate.
*/
export enum NameplatePalette {
Berry = 'berry',
BubbleGum = 'bubble_gum',
Clover = 'clover',
Cobalt = 'cobalt',
Crimson = 'crimson',
Forest = 'forest',
Lemon = 'lemon',
Sky = 'sky',
Teal = 'teal',
Violet = 'violet',
White = 'white',
}
/**
* @see {@link https://discord.com/developers/docs/resources/user#user-object-user-primary-guild}
*/
export interface APIUserPrimaryGuild {
/**
* The id of the user's primary guild
*/
identity_guild_id: Snowflake | null;
/**
* Whether the user is displaying the primary guild's server tag.
* This can be `null` if the system clears the identity, e.g. because the server no longer supports tags
*/
identity_enabled: boolean | null;
/**
* The text of the user's server tag. Limited to 4 characters
*/
tag: string | null;
/**
* The server tag badge hash
*
* @see {@link https://discord.com/developers/docs/reference#image-formatting}
*/
badge: string | null;
}

View File

@@ -11,14 +11,7 @@ import type { APIGuildMember } from './guild.ts';
*/
export type GatewayVoiceState = APIVoiceState;
/**
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
*/
export interface APIVoiceState {
/**
* The guild id this voice state is for
*/
guild_id?: Snowflake;
export interface APIBaseVoiceState {
/**
* The channel id this user is connected to
*/
@@ -71,6 +64,16 @@ export interface APIVoiceState {
request_to_speak_timestamp: string | null;
}
/**
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
*/
export interface APIVoiceState extends APIBaseVoiceState {
/**
* The guild id this voice state is for
*/
guild_id?: Snowflake;
}
/**
* @see {@link https://discord.com/developers/docs/resources/voice#voice-region-object}
*/

View File

@@ -86,6 +86,10 @@ export type APIWebhookEventBody =
ApplicationWebhookEventType.ApplicationAuthorized,
APIWebhookEventApplicationAuthorizedData
>
| APIWebhookEventEventBase<
ApplicationWebhookEventType.ApplicationDeauthorized,
APIWebhookEventApplicationDeauthorizedData
>
| APIWebhookEventEventBase<ApplicationWebhookEventType.EntitlementCreate, APIWebhookEventEntitlementCreateData>
| APIWebhookEventEventBase<ApplicationWebhookEventType.QuestUserEnrollment, APIWebhookEventQuestUserEnrollmentData>;
@@ -108,6 +112,13 @@ export interface APIWebhookEventApplicationAuthorizedData {
guild?: APIGuild;
}
export interface APIWebhookEventApplicationDeauthorizedData {
/**
* User who deauthorized the app
*/
user: APIUser;
}
export type APIWebhookEventEntitlementCreateData = APIEntitlement;
export type APIWebhookEventQuestUserEnrollmentData = never;
@@ -168,6 +179,10 @@ export enum ApplicationWebhookEventType {
* Sent when an app was authorized by a user to a server or their account
*/
ApplicationAuthorized = 'APPLICATION_AUTHORIZED',
/**
* Sent when an app was deauthorized by a user
*/
ApplicationDeauthorized = 'APPLICATION_DEAUTHORIZED',
/**
* Entitlement was created
*/

View File

@@ -24,6 +24,7 @@ import type {
ChannelFlags,
APIAttachment,
APIMessageTopLevelComponent,
APIMessagePin,
} from '../../payloads/v10/mod.ts';
import type { _AddUndefinedToPossiblyUndefinedPropertiesOfInterface, _StrictPartial } from '../../utils/internals.ts';
import type { RESTAPIPoll } from './poll.ts';
@@ -617,17 +618,60 @@ export type RESTPostAPIChannelFollowersResult = APIFollowedChannel;
export type RESTPostAPIChannelTypingResult = never;
/**
* @see {@link https://discord.com/developers/docs/resources/channel#get-pinned-messages}
* @see {@link https://discord.com/developers/docs/resources/message#get-channel-pins}
*/
export interface RESTGetAPIChannelMessagesPinsQuery {
/**
* Get messages pinned before this timestamp
*/
before?: string;
/**
* Maximum number of pins to return (1-50).
*
* @defaultValue `50`
*/
limit?: number;
}
/**
* @see {@link https://discord.com/developers/docs/resources/message#get-channel-pins}
*/
export interface RESTGetAPIChannelMessagesPinsResult {
/**
* Array of pinned messages
*/
items: APIMessagePin[];
/**
* Whether there are more items available
*/
has_more: boolean;
}
/**
* @see {@link https://discord.com/developers/docs/resources/message#pin-message}
*/
export type RESTPutAPIChannelMessagesPinResult = never;
/**
* @see {@link https://discord.com/developers/docs/resources/message#unpin-message}
*/
export type RESTDeleteAPIChannelMessagesPinResult = never;
/**
* @see {@link https://discord.com/developers/docs/resources/message#get-pinned-messages-deprecated}
* @deprecated
*/
export type RESTGetAPIChannelPinsResult = APIMessage[];
/**
* @see {@link https://discord.com/developers/docs/resources/channel#pin-message}
* @see {@link https://discord.com/developers/docs/resources/message#pin-message-deprecated}
* @deprecated
*/
export type RESTPutAPIChannelPinResult = never;
/**
* @see {@link https://discord.com/developers/docs/resources/channel#unpin-message}
* @see {@link https://discord.com/developers/docs/resources/message#unpin-message-deprecated}
* @deprecated
*/
export type RESTDeleteAPIChannelPinResult = never;

View File

@@ -1,5 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import type { APIApplicationEmoji, APIEmoji } from '../../payloads/v10.ts';
import type { APIApplicationEmoji, APIEmoji } from '../../payloads/v10/mod.ts';
/**
* @see {@link https://discord.com/developers/docs/resources/emoji#list-guild-emojis}

85
deno/rest/v10/guild.ts generated
View File

@@ -26,6 +26,7 @@ import type {
GuildWidgetStyle,
APIGuildOnboardingPrompt,
APIGuildOnboardingPromptOption,
APIRoleColors,
} from '../../payloads/v10/mod.ts';
import type {
_AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
@@ -96,7 +97,8 @@ export interface RESTAPIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
export type APIGuildCreateRole = RESTAPIGuildCreateRole;
/**
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild}
* @see {@link https://discord.com/developers/docs/change-log#guild-create-deprecation}
* @deprecated
*/
export interface RESTPostAPIGuildsJSONBody {
/**
@@ -184,12 +186,14 @@ export interface RESTPostAPIGuildsJSONBody {
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild}
* @see {@link https://discord.com/developers/docs/change-log#guild-create-deprecation}
* @deprecated
*/
export type RESTPostAPIGuildsResult = APIGuild;
/**
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level}
* @see {@link https://discord.com/developers/docs/change-log#guild-create-deprecation}
* @deprecated
*/
export interface RESTPostAPIGuildsMFAJSONBody {
/**
@@ -201,7 +205,8 @@ export interface RESTPostAPIGuildsMFAJSONBody {
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level}
* @see {@link https://discord.com/developers/docs/change-log#guild-create-deprecation}
* @deprecated
*/
export type RESTPostAPIGuildsMFAResult = RESTPostAPIGuildsMFAJSONBody;
@@ -275,6 +280,8 @@ export interface RESTPatchAPIGuildJSONBody {
icon?: string | null | undefined;
/**
* User id to transfer guild ownership to (must be owner)
*
* @deprecated
*/
owner_id?: Snowflake | undefined;
/**
@@ -341,7 +348,8 @@ export interface RESTPatchAPIGuildJSONBody {
export type RESTPatchAPIGuildResult = APIGuild;
/**
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild}
* @see {@link https://discord.com/developers/docs/change-log#guild-create-deprecation}
* @deprecated
*/
export type RESTDeleteAPIGuildResult = never;
@@ -676,8 +684,15 @@ export interface RESTPostAPIGuildRoleJSONBody {
* RGB color value
*
* @defaultValue `0`
* @remarks `color` will still be returned by the API, but using the `colors` field is recommended when doing requests.
*/
color?: number | null | undefined;
/**
* The role's colors
*
* @defaultValue `{ "primary_color": 0, "secondary_color": null, "tertiary_color": null }`
*/
colors?: APIRoleColors | undefined;
/**
* Whether the role should be displayed separately in the sidebar
*
@@ -738,8 +753,14 @@ export interface RESTPatchAPIGuildRoleJSONBody {
permissions?: Permissions | null | undefined;
/**
* RGB color value
*
* @remarks `color` will still be returned by the API, but using the `colors` field is recommended when doing requests.
*/
color?: number | null | undefined;
/**
* The role's colors
*/
colors?: APIRoleColors | undefined;
/**
* Whether the role should be displayed separately in the sidebar
*/
@@ -952,38 +973,40 @@ export type RESTPutAPIGuildOnboardingJSONBody = _AddUndefinedToPossiblyUndefined
prompts?: RESTAPIGuildOnboardingPrompt[] | undefined;
};
export type RESTAPIGuildOnboardingPrompt = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
> &
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
/**
* Options available within the prompt
*/
options: RESTAPIGuildOnboardingPromptOption[];
};
export interface RESTAPIGuildOnboardingPrompt
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
>,
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> {
/**
* Options available within the prompt
*/
options: RESTAPIGuildOnboardingPromptOption[];
}
/**
* @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead.
*/
export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt;
export type RESTAPIGuildOnboardingPromptOption = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
> &
Pick<APIGuildOnboardingPromptOption, 'title'> & {
/**
* Emoji id
*/
emoji_id?: Snowflake | null | undefined;
/**
* Emoji name
*/
emoji_name?: string | null | undefined;
/**
* Whether this emoji is animated
*/
emoji_animated?: boolean | null | undefined;
};
export interface RESTAPIGuildOnboardingPromptOption
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
>,
Pick<APIGuildOnboardingPromptOption, 'title'> {
/**
* Emoji id
*/
emoji_id?: Snowflake | null | undefined;
/**
* Emoji name
*/
emoji_name?: string | null | undefined;
/**
* Whether this emoji is animated
*/
emoji_animated?: boolean | null | undefined;
}
/**
* @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead.

View File

@@ -94,17 +94,18 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
/**
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
*/
export type RESTPatchAPIGuildScheduledEventJSONBody = _Nullable<
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
> &
_StrictPartial<
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
> & {
/**
* The status of the scheduled event
*/
status?: GuildScheduledEventStatus | undefined;
};
export interface RESTPatchAPIGuildScheduledEventJSONBody
extends _Nullable<
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
>,
_StrictPartial<
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
> {
/**
* The status of the scheduled event
*/
status?: GuildScheduledEventStatus | undefined;
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}

View File

@@ -47,26 +47,29 @@ export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[];
*/
export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;
export type RESTPostAPIBaseApplicationCommandsJSONBody = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Omit<
APIApplicationCommand,
| 'application_id'
| 'contexts'
| 'default_member_permissions'
| 'description_localized'
| 'description'
| 'guild_id'
| 'id'
| 'integration_types'
| 'name_localized'
| 'type'
| 'version'
> &
Partial<
_NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
>
>;
export interface RESTPostAPIBaseApplicationCommandsJSONBody
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Omit<
APIApplicationCommand,
| 'application_id'
| 'contexts'
| 'default_member_permissions'
| 'description_localized'
| 'description'
| 'guild_id'
| 'id'
| 'integration_types'
| 'name_localized'
| 'type'
| 'version'
>
>,
_AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<
_NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
>
> {}
/**
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}

76
deno/rest/v10/mod.ts generated
View File

@@ -2,26 +2,26 @@ import type { Snowflake } from '../../globals.ts';
import { urlSafeCharacters } from '../../utils/internals.ts';
export * from '../common.ts';
export * from './application.ts';
export * from './auditLog.ts';
export * from './autoModeration.ts';
export type * from './application.ts';
export type * from './auditLog.ts';
export type * from './autoModeration.ts';
export * from './channel.ts';
export * from './emoji.ts';
export * from './gateway.ts';
export * from './guild.ts';
export * from './guildScheduledEvent.ts';
export * from './interactions.ts';
export * from './invite.ts';
export type * from './emoji.ts';
export type * from './gateway.ts';
export type * from './guild.ts';
export type * from './guildScheduledEvent.ts';
export type * from './interactions.ts';
export type * from './invite.ts';
export * from './monetization.ts';
export * from './oauth2.ts';
export * from './poll.ts';
export * from './soundboard.ts';
export * from './stageInstance.ts';
export * from './sticker.ts';
export * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export * from './webhook.ts';
export type * from './oauth2.ts';
export type * from './poll.ts';
export type * from './soundboard.ts';
export type * from './stageInstance.ts';
export type * from './sticker.ts';
export type * from './template.ts';
export type * from './user.ts';
export type * from './voice.ts';
export type * from './webhook.ts';
export const APIVersion = '10';
@@ -181,9 +181,28 @@ export const Routes = {
return `/channels/${channelId}/typing` as const;
},
/**
* Route for:
* - GET `/channels/{channel.id}/messages/pins`
*/
channelMessagesPins(channelId: Snowflake) {
return `/channels/${channelId}/messages/pins` as const;
},
/**
* Route for:
* - PUT `/channels/{channel.id}/messages/pins/{message.id}`
* - DELETE `/channels/{channel.id}/messages/pins/{message.id}`
*/
channelMessagesPin(channelId: Snowflake, messageId: Snowflake) {
return `/channels/${channelId}/messages/pins/${messageId}` as const;
},
/**
* Route for:
* - GET `/channels/{channel.id}/pins`
*
* @deprecated Use {@link Routes.channelMessagesPins} instead.
*/
channelPins(channelId: Snowflake) {
return `/channels/${channelId}/pins` as const;
@@ -193,6 +212,8 @@ export const Routes = {
* Route for:
* - PUT `/channels/{channel.id}/pins/{message.id}`
* - DELETE `/channels/{channel.id}/pins/{message.id}`
*
* @deprecated Use {@link Routes.channelMessagesPin} instead.
*/
channelPin(channelId: Snowflake, messageId: Snowflake) {
return `/channels/${channelId}/pins/${messageId}` as const;
@@ -229,6 +250,8 @@ export const Routes = {
/**
* Route for:
* - POST `/guilds`
*
* @deprecated {@link https://discord.com/developers/docs/change-log#guild-create-deprecation}
*/
guilds() {
return '/guilds' as const;
@@ -238,7 +261,7 @@ export const Routes = {
* Route for:
* - GET `/guilds/{guild.id}`
* - PATCH `/guilds/{guild.id}`
* - DELETE `/guilds/{guild.id}`
* - DELETE `/guilds/{guild.id}` (**deprecated**)
*/
guild(guildId: Snowflake) {
return `/guilds/${guildId}` as const;
@@ -312,6 +335,8 @@ export const Routes = {
/**
* Route for:
* - POST `/guilds/{guild.id}/mfa`
*
* @deprecated
*/
guildMFA(guildId: Snowflake) {
return `/guilds/${guildId}/mfa` as const;
@@ -441,7 +466,7 @@ export const Routes = {
/**
* Route for:
* - GET `/guilds/templates/{template.code}`
* - POST `/guilds/templates/{template.code}`
* - POST `/guilds/templates/{template.code}` (**deprecated**)
*/
template(code: string) {
return `/guilds/templates/${code}` as const;
@@ -1382,6 +1407,16 @@ export const CDNRoutes = {
soundboardSound(soundId: Snowflake) {
return `/soundboard-sounds/${soundId}` as const;
},
/**
* Route for:
* - GET `/guild-tag-badges/{guild.id}/{badge}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
guildTagBadge<Format extends GuildTagBadgeFormat>(guildId: Snowflake, guildTagBadge: string, format: Format) {
return `/guild-tag-badges/${guildId}/${guildTagBadge}.${format}` as const;
},
};
for (const [key, fn] of Object.entries(CDNRoutes)) {
@@ -1428,6 +1463,7 @@ export type StickerFormat = Extract<ImageFormat, ImageFormat.GIF | ImageFormat.L
export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type GuildTagBadgeFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
/**
* @deprecated Use {@link DefaultUserAvatarFormat} instead.

View File

@@ -62,15 +62,20 @@ export interface RESTPostOAuth2AuthorizationQueryResult {
export type RESTOAuth2AuthorizationQueryResult = RESTPostOAuth2AuthorizationQueryResult;
/**
* @remarks
* This endpoint requires either HTTP Basic authentication using `client_id:client_secret`,
* or the `client_id` and `client_secret` must be provided in the form body.
* @see {@link https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example}
*/
export interface RESTPostOAuth2AccessTokenURLEncodedData {
client_id: Snowflake;
client_secret: string;
export type RESTPostOAuth2AccessTokenURLEncodedData = RESTOAuth2TokenOptionalClientCredentials & {
grant_type: 'authorization_code';
code: string;
redirect_uri?: string;
}
};
export type RESTOAuth2TokenOptionalClientCredentials =
| { client_id: Snowflake; client_secret: string }
| { client_id?: never; client_secret?: never };
/**
* @see {@link https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-access-token-response}
@@ -84,14 +89,15 @@ export interface RESTPostOAuth2AccessTokenResult {
}
/**
* @remarks
* This endpoint requires either HTTP Basic authentication using `client_id:client_secret`,
* or the `client_id` and `client_secret` must be provided in the form body.
* @see {@link https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-refresh-token-exchange-example}
*/
export interface RESTPostOAuth2RefreshTokenURLEncodedData {
client_id: Snowflake;
client_secret: string;
export type RESTPostOAuth2RefreshTokenURLEncodedData = RESTOAuth2TokenOptionalClientCredentials & {
grant_type: 'refresh_token';
refresh_token: string;
}
};
export type RESTPostOAuth2RefreshTokenResult = RESTPostOAuth2AccessTokenResult;

8
deno/rest/v10/poll.ts generated
View File

@@ -1,5 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import type { APIMessage, APIPoll, APIPollAnswer, APIUser } from '../../v10.ts';
import type { APIBasePoll, APIBasePollAnswer, APIMessage, APIPollDefaults, APIUser } from '../../v10.ts';
/**
* @see {@link https://discord.com/developers/docs/resources/poll#get-answer-voters}
@@ -20,13 +20,11 @@ export interface RESTGetAPIPollAnswerVotersQuery {
/**
* @see {@link https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure}
*/
export interface RESTAPIPoll
extends Omit<APIPoll, 'allow_multiselect' | 'answers' | 'expiry' | 'layout_type' | 'results'>,
Partial<Pick<APIPoll, 'allow_multiselect' | 'layout_type'>> {
export interface RESTAPIPoll extends APIBasePoll, Partial<APIPollDefaults> {
/**
* Each of the answers available in the poll, up to 10
*/
answers: Omit<APIPollAnswer, 'answer_id'>[];
answers: APIBasePollAnswer[];
/**
* Number of hours the poll should be open for, up to 32 days
*

View File

@@ -7,7 +7,8 @@ import type { _StrictPartial } from '../../utils/internals.ts';
export type RESTGetAPITemplateResult = APITemplate;
/**
* @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template}
* @see {@link https://discord.com/developers/docs/change-log#guild-create-deprecation}
* @deprecated
*/
export interface RESTPostAPITemplateCreateGuildJSONBody {
/**
@@ -23,7 +24,8 @@ export interface RESTPostAPITemplateCreateGuildJSONBody {
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template}
* @see {@link https://discord.com/developers/docs/change-log#guild-create-deprecation}
* @deprecated
*/
export type RESTPostAPITemplateCreateGuildResult = APIGuild;

View File

@@ -24,6 +24,7 @@ import type {
ChannelFlags,
APIAttachment,
APIMessageTopLevelComponent,
APIMessagePin,
} from '../../payloads/v9/mod.ts';
import type { _AddUndefinedToPossiblyUndefinedPropertiesOfInterface, _StrictPartial } from '../../utils/internals.ts';
import type { RESTAPIPoll } from './poll.ts';
@@ -631,12 +632,54 @@ export type RESTPostAPIChannelFollowersResult = APIFollowedChannel;
export type RESTPostAPIChannelTypingResult = never;
/**
* @see {@link https://discord.com/developers/docs/resources/channel#get-pinned-messages}
* @see {@link https://discord.com/developers/docs/resources/message#get-channel-pins}
*/
export interface RESTGetAPIChannelMessagesPinsQuery {
/**
* Get messages pinned before this timestamp
*/
before?: string;
/**
* Maximum number of pins to return (1-50).
*
* @defaultValue `50`
*/
limit?: number;
}
/**
* @see {@link https://discord.com/developers/docs/resources/message#get-channel-pins}
*/
export interface RESTGetAPIChannelMessagesPinsResult {
/**
* Array of pinned messages
*/
items: APIMessagePin[];
/**
* Whether there are more items available
*/
has_more: boolean;
}
/**
* @see {@link https://discord.com/developers/docs/resources/message#pin-message}
*/
export type RESTPutAPIChannelMessagesPinResult = never;
/**
* @see {@link https://discord.com/developers/docs/resources/message#unpin-message}
*/
export type RESTDeleteAPIChannelMessagesPinResult = never;
/**
* @see {@link https://discord.com/developers/docs/resources/message#get-pinned-messages-deprecated}
* @deprecated
*/
export type RESTGetAPIChannelPinsResult = APIMessage[];
/**
* @see {@link https://discord.com/developers/docs/resources/channel#pin-message}
* @see {@link https://discord.com/developers/docs/resources/message#pin-message-deprecated}
* @deprecated
*/
export type RESTPutAPIChannelPinResult = never;

2
deno/rest/v9/emoji.ts generated
View File

@@ -1,5 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import type { APIApplicationEmoji, APIEmoji } from '../../payloads/v9.ts';
import type { APIApplicationEmoji, APIEmoji } from '../../payloads/v9/mod.ts';
/**
* @see {@link https://discord.com/developers/docs/resources/emoji#list-guild-emojis}

83
deno/rest/v9/guild.ts generated
View File

@@ -26,6 +26,7 @@ import type {
APIGroupDMChannel,
APIGuildOnboardingPrompt,
APIGuildOnboardingPromptOption,
APIRoleColors,
} from '../../payloads/v9/mod.ts';
import type {
_AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
@@ -97,6 +98,7 @@ export type APIGuildCreateRole = RESTAPIGuildCreateRole;
/**
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild}
* @deprecated {@link https://discord.com/developers/docs/change-log#guild-create-deprecation}
*/
export interface RESTPostAPIGuildsJSONBody {
/**
@@ -184,12 +186,14 @@ export interface RESTPostAPIGuildsJSONBody {
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild}
* @see {@link https://discord.com/developers/docs/change-log#guild-create-deprecation}
* @deprecated
*/
export type RESTPostAPIGuildsResult = APIGuild;
/**
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level}
* @see {@link https://discord.com/developers/docs/change-log#guild-create-deprecation}
* @deprecated
*/
export interface RESTPostAPIGuildsMFAJSONBody {
/**
@@ -201,7 +205,8 @@ export interface RESTPostAPIGuildsMFAJSONBody {
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level}
* @see {@link https://discord.com/developers/docs/change-log#guild-create-deprecation}
* @deprecated
*/
export type RESTPostAPIGuildsMFAResult = RESTPostAPIGuildsMFAJSONBody;
@@ -275,6 +280,8 @@ export interface RESTPatchAPIGuildJSONBody {
icon?: string | null | undefined;
/**
* User id to transfer guild ownership to (must be owner)
*
* @deprecated
*/
owner_id?: Snowflake | undefined;
/**
@@ -341,7 +348,8 @@ export interface RESTPatchAPIGuildJSONBody {
export type RESTPatchAPIGuildResult = APIGuild;
/**
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild}
* @see {@link https://discord.com/developers/docs/change-log#guild-create-deprecation}
* @deprecated
*/
export type RESTDeleteAPIGuildResult = never;
@@ -682,8 +690,15 @@ export interface RESTPostAPIGuildRoleJSONBody {
* RGB color value
*
* @defaultValue `0`
* @remarks `color` will still be returned by the API, but using the `colors` field is recommended when doing requests.
*/
color?: number | null | undefined;
/**
* The role's colors
*
* @defaultValue `{ "primary_color": 0, "secondary_color": null, "tertiary_color": null }`
*/
colors?: APIRoleColors | undefined;
/**
* Whether the role should be displayed separately in the sidebar
*
@@ -744,8 +759,14 @@ export interface RESTPatchAPIGuildRoleJSONBody {
permissions?: Permissions | null | undefined;
/**
* RGB color value
*
* @remarks `color` will still be returned by the API, but using the `colors` field is recommended when doing requests.
*/
color?: number | null | undefined;
/**
* The role's colors
*/
colors?: APIRoleColors | undefined;
/**
* Whether the role should be displayed separately in the sidebar
*/
@@ -958,38 +979,40 @@ export type RESTPutAPIGuildOnboardingJSONBody = _AddUndefinedToPossiblyUndefined
prompts?: RESTAPIGuildOnboardingPrompt[] | undefined;
};
export type RESTAPIGuildOnboardingPrompt = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
> &
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
/**
* Options available within the prompt
*/
options: RESTAPIGuildOnboardingPromptOption[];
};
export interface RESTAPIGuildOnboardingPrompt
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
>,
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> {
/**
* Options available within the prompt
*/
options: RESTAPIGuildOnboardingPromptOption[];
}
/**
* @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead.
*/
export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt;
export type RESTAPIGuildOnboardingPromptOption = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
> &
Pick<APIGuildOnboardingPromptOption, 'title'> & {
/**
* Emoji id
*/
emoji_id?: Snowflake | null | undefined;
/**
* Emoji name
*/
emoji_name?: string | null | undefined;
/**
* Whether this emoji is animated
*/
emoji_animated?: boolean | null | undefined;
};
export interface RESTAPIGuildOnboardingPromptOption
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
>,
Pick<APIGuildOnboardingPromptOption, 'title'> {
/**
* Emoji id
*/
emoji_id?: Snowflake | null | undefined;
/**
* Emoji name
*/
emoji_name?: string | null | undefined;
/**
* Whether this emoji is animated
*/
emoji_animated?: boolean | null | undefined;
}
/**
* @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead.

View File

@@ -94,17 +94,18 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
/**
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
*/
export type RESTPatchAPIGuildScheduledEventJSONBody = _Nullable<
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
> &
_StrictPartial<
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
> & {
/**
* The status of the scheduled event
*/
status?: GuildScheduledEventStatus | undefined;
};
export interface RESTPatchAPIGuildScheduledEventJSONBody
extends _Nullable<
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
>,
_StrictPartial<
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
> {
/**
* The status of the scheduled event
*/
status?: GuildScheduledEventStatus | undefined;
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}

View File

@@ -47,26 +47,29 @@ export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[];
*/
export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;
export type RESTPostAPIBaseApplicationCommandsJSONBody = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Omit<
APIApplicationCommand,
| 'application_id'
| 'contexts'
| 'default_member_permissions'
| 'description_localized'
| 'description'
| 'guild_id'
| 'id'
| 'integration_types'
| 'name_localized'
| 'type'
| 'version'
> &
Partial<
_NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
>
>;
export interface RESTPostAPIBaseApplicationCommandsJSONBody
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Omit<
APIApplicationCommand,
| 'application_id'
| 'contexts'
| 'default_member_permissions'
| 'description_localized'
| 'description'
| 'guild_id'
| 'id'
| 'integration_types'
| 'name_localized'
| 'type'
| 'version'
>
>,
_AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<
_NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
>
> {}
/**
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}

76
deno/rest/v9/mod.ts generated
View File

@@ -2,26 +2,26 @@ import type { Snowflake } from '../../globals.ts';
import { urlSafeCharacters } from '../../utils/internals.ts';
export * from '../common.ts';
export * from './application.ts';
export * from './auditLog.ts';
export * from './autoModeration.ts';
export type * from './application.ts';
export type * from './auditLog.ts';
export type * from './autoModeration.ts';
export * from './channel.ts';
export * from './emoji.ts';
export * from './gateway.ts';
export * from './guild.ts';
export * from './guildScheduledEvent.ts';
export * from './interactions.ts';
export * from './invite.ts';
export type * from './emoji.ts';
export type * from './gateway.ts';
export type * from './guild.ts';
export type * from './guildScheduledEvent.ts';
export type * from './interactions.ts';
export type * from './invite.ts';
export * from './monetization.ts';
export * from './oauth2.ts';
export * from './poll.ts';
export * from './soundboard.ts';
export * from './stageInstance.ts';
export * from './sticker.ts';
export * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export * from './webhook.ts';
export type * from './oauth2.ts';
export type * from './poll.ts';
export type * from './soundboard.ts';
export type * from './stageInstance.ts';
export type * from './sticker.ts';
export type * from './template.ts';
export type * from './user.ts';
export type * from './voice.ts';
export type * from './webhook.ts';
export const APIVersion = '9';
@@ -181,9 +181,28 @@ export const Routes = {
return `/channels/${channelId}/typing` as const;
},
/**
* Route for:
* - GET `/channels/{channel.id}/messages/pins`
*/
channelMessagesPins(channelId: Snowflake) {
return `/channels/${channelId}/messages/pins` as const;
},
/**
* Route for:
* - PUT `/channels/{channel.id}/messages/pins/{message.id}`
* - DELETE `/channels/{channel.id}/messages/pins/{message.id}`
*/
channelMessagesPin(channelId: Snowflake, messageId: Snowflake) {
return `/channels/${channelId}/messages/pins/${messageId}` as const;
},
/**
* Route for:
* - GET `/channels/{channel.id}/pins`
*
* @deprecated Use {@link Routes.channelMessagesPins} instead.
*/
channelPins(channelId: Snowflake) {
return `/channels/${channelId}/pins` as const;
@@ -193,6 +212,8 @@ export const Routes = {
* Route for:
* - PUT `/channels/{channel.id}/pins/{message.id}`
* - DELETE `/channels/{channel.id}/pins/{message.id}`
*
* @deprecated Use {@link Routes.channelMessagesPin} instead.
*/
channelPin(channelId: Snowflake, messageId: Snowflake) {
return `/channels/${channelId}/pins/${messageId}` as const;
@@ -229,6 +250,8 @@ export const Routes = {
/**
* Route for:
* - POST `/guilds`
*
* @deprecated {@link https://discord.com/developers/docs/change-log#guild-create-deprecation}
*/
guilds() {
return '/guilds' as const;
@@ -238,7 +261,7 @@ export const Routes = {
* Route for:
* - GET `/guilds/{guild.id}`
* - PATCH `/guilds/{guild.id}`
* - DELETE `/guilds/{guild.id}`
* - DELETE `/guilds/{guild.id}` (**deprecated**)
*/
guild(guildId: Snowflake) {
return `/guilds/${guildId}` as const;
@@ -312,6 +335,8 @@ export const Routes = {
/**
* Route for:
* - POST `/guilds/{guild.id}/mfa`
*
* @deprecated
*/
guildMFA(guildId: Snowflake) {
return `/guilds/${guildId}/mfa` as const;
@@ -441,7 +466,7 @@ export const Routes = {
/**
* Route for:
* - GET `/guilds/templates/{template.code}`
* - POST `/guilds/templates/{template.code}`
* - POST `/guilds/templates/{template.code}` (**deprecated**)
*/
template(code: string) {
return `/guilds/templates/${code}` as const;
@@ -1391,6 +1416,16 @@ export const CDNRoutes = {
soundboardSound(soundId: Snowflake) {
return `/soundboard-sounds/${soundId}` as const;
},
/**
* Route for:
* - GET `/guild-tag-badges/{guild.id}/{badge}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
guildTagBadge<Format extends GuildTagBadgeFormat>(guildId: Snowflake, guildTagBadge: string, format: Format) {
return `/guild-tag-badges/${guildId}/${guildTagBadge}.${format}` as const;
},
};
for (const [key, fn] of Object.entries(CDNRoutes)) {
@@ -1437,6 +1472,7 @@ export type StickerFormat = Extract<ImageFormat, ImageFormat.GIF | ImageFormat.L
export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type GuildTagBadgeFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
/**
* @deprecated Use {@link DefaultUserAvatarFormat} instead.

22
deno/rest/v9/oauth2.ts generated
View File

@@ -62,15 +62,20 @@ export interface RESTPostOAuth2AuthorizationQueryResult {
export type RESTOAuth2AuthorizationQueryResult = RESTPostOAuth2AuthorizationQueryResult;
/**
* @remarks
* This endpoint requires either HTTP Basic authentication using `client_id:client_secret`,
* or the `client_id` and `client_secret` must be provided in the form body.
* @see {@link https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example}
*/
export interface RESTPostOAuth2AccessTokenURLEncodedData {
client_id: Snowflake;
client_secret: string;
export type RESTPostOAuth2AccessTokenURLEncodedData = RESTOAuth2TokenOptionalClientCredentials & {
grant_type: 'authorization_code';
code: string;
redirect_uri?: string;
}
};
export type RESTOAuth2TokenOptionalClientCredentials =
| { client_id: Snowflake; client_secret: string }
| { client_id?: never; client_secret?: never };
/**
* @see {@link https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-access-token-response}
@@ -84,14 +89,15 @@ export interface RESTPostOAuth2AccessTokenResult {
}
/**
* @remarks
* This endpoint requires either HTTP Basic authentication using `client_id:client_secret`,
* or the `client_id` and `client_secret` must be provided in the form body.
* @see {@link https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-refresh-token-exchange-example}
*/
export interface RESTPostOAuth2RefreshTokenURLEncodedData {
client_id: Snowflake;
client_secret: string;
export type RESTPostOAuth2RefreshTokenURLEncodedData = RESTOAuth2TokenOptionalClientCredentials & {
grant_type: 'refresh_token';
refresh_token: string;
}
};
export type RESTPostOAuth2RefreshTokenResult = RESTPostOAuth2AccessTokenResult;

8
deno/rest/v9/poll.ts generated
View File

@@ -1,5 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import type { APIMessage, APIPoll, APIPollAnswer, APIUser } from '../../v9.ts';
import type { APIBasePoll, APIBasePollAnswer, APIMessage, APIPollDefaults, APIUser } from '../../v9.ts';
/**
* @see {@link https://discord.com/developers/docs/resources/poll#get-answer-voters}
@@ -20,13 +20,11 @@ export interface RESTGetAPIPollAnswerVotersQuery {
/**
* @see {@link https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure}
*/
export interface RESTAPIPoll
extends Omit<APIPoll, 'allow_multiselect' | 'answers' | 'expiry' | 'layout_type' | 'results'>,
Partial<Pick<APIPoll, 'allow_multiselect' | 'layout_type'>> {
export interface RESTAPIPoll extends APIBasePoll, Partial<APIPollDefaults> {
/**
* Each of the answers available in the poll, up to 10
*/
answers: Omit<APIPollAnswer, 'answer_id'>[];
answers: APIBasePollAnswer[];
/**
* Number of hours the poll should be open for, up to 32 days
*

View File

@@ -7,7 +7,8 @@ import type { _StrictPartial } from '../../utils/internals.ts';
export type RESTGetAPITemplateResult = APITemplate;
/**
* @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template}
* @see {@link https://discord.com/developers/docs/change-log#guild-create-deprecation}
* @deprecated
*/
export interface RESTPostAPITemplateCreateGuildJSONBody {
/**
@@ -23,12 +24,13 @@ export interface RESTPostAPITemplateCreateGuildJSONBody {
}
/**
* @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template}
* @see {@link https://discord.com/developers/docs/change-log#guild-create-deprecation}
*/
export type RESTPostAPITemplateCreateGuildResult = APIGuild;
/**
* @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-templates}
* @deprecated
*/
export type RESTGetAPIGuildTemplatesResult = APITemplate[];

12
deno/rpc/common.ts generated
View File

@@ -26,12 +26,18 @@ export interface RPCAPIMessageParsedContentOriginalMatch {
/**
* @unstable
*/
export interface RPCAPIMessageParsedContentText {
export interface RPCAPIBaseMessageParsedContentText {
type: 'text';
originalMatch: RPCAPIMessageParsedContentOriginalMatch;
content: string;
}
/**
* @unstable
*/
export interface RPCAPIMessageParsedContentText extends RPCAPIBaseMessageParsedContentText {
originalMatch: RPCAPIMessageParsedContentOriginalMatch;
}
/**
* @unstable
*/
@@ -44,7 +50,7 @@ export interface RPCAPIMessageParsedContentMention {
* Same as {@link RPCAPIMessageParsedContentMention.userId}
*/
parsedUserId: RPCAPIMessageParsedContentMention['userId'];
content: Omit<RPCAPIMessageParsedContentText, 'originalMatch'>;
content: RPCAPIBaseMessageParsedContentText;
}
/**

4
deno/rpc/v10.ts generated
View File

@@ -1,7 +1,9 @@
/* eslint-disable @typescript-eslint/no-empty-interface */
import type {
APIBaseMessageNoChannel,
APIInvite,
APIMessage,
APIMessageMentions,
APIPartialChannel,
APIPartialGuild,
APIUser,
@@ -50,7 +52,7 @@ export interface Relationship {
/**
* @unstable
*/
export interface RPCAPIMessage extends Omit<APIMessage, 'channel_id'> {
export interface RPCAPIMessage extends APIBaseMessageNoChannel, APIMessageMentions {
/**
* The nickname of the user who sent the message
*/

4
deno/rpc/v9.ts generated
View File

@@ -1,5 +1,5 @@
import type { Snowflake } from '../globals.ts';
import type { APIMessage, APIUser } from '../v9.ts';
import type { APIBaseMessageNoChannel, APIMessageMentions, APIUser } from '../v9.ts';
import type { RelationshipType, RPCAPIMessageParsedContentMention, RPCAPIMessageParsedContentText } from './common.ts';
export * from './common.ts';
@@ -25,7 +25,7 @@ export interface Relationship {
/**
* @unstable
*/
export interface RPCAPIMessage extends Omit<APIMessage, 'channel_id'> {
export interface RPCAPIMessage extends APIBaseMessageNoChannel, APIMessageMentions {
/**
* The nickname of the user who sent the message
*/

2
deno/voice/mod.ts generated
View File

@@ -1,4 +1,4 @@
// This file exports all the types available in the recommended voice gateway version
// Thereby, things MAY break in the future. Try sticking to imports from a specific version
export * from './v4.ts';
export * from './v8.ts';

62
deno/voice/v4.ts generated
View File

@@ -45,13 +45,63 @@ export enum VoiceOpcodes {
*/
Resumed,
/**
* A client has connected to the voice channel
* One or more clients have connected to the voice channel
*/
ClientConnect = 12,
ClientsConnect = 11,
/**
* Previously for when a client has connected to the voice channel, now unused
*
* @deprecated Not used
*/
ClientConnect,
/**
* A client has disconnected from the voice channel
*/
ClientDisconnect,
/**
* A downgrade from the DAVE protocol is upcoming
*/
DavePrepareTransition = 21,
/**
* Execute a previously announced protocol transition
*/
DaveExecuteTransition,
/**
* Acknowledge readiness previously announced transition
*/
DaveTransitionReady,
/**
* A DAVE protocol version or group change is upcoming
*/
DavePrepareEpoch,
/**
* Credential and public key for MLS external sender
*/
DaveMlsExternalSender,
/**
* MLS Key Package for pending group member
*/
DaveMlsKeyPackage,
/**
* MLS Proposals to be appended or revoked
*/
DaveMlsProposals,
/**
* MLS Commit with optional MLS Welcome messages
*/
DaveMlsCommitWelcome,
/**
* MLS Commit to be processed for upcoming transition
*/
DaveMlsAnnounceCommitTransition,
/**
* MLS Welcome to group for upcoming transition
*/
DaveMlsWelcome,
/**
* Flag invalid commit or welcome, request re-add
*/
DaveMlsInvalidCommitWelcome,
}
/**
@@ -110,4 +160,12 @@ export enum VoiceCloseCodes {
* You sent a malformed request
*/
BadRequest = 4_020,
/**
* Disconnect due to rate limit exceeded. Should not reconnect
*/
RateLimited,
/**
* Disconnect all clients due to call terminated (channel deleted, voice server changed, etc.). Should not reconnect
*/
CallTerminated,
}

706
deno/voice/v8.ts generated Normal file
View File

@@ -0,0 +1,706 @@
import type { Snowflake } from "../globals";
export const VoiceGatewayVersion = '8';
/**
* @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes}
*/
export enum VoiceOpcodes {
/**
* Begin a voice websocket connection
*/
Identify,
/**
* Select the voice protocol
*/
SelectProtocol,
/**
* Complete the websocket handshake
*/
Ready,
/**
* Keep the websocket connection alive
*/
Heartbeat,
/**
* Describe the session
*/
SessionDescription,
/**
* Indicate which users are speaking
*/
Speaking,
/**
* Sent to acknowledge a received client heartbeat
*/
HeartbeatAck,
/**
* Resume a connection
*/
Resume,
/**
* Time to wait between sending heartbeats in milliseconds
*/
Hello,
/**
* Acknowledge a successful session resume
*/
Resumed,
/**
* One or more clients have connected to the voice channel
*/
ClientsConnect = 11,
/**
* A client has disconnected from the voice channel
*/
ClientDisconnect = 13,
/**
* A downgrade from the DAVE protocol is upcoming
*/
DavePrepareTransition = 21,
/**
* Execute a previously announced protocol transition
*/
DaveExecuteTransition,
/**
* Acknowledge readiness previously announced transition
*/
DaveTransitionReady,
/**
* A DAVE protocol version or group change is upcoming
*/
DavePrepareEpoch,
/**
* Credential and public key for MLS external sender
*/
DaveMlsExternalSender,
/**
* MLS Key Package for pending group member
*/
DaveMlsKeyPackage,
/**
* MLS Proposals to be appended or revoked
*/
DaveMlsProposals,
/**
* MLS Commit with optional MLS Welcome messages
*/
DaveMlsCommitWelcome,
/**
* MLS Commit to be processed for upcoming transition
*/
DaveMlsAnnounceCommitTransition,
/**
* MLS Welcome to group for upcoming transition
*/
DaveMlsWelcome,
/**
* Flag invalid commit or welcome, request re-add
*/
DaveMlsInvalidCommitWelcome,
}
/**
* @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes}
*/
export enum VoiceCloseCodes {
/**
* You sent an invalid opcode
*/
UnknownOpcode = 4_001,
/**
* You sent a invalid payload in your identifying to the Gateway
*/
FailedToDecode,
/**
* You sent a payload before identifying with the Gateway
*/
NotAuthenticated,
/**
* The token you sent in your identify payload is incorrect
*/
AuthenticationFailed,
/**
* You sent more than one identify payload. Stahp
*/
AlreadyAuthenticated,
/**
* Your session is no longer valid
*/
SessionNoLongerValid,
/**
* Your session has timed out
*/
SessionTimeout = 4_009,
/**
* We can't find the server you're trying to connect to
*/
ServerNotFound = 4_011,
/**
* We didn't recognize the protocol you sent
*/
UnknownProtocol,
/**
* Either the channel was deleted, you were kicked, or the main gateway session was dropped. Should not reconnect
*/
Disconnected = 4_014,
/**
* The server crashed. Our bad! Try resuming
*/
VoiceServerCrashed,
/**
* We didn't recognize your encryption
*/
UnknownEncryptionMode,
/**
* You sent a malformed request
*/
BadRequest = 4_020,
/**
* Disconnect due to rate limit exceeded. Should not reconnect
*/
RateLimited,
/**
* Disconnect all clients due to call terminated (channel deleted, voice server changed, etc.). Should not reconnect
*/
CallTerminated,
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#transport-encryption-modes}
*/
export enum VoiceEncryptionMode {
/**
* AEAD AES256-GCM (RTP Size)
*/
AeadAes256GcmRtpSize = 'aead_aes256_gcm_rtpsize',
/**
* AEAD XChaCha20 Poly1305 (RTP Size)
*/
AeadXChaCha20Poly1305RtpSize = 'aead_xchacha20_poly1305_rtpsize',
/**
* XSalsa20 Poly1305 Lite (RTP Size)
*
* @deprecated This encryption mode has been discontinued.
*/
XSalsa20Poly1305LiteRtpSize = 'xsalsa20_poly1305_lite_rtpsize',
/**
* AEAD AES256-GCM
*
* @deprecated This encryption mode has been discontinued.
*/
AeadAes256Gcm = 'aead_aes256_gcm',
/**
* XSalsa20 Poly1305
*
* @deprecated This encryption mode has been discontinued.
*/
XSalsa20Poly1305 = 'xsalsa20_poly1305',
/**
* XSalsa20 Poly1305 Suffix
*
* @deprecated This encryption mode has been discontinued.
*/
XSalsa20Poly1305Suffix = 'xsalsa20_poly1305_suffix',
/**
* XSalsa20 Poly1305 Lite
*
* @deprecated This encryption mode has been discontinued.
*/
XSalsa20Poly1305Lite = 'xsalsa20_poly1305_lite',
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#speaking}
*/
export enum VoiceSpeakingFlags {
/**
* Normal transmission of voice audio
*/
Microphone = 1 << 0,
/**
* Transmission of context audio for video, no speaking indicator
*/
Soundshare = 1 << 1,
/**
* Priority speaker, lowering audio of other speakers
*/
Priority = 1 << 2,
}
export type VoiceSendPayload =
| VoiceDaveMlsInvalidCommitWelcome
| VoiceDaveTransitionReady
| VoiceHeartbeat
| VoiceIdentify
| VoiceResume
| VoiceSelectProtocol
| VoiceSpeakingSend;
export type VoiceReceivePayload =
| VoiceClientDisconnect
| VoiceClientsConnect
| VoiceDaveExecuteTransition
| VoiceDavePrepareEpoch
| VoiceDavePrepareTransition
| VoiceHeartbeatAck
| VoiceHello
| VoiceReady
| VoiceResumed
| VoiceSessionDescription
| VoiceSpeaking;
// #region Server Payloads
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#heartbeating}
*/
export type VoiceHello = _DataPayload<VoiceOpcodes.Hello, VoiceHelloData>;
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#heartbeating}
*/
export interface VoiceHelloData {
/**
* Voice gateway version
*
* @see {@link https://discord.com/developers/docs/topics/voice-connections#voice-gateway-versioning-gateway-versions}
*/
v: number;
/**
* The interval (in milliseconds) the client should heartbeat with
*/
heartbeat_interval: number;
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-websocket-connection}
*/
export type VoiceReady = _DataPayload<VoiceOpcodes.Ready, VoiceReadyData>;
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-websocket-connection}
*/
export interface VoiceReadyData {
/**
* SSRC identifier
*/
ssrc: number;
/**
* UDP IP
*/
ip: string;
/**
* UDP port
*/
port: number;
/**
* Supported encryption modes
*
* @see {@link https://discord.com/developers/docs/topics/voice-connections#transport-encryption-modes}
*/
modes: VoiceEncryptionMode[];
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#heartbeating}
*/
export type VoiceHeartbeatAck = _DataPayload<VoiceOpcodes.HeartbeatAck, VoiceHeartbeatAckData>;
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#heartbeating}
*/
export interface VoiceHeartbeatAckData {
/**
* The integer nonce
*/
t: number;
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#transport-encryption-and-sending-voice}
*/
export type VoiceSessionDescription = _DataPayload<VoiceOpcodes.SessionDescription, VoiceSessionDescriptionData>;
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#transport-encryption-and-sending-voice}
*/
export interface VoiceSessionDescriptionData {
/**
* The selected mode
*/
mode: VoiceEncryptionMode;
/**
* The secret key
*/
secret_key: number[];
/**
* The selected DAVE protocol version
*
* @see {@link https://daveprotocol.com/#select_protocol_ack-4}
*/
dave_protocol_version: number;
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#resuming-voice-connection}
*/
export type VoiceResumed = _DataPayload<VoiceOpcodes.Resumed, null>;
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#speaking}
*/
export type VoiceSpeaking = _DataPayload<VoiceOpcodes.Speaking, VoiceSpeakingData>;
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#speaking}
*/
export interface VoiceSpeakingData {
/**
* The speaking mode flags
*/
speaking: VoiceSpeakingFlags;
/**
* SSRC identifier
*/
ssrc: number;
/**
* User id
*/
user_id: Snowflake;
}
/**
* @see {@link https://daveprotocol.com/#clients_connect-11}
*/
export type VoiceClientsConnect = _DataPayload<VoiceOpcodes.ClientsConnect, VoiceClientsConnectData>;
/**
* @see {@link https://daveprotocol.com/#clients_connect-11}
*/
export interface VoiceClientsConnectData {
/**
* The connected user ids
*/
user_ids: Snowflake[];
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections}
*/
export type VoiceClientDisconnect = _DataPayload<VoiceOpcodes.ClientDisconnect, VoiceClientDisconnectData>;
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections}
*/
export interface VoiceClientDisconnectData {
/**
* The disconnected user id
*/
user_id: Snowflake;
}
/**
* @see {@link https://daveprotocol.com/#dave_protocol_prepare_transition-21}
*/
export type VoiceDavePrepareTransition = _DataPayload<VoiceOpcodes.DavePrepareTransition, VoiceDavePrepareTransitionData>;
/**
* @see {@link https://daveprotocol.com/#dave_protocol_prepare_transition-21}
*/
export interface VoiceDavePrepareTransitionData {
/**
* The protocol version
*/
protocol_version: number;
/**
* The transition id
*/
transition_id: number;
}
/**
* @see {@link https://daveprotocol.com/#dave_protocol_execute_transition-22}
*/
export type VoiceDaveExecuteTransition = _DataPayload<VoiceOpcodes.DaveExecuteTransition, VoiceDaveExecuteTransitionData>;
/**
* @see {@link https://daveprotocol.com/#dave_protocol_execute_transition-22}
*/
export interface VoiceDaveExecuteTransitionData {
/**
* The transition id
*/
transition_id: number;
}
/**
* @see {@link https://daveprotocol.com/#dave_mls_external_sender_package-25}
*/
export type VoiceDaveMlsExternalSender = VoiceBinaryPayload;
/**
* @see {@link https://daveprotocol.com/#dave_mls_proposals-27}
*/
export type VoiceDaveMlsProposals = VoiceBinaryPayload;
/**
* @see {@link https://daveprotocol.com/#dave_mls_announce_commit_transition-29}
*/
export type VoiceDaveMlsAnnounceCommitTransition = VoiceBinaryPayload;
/**
* @see {@link https://daveprotocol.com/#dave_mls_welcome-30}
*/
export type VoiceDaveMlsWelcome = VoiceBinaryPayload;
// #endregion Server Payloads
// #region Sendable Payloads
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-websocket-connection}
*/
export interface VoiceIdentify {
op: VoiceOpcodes.Identify;
d: VoiceIdentifyData;
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-websocket-connection}
*/
export interface VoiceIdentifyData {
/**
* The id of the server to connect to
*/
server_id: Snowflake;
/**
* The id of the user to connect as
*/
user_id: Snowflake;
/**
* Voice state session id
*/
session_id: string;
/**
* Voice connection token
*/
token: string;
/**
* The maximum DAVE protocol version supported
*/
max_dave_protocol_version?: number;
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-websocket-connection}
*/
export interface VoiceHeartbeat {
op: VoiceOpcodes.Heartbeat;
d: VoiceHeartbeatData;
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-websocket-connection}
*/
export interface VoiceHeartbeatData {
/**
* The integer nonce
*/
t: number;
/**
* The last sequence number recieved
*/
seq_ack: number;
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-udp-connection}
*/
export interface VoiceSelectProtocol {
op: VoiceOpcodes.SelectProtocol;
d: VoiceSelectProtocolData;
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-udp-connection}
*/
export interface VoiceSelectProtocolData {
/**
* Voice protocol
*/
protocol: string;
/**
* Data associated with the protocol
*/
data: VoiceUDPProtocolData;
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-udp-connection}
*/
export interface VoiceUDPProtocolData {
/**
* External address
*/
address: string;
/**
* External UDP port
*/
port: number;
/**
* Selected mode
*
* @see {@link https://discord.com/developers/docs/topics/voice-connections#transport-encryption-modes}
*/
mode: VoiceEncryptionMode;
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#resuming-voice-connection}
*/
export interface VoiceResume {
op: VoiceOpcodes.Resume;
d: VoiceResumeData;
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#resuming-voice-connection}
*/
export interface VoiceResumeData {
/**
* The id of the server to connect to
*/
server_id: Snowflake;
/**
* Voice state session id
*/
session_id: string;
/**
* Voice connection token
*/
token: string;
/**
* Last recieved sequence number
*/
seq_ack: number;
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#speaking}
*/
export interface VoiceSpeakingSend {
op: VoiceOpcodes.Speaking;
d: VoiceSpeakingSendData;
}
/**
* @see {@link https://discord.com/developers/docs/topics/voice-connections#speaking}
*/
export interface VoiceSpeakingSendData {
/**
* The speaking mode flags
*/
speaking: VoiceSpeakingFlags;
/**
* Voice delay
*/
delay: number;
/**
* SSRC identifier
*/
ssrc: number;
}
/**
* @see {@link https://daveprotocol.com/#dave_protocol_ready_for_transition-23}
*/
export interface VoiceDaveTransitionReady {
op: VoiceOpcodes.DaveTransitionReady;
d: VoiceDaveTransitionReadyData;
}
/**
* @see {@link https://daveprotocol.com/#dave_protocol_ready_for_transition-23}
*/
export interface VoiceDaveTransitionReadyData {
/**
* The transition id
*/
transition_id: number;
}
/**
* @see {@link https://daveprotocol.com/#dave_protocol_prepare_epoch-24}
*/
export interface VoiceDavePrepareEpoch {
op: VoiceOpcodes.DavePrepareEpoch;
d: VoiceDavePrepareEpochData;
}
/**
* @see {@link https://daveprotocol.com/#dave_protocol_prepare_epoch-24}
*/
export interface VoiceDavePrepareEpochData {
/**
* The protocol version
*/
protocol_version: number;
/**
* The epoch id
*/
epoch: number;
}
/**
* @see {@link https://daveprotocol.com/#dave_mls_invalid_commit_welcome-31}
*/
export interface VoiceDaveMlsInvalidCommitWelcome {
op: VoiceOpcodes.DaveMlsInvalidCommitWelcome;
d: VoiceDaveMlsInvalidCommitWelcomeData;
}
/**
* @see {@link https://daveprotocol.com/#dave_mls_invalid_commit_welcome-31}
*/
export interface VoiceDaveMlsInvalidCommitWelcomeData {
/**
* The transition id
*/
transition_id: number;
}
/**
* @see {@link https://daveprotocol.com/#dave_mls_key_package-26}
*/
export type VoiceDaveMlsKeyPackage = VoiceBinaryPayload;
/**
* @see {@link https://daveprotocol.com/#dave_mls_commit_welcome-28}
*/
export type VoiceDaveMlsCommitWelcome = VoiceBinaryPayload;
// #endregion
// #region Shared
export interface _BasePayload {
/**
* Opcode for the payload
*/
op: VoiceOpcodes;
/**
* Event data
*/
d?: unknown;
/**
* Sequence number, used for resuming sessions and heartbeats
*/
seq?: number;
}
export interface _DataPayload<Op extends VoiceOpcodes, D = unknown> extends _BasePayload {
op: Op;
d: D;
}
export type VoiceBinaryPayload = ArrayBuffer;
// #endregion Shared

343
eslint.config.ts Normal file
View File

@@ -0,0 +1,343 @@
import type { TSESTree, TSESLint } from '@typescript-eslint/utils';
import { AST_NODE_TYPES, ESLintUtils } from '@typescript-eslint/utils';
import common from 'eslint-config-neon/common';
import node from 'eslint-config-neon/node';
import prettier from 'eslint-config-neon/prettier';
import ts from 'eslint-config-neon/typescript';
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
import merge from 'lodash.merge';
import * as tsutils from 'tsutils';
import typescript from 'typescript';
import { config } from 'typescript-eslint';
function shouldRun(eslNode: TSESTree.TSPropertySignature, interfaceEndings: string[]): boolean {
// The first parent is the TSInterfaceBody, the second is the TSInterfaceDeclaration
const interfaceNode = eslNode.parent?.parent;
if (!(interfaceNode && 'id' in interfaceNode && interfaceNode.id?.type === AST_NODE_TYPES.Identifier)) {
return false;
}
const { name } = interfaceNode.id;
if (typeof name !== 'string') {
return false;
}
return interfaceEndings.some((ending) => name.endsWith(ending));
}
const REST_TYPE_NAME_REGEX =
/^REST(?:Get|Patch|Post|Put|Delete)[\dA-Za-z]+(?:JSONBody|FormDataBody|URLEncodedData|Result|Query)$/;
type Options = [{ interfaceEndings: string[] }];
const localPlugin: TSESLint.FlatConfig.Plugin = {
rules: {
'explicitly-optional-undefined-properties': ESLintUtils.RuleCreator.withoutDocs<Options, 'missingOptional'>({
create: (context) => {
const { interfaceEndings } = context.options[0];
return {
TSPropertySignature: (eslNode) => {
if (!shouldRun(eslNode, interfaceEndings)) {
return;
}
if (eslNode.optional) {
return;
}
const parserServices = ESLintUtils.getParserServices(context);
const checker = parserServices.program.getTypeChecker();
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(eslNode);
const type = checker.getApparentType(checker.getTypeAtLocation(tsNode));
const unionParts = tsutils.unionTypeParts(type);
// If our prop is not optional, but has undefined in its union, we should report
if (!unionParts.some((ty) => tsutils.isTypeFlagSet(ty, typescript.TypeFlags.Undefined))) {
return;
}
context.report({
node: eslNode,
messageId: 'missingOptional',
fix: (fixer) => fixer.insertTextAfter(eslNode.key, '?'),
});
},
};
},
meta: {
fixable: 'code',
messages: {
missingOptional: 'When a property has `| undefined`, it should be marked as optional.',
},
type: 'problem',
schema: [
{
type: 'object',
properties: {
interfaceEndings: {
type: 'array',
items: {
type: 'string',
},
},
},
},
],
},
defaultOptions: [{ interfaceEndings: [] }],
}),
'explicit-undefined-on-optional-properties': ESLintUtils.RuleCreator.withoutDocs<Options, 'missingUndefined'>({
create: (context) => {
const { interfaceEndings } = context.options[0];
return {
// This is done naively because type-checking the node will always include `| undefined`
// due to it being optional. ideally, we'd have a way to get the type of the node disregarding
// the optional flag, which would make this check a lot more trivial
TSPropertySignature: (eslNode) => {
if (!shouldRun(eslNode, interfaceEndings)) {
return;
}
// If our prop is't optional or if it doesn't have a type annotation, we don't need to do anything
if (!eslNode.optional || !eslNode.typeAnnotation) {
return;
}
const { typeAnnotation } = eslNode.typeAnnotation;
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
switch (typeAnnotation.type) {
case AST_NODE_TYPES.TSUnionType: {
if (
typeAnnotation.types.some(
(tNode) => tNode.type === AST_NODE_TYPES.TSUndefinedKeyword,
)
) {
return;
}
break;
}
case AST_NODE_TYPES.TSUndefinedKeyword: {
return;
}
}
context.report({
node: eslNode,
messageId: 'missingUndefined',
fix: (fixer) => fixer.insertTextAfter(eslNode.typeAnnotation!, ' | undefined'),
});
},
};
},
meta: {
fixable: 'code',
messages: {
missingUndefined: 'When a property is optional, explicitly include `undefined` in the union.',
},
type: 'suggestion',
schema: [
{
type: 'object',
properties: {
interfaceEndings: {
type: 'array',
items: {
type: 'string',
},
},
},
},
],
},
defaultOptions: [{ interfaceEndings: [] }],
}),
'rest-type-naming-convention': ESLintUtils.RuleCreator.withoutDocs<[{ whitelist: string[] }], 'invalidName'>({
create: (context) => {
const { whitelist } = context.options[0];
const whitelistSet = new Set(whitelist);
return {
'TSTypeAliasDeclaration, TSInterfaceDeclaration': (
node: TSESTree.TSInterfaceDeclaration | TSESTree.TSTypeAliasDeclaration,
) => {
if (node.id.type !== AST_NODE_TYPES.Identifier) {
return;
}
const { name } = node.id;
if (whitelistSet.has(name)) {
return;
}
if (!REST_TYPE_NAME_REGEX.test(name)) {
context.report({
node: node.id,
messageId: 'invalidName',
data: { name },
});
}
},
};
},
meta: {
messages: {
invalidName: `{{ name }} does not match REST type naming convention. Must match ${REST_TYPE_NAME_REGEX.source}.`,
},
type: 'problem',
schema: [
{
type: 'object',
properties: {
whitelist: {
type: 'array',
items: {
type: 'string',
},
},
},
},
],
},
defaultOptions: [{ whitelist: [] }],
}),
},
};
const commonFiles = '{js,mjs,cjs,ts,mts,cts}';
const commonRuleset = merge(...common, { files: [`**/*.${commonFiles}`] });
const nodeRuleset = merge(...node, { files: [`**/*${commonFiles}`] });
const prettierRuleset = merge(...prettier, { files: [`**/*${commonFiles}`] });
const tsRuleset = merge(...ts, {
files: [`**/*.${commonFiles}`],
languageOptions: {
parserOptions: {
warnOnUnsupportedTypeScriptVersion: false,
allowAutomaticSingleRunInference: true,
project: 'tsconfig.eslint.json',
},
},
settings: {
'import-x/resolver-next': [
createTypeScriptImportResolver({
project: 'tsconfig.eslint.json',
}),
],
},
});
export default config([
{
ignores: [
'deno/',
'gateway/v6/',
'payloads/v6/',
'rest/v6/',
'v6.ts',
'gateway/v8/',
'payloads/v8/',
'rest/v8/',
'utils/v8.ts',
'v8.ts',
'djs/**/*',
'.yarn/*',
'_generated_/**/*',
],
},
commonRuleset,
nodeRuleset,
tsRuleset,
prettierRuleset,
{
rules: {
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/prefer-literal-enum-member': 'off',
'@typescript-eslint/sort-type-union-intersection-members': 'off',
'import/extensions': 'off',
'tsdoc/syntax': 'off',
'typescript-sort-keys/interface': 'off',
'typescript-sort-keys/string-enum': 'off',
'unicorn/prefer-math-trunc': 'off',
'jsdoc/no-undefined-types': 'off',
'@typescript-eslint/no-empty-object-type': [
'error',
{
allowInterfaces: 'always',
},
],
},
},
{
plugins: {
local: localPlugin,
},
rules: {
'local/explicit-undefined-on-optional-properties': ['error', { interfaceEndings: ['JSONBody'] }],
'local/explicitly-optional-undefined-properties': ['error', { interfaceEndings: ['JSONBody'] }],
},
},
{
files: ['rest/v10/*.ts', 'rest/v9/*.ts'],
ignores: ['rest/v10/index.ts', 'rest/v9/index.ts'],
plugins: {
local: localPlugin,
},
rules: {
'local/rest-type-naming-convention': [
'error',
{
whitelist: [
'RESTAPIAttachment',
'RESTAPIChannelPatchOverwrite',
'RESTAPIGuildChannelResolvable',
'RESTAPIGuildCreateOverwrite',
'RESTAPIGuildCreatePartialChannel',
'RESTAPIGuildCreateRole',
'RESTAPIGuildOnboardingPrompt',
'RESTAPIGuildOnboardingPromptOption',
'RESTAPIInteractionCallbackActivityInstanceResource',
'RESTAPIInteractionCallbackObject',
'RESTAPIInteractionCallbackResourceObject',
'RESTAPIMessageReference',
'RESTAPIPartialCurrentUserGuild',
'RESTAPIPoll',
'RESTOAuth2TokenOptionalClientCredentials',
'RESTOAuth2AdvancedBotAuthorizationQuery',
'RESTOAuth2AdvancedBotAuthorizationQueryResult',
'RESTOAuth2AuthorizationQuery',
'RESTOAuth2BotAuthorizationQuery',
'RESTOAuth2ImplicitAuthorizationQuery',
'RESTOAuth2ImplicitAuthorizationURLFragmentResult',
// Deprecated types
'APIChannelPatchOverwrite',
'APIGuildChannelResolvable',
'APIGuildCreateOverwrite',
'APIGuildCreatePartialChannel',
'APIGuildCreateRole',
'APIMessageReferenceSend',
'GetAPIVoiceRegionsResult',
'RESTAPIModifyGuildOnboardingPromptData',
'RESTAPIModifyGuildOnboardingPromptOptionData',
'RESTAPIPollCreate',
'RESTDeleteAPIChannelMessageOwnReaction',
'RESTGetAPIStickerPack',
'RESTOAuth2AuthorizationQueryResult',
'RESTPostAPIEntitlementBody',
],
},
],
},
},
]);

View File

@@ -3,7 +3,6 @@
*/
import type { Snowflake } from '../globals';
import type { GatewayPresenceUpdate } from '../payloads/v10/gateway';
import type {
APIApplication,
APIApplicationCommandPermission,
@@ -16,7 +15,6 @@ import type {
APIGuildMember,
APIGuildScheduledEvent,
APIInteraction,
APIMessage,
APIRole,
APIStageInstance,
APISticker,
@@ -25,8 +23,8 @@ import type {
APIUnavailableGuild,
APIUser,
GatewayActivity,
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
GatewayThreadListSync as RawGatewayThreadListSync,
GatewayPresenceUpdate,
GatewayThreadListSync,
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
APIVoiceState,
InviteTargetType,
@@ -39,11 +37,21 @@ import type {
APISoundboardSound,
GuildChannelType,
ThreadChannelType,
APIBaseGuild,
APIBaseGuildMember,
APIBaseVoiceState,
APIBaseVoiceGuildMember,
APIGuildMemberJoined,
APIFlaggedGuildMember,
APIGuildMemberAvatar,
APIGuildMemberUser,
GatewayGuildMembersChunkPresence,
APIBaseMessage,
} from '../payloads/v10/index';
import type { ReactionType } from '../rest/v10/index';
import type { _Nullable } from '../utils/internals';
export * from './common';
export type * from './common';
export const GatewayVersion = '10';
@@ -789,9 +797,7 @@ export type GatewayEntitlementModifyDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
*/
export type GatewayEntitlementCreateDispatchData = Omit<GatewayEntitlementModifyDispatchData, 'ends_at'> & {
ends_at: GatewayEntitlementModifyDispatchData['ends_at'] | null;
};
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
@@ -873,7 +879,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
*/
voice_states: Omit<APIVoiceState, 'guild_id'>[];
voice_states: APIBaseVoiceState[];
/**
* Users in the guild
*
@@ -953,7 +959,7 @@ export type GatewayGuildDeleteDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-delete}
*/
export interface GatewayGuildDeleteDispatchData extends Omit<APIUnavailableGuild, 'unavailable'> {
export interface GatewayGuildDeleteDispatchData extends APIBaseGuild {
/**
* `true` if this guild is unavailable due to an outage
*
@@ -1127,15 +1133,18 @@ export type GatewayGuildMemberUpdateDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-update}
*/
export type GatewayGuildMemberUpdateDispatchData = _Nullable<Pick<APIGuildMember, 'joined_at'>> &
Omit<APIGuildMember, 'deaf' | 'flags' | 'joined_at' | 'mute' | 'user'> &
Partial<Pick<APIGuildMember, 'deaf' | 'flags' | 'mute'>> &
Required<Pick<APIGuildMember, 'avatar' | 'banner' | 'user'>> & {
/**
* The id of the guild
*/
guild_id: Snowflake;
};
export interface GatewayGuildMemberUpdateDispatchData
extends _Nullable<APIGuildMemberJoined>,
APIBaseGuildMember,
Partial<APIBaseVoiceGuildMember>,
Partial<APIFlaggedGuildMember>,
Required<APIGuildMemberAvatar>,
Required<APIGuildMemberUser> {
/**
* The id of the guild
*/
guild_id: Snowflake;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
@@ -1145,11 +1154,6 @@ export type GatewayGuildMembersChunkDispatch = _DataPayload<
GatewayGuildMembersChunkDispatchData
>;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
*/
export type GatewayGuildMembersChunkPresence = Omit<RawGatewayPresenceUpdate, 'guild_id'>;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
*/
@@ -1597,7 +1601,7 @@ export type GatewayMessageCreateDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create}
*/
export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
export interface GatewayMessageCreateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage {}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
@@ -1610,7 +1614,24 @@ export type GatewayMessageUpdateDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
*/
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
export interface GatewayMessageUpdateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage {}
export interface APIGuildMemberNoUser
extends APIBaseGuildMember,
APIFlaggedGuildMember,
APIGuildMemberAvatar,
APIGuildMemberJoined,
APIBaseVoiceGuildMember {}
export interface APIUserWithMember extends APIUser {
/**
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
member?: APIGuildMemberNoUser;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create-message-create-extra-fields}
@@ -1628,17 +1649,13 @@ export interface GatewayMessageEventExtraFields {
*
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
member?: Omit<APIGuildMember, 'user'>;
member?: APIGuildMemberNoUser;
/**
* Users specifically mentioned in the message
*
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
mentions: APIUserWithMember[];
}
/**
@@ -1696,25 +1713,74 @@ export interface GatewayMessageDeleteBulkDispatchData {
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
*/
export type GatewayMessageReactionAddDispatch = GatewayMessageReactionData<GatewayDispatchEvents.MessageReactionAdd>;
export interface GatewayMessageReactionAddDispatchData extends GatewayMessageReactionRemoveDispatchData {
/**
* The member who reacted if this happened in a guild
*
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
member?: APIGuildMember;
/**
* The id of the user that posted the message that was reacted to
*/
message_author_id?: Snowflake;
/**
* Colors used for super-reaction animation in "#rrggbb" format
*/
burst_colors?: string[];
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
*/
export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDispatch['d'];
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
*/
export type GatewayMessageReactionRemoveDispatch = GatewayMessageReactionData<
GatewayDispatchEvents.MessageReactionRemove,
'burst_colors' | 'member' | 'message_author_id'
export type GatewayMessageReactionAddDispatch = _DataPayload<
GatewayDispatchEvents.MessageReactionAdd,
GatewayMessageReactionAddDispatchData
>;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
*/
export type GatewayMessageReactionRemoveDispatchData = GatewayMessageReactionRemoveDispatch['d'];
export interface GatewayMessageReactionRemoveDispatchData {
/**
* The id of the user
*/
user_id: Snowflake;
/**
* The id of the channel
*/
channel_id: Snowflake;
/**
* The id of the message
*/
message_id: Snowflake;
/**
* The id of the guild
*/
guild_id?: Snowflake;
/**
* The emoji used to react
*
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
*/
emoji: APIEmoji;
/**
* True if this is a super-reaction
*/
burst: boolean;
/**
* The type of reaction
*/
type: ReactionType;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
*/
export type GatewayMessageReactionRemoveDispatch = _DataPayload<
GatewayDispatchEvents.MessageReactionRemove,
GatewayMessageReactionRemoveDispatchData
>;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all}
@@ -1758,7 +1824,7 @@ export type GatewayPresenceUpdateDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update}
*/
export type GatewayPresenceUpdateDispatchData = RawGatewayPresenceUpdate;
export type GatewayPresenceUpdateDispatchData = GatewayPresenceUpdate;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-create}
@@ -1810,7 +1876,7 @@ export type GatewayThreadListSyncDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-list-sync}
*/
export type GatewayThreadListSyncDispatchData = RawGatewayThreadListSync;
export type GatewayThreadListSyncDispatchData = GatewayThreadListSync;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-members-update}
@@ -2415,7 +2481,7 @@ export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'state' |
// #endregion Sendable Payloads
// #region Shared
export interface _BasePayload {
export interface _BaseBasePayload {
/**
* Opcode for the payload
*/
@@ -2424,6 +2490,9 @@ export interface _BasePayload {
* Event data
*/
d?: unknown;
}
export interface _BasePayload {
/**
* Sequence number, used for resuming sessions and heartbeats
*/
@@ -2434,10 +2503,10 @@ export interface _BasePayload {
t?: string;
}
export type _NonDispatchPayload = Omit<_BasePayload, 's' | 't'> & {
export interface _NonDispatchPayload extends _BaseBasePayload {
t: null;
s: null;
};
}
export interface _DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends _BasePayload {
op: GatewayOpcodes.Dispatch;
@@ -2445,57 +2514,10 @@ export interface _DataPayload<Event extends GatewayDispatchEvents, D = unknown>
d: D;
}
// This is not used internally anymore, just remains to be non-breaking
export type GatewayMessageReactionData<E extends GatewayDispatchEvents, O extends string = never> = _DataPayload<
E,
Omit<
{
/**
* The id of the user
*/
user_id: Snowflake;
/**
* The id of the channel
*/
channel_id: Snowflake;
/**
* The id of the message
*/
message_id: Snowflake;
/**
* The id of the guild
*/
guild_id?: Snowflake;
/**
* The member who reacted if this happened in a guild
*
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
member?: APIGuildMember;
/**
* The emoji used to react
*
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
*/
emoji: APIEmoji;
/**
* The id of the user that posted the message that was reacted to
*/
message_author_id?: Snowflake;
/**
* True if this is a super-reaction
*/
burst: boolean;
/**
* Colors used for super-reaction animation in "#rrggbb" format
*/
burst_colors: string[];
/**
* The type of reaction
*/
type: ReactionType;
},
O
>
Omit<GatewayMessageReactionAddDispatchData, O>
>;
export interface GatewayMessageReactionRemoveData {

View File

@@ -18,7 +18,7 @@ import type {
PresenceUpdateStatus,
} from '../payloads/v6/index';
export * from './common';
export type * from './common';
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
@@ -313,7 +313,6 @@ export type GatewayReadyDispatch = DataPayload<
*/
export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed, never>;
/* eslint-disable @typescript-eslint/indent */
/**
* https://discord.com/developers/docs/topics/gateway#channel-create
* https://discord.com/developers/docs/topics/gateway#channel-update
@@ -325,7 +324,6 @@ export type GatewayChannelModifyDispatch = DataPayload<
GatewayDispatchEvents.ChannelCreate | GatewayDispatchEvents.ChannelDelete | GatewayDispatchEvents.ChannelUpdate,
APIChannel
>;
/* eslint-enable @typescript-eslint/indent */
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.

View File

@@ -26,7 +26,7 @@ import type {
} from '../payloads/v8/index';
import type { _Nullable } from '../utils/internals';
export * from './common';
export type * from './common';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.

View File

@@ -3,7 +3,6 @@
*/
import type { Snowflake } from '../globals';
import type { GatewayPresenceUpdate } from '../payloads/v9/gateway';
import type {
APIApplication,
APIApplicationCommandPermission,
@@ -16,7 +15,6 @@ import type {
APIGuildMember,
APIGuildScheduledEvent,
APIInteraction,
APIMessage,
APIRole,
APIStageInstance,
APISticker,
@@ -25,8 +23,8 @@ import type {
APIUnavailableGuild,
APIUser,
GatewayActivity,
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
GatewayThreadListSync as RawGatewayThreadListSync,
GatewayPresenceUpdate,
GatewayThreadListSync,
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
APIVoiceState,
InviteTargetType,
@@ -39,11 +37,21 @@ import type {
GuildChannelType,
ThreadChannelType,
APIEntitlement,
APIBaseGuild,
APIBaseGuildMember,
APIBaseVoiceState,
APIBaseVoiceGuildMember,
APIFlaggedGuildMember,
APIGuildMemberUser,
APIGuildMemberAvatar,
GatewayGuildMembersChunkPresence,
APIBaseMessage,
APIGuildMemberJoined,
} from '../payloads/v9/index';
import type { ReactionType } from '../rest/v9/index';
import type { _Nullable } from '../utils/internals';
export * from './common';
export type * from './common';
export const GatewayVersion = '9';
@@ -788,9 +796,7 @@ export type GatewayEntitlementModifyDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
*/
export type GatewayEntitlementCreateDispatchData = Omit<GatewayEntitlementModifyDispatchData, 'ends_at'> & {
ends_at: GatewayEntitlementModifyDispatchData['ends_at'] | null;
};
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
@@ -872,7 +878,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
*/
voice_states: Omit<APIVoiceState, 'guild_id'>[];
voice_states: APIBaseVoiceState[];
/**
* Users in the guild
*
@@ -952,7 +958,7 @@ export type GatewayGuildDeleteDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-delete}
*/
export interface GatewayGuildDeleteDispatchData extends Omit<APIUnavailableGuild, 'unavailable'> {
export interface GatewayGuildDeleteDispatchData extends APIBaseGuild {
/**
* `true` if this guild is unavailable due to an outage
*
@@ -1126,15 +1132,18 @@ export type GatewayGuildMemberUpdateDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-update}
*/
export type GatewayGuildMemberUpdateDispatchData = _Nullable<Pick<APIGuildMember, 'joined_at'>> &
Omit<APIGuildMember, 'deaf' | 'flags' | 'joined_at' | 'mute' | 'user'> &
Partial<Pick<APIGuildMember, 'deaf' | 'flags' | 'mute'>> &
Required<Pick<APIGuildMember, 'avatar' | 'banner' | 'user'>> & {
/**
* The id of the guild
*/
guild_id: Snowflake;
};
export interface GatewayGuildMemberUpdateDispatchData
extends _Nullable<APIGuildMemberJoined>,
APIBaseGuildMember,
Partial<APIBaseVoiceGuildMember>,
Partial<APIFlaggedGuildMember>,
Required<APIGuildMemberUser>,
Required<APIGuildMemberAvatar> {
/**
* The id of the guild
*/
guild_id: Snowflake;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
@@ -1144,11 +1153,6 @@ export type GatewayGuildMembersChunkDispatch = _DataPayload<
GatewayGuildMembersChunkDispatchData
>;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
*/
export type GatewayGuildMembersChunkPresence = Omit<RawGatewayPresenceUpdate, 'guild_id'>;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
*/
@@ -1596,7 +1600,7 @@ export type GatewayMessageCreateDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create}
*/
export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
export interface GatewayMessageCreateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage {}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
@@ -1609,7 +1613,24 @@ export type GatewayMessageUpdateDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
*/
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
export interface GatewayMessageUpdateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage {}
export interface APIGuildMemberNoUser
extends APIBaseGuildMember,
APIFlaggedGuildMember,
APIGuildMemberAvatar,
APIGuildMemberJoined,
APIBaseVoiceGuildMember {}
export interface APIUserWithMember extends APIUser {
/**
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
member?: APIGuildMemberNoUser;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create-message-create-extra-fields}
@@ -1627,17 +1648,13 @@ export interface GatewayMessageEventExtraFields {
*
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
member?: Omit<APIGuildMember, 'user'>;
member?: APIGuildMemberNoUser;
/**
* Users specifically mentioned in the message
*
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
mentions: APIUserWithMember[];
}
/**
@@ -1695,25 +1712,74 @@ export interface GatewayMessageDeleteBulkDispatchData {
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
*/
export type GatewayMessageReactionAddDispatch = GatewayMessageReactionData<GatewayDispatchEvents.MessageReactionAdd>;
export interface GatewayMessageReactionAddDispatchData extends GatewayMessageReactionRemoveDispatchData {
/**
* The member who reacted if this happened in a guild
*
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
member?: APIGuildMember;
/**
* The id of the user that posted the message that was reacted to
*/
message_author_id?: Snowflake;
/**
* Colors used for super-reaction animation in "#rrggbb" format
*/
burst_colors?: string[];
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
*/
export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDispatch['d'];
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
*/
export type GatewayMessageReactionRemoveDispatch = GatewayMessageReactionData<
GatewayDispatchEvents.MessageReactionRemove,
'burst_colors' | 'member' | 'message_author_id'
export type GatewayMessageReactionAddDispatch = _DataPayload<
GatewayDispatchEvents.MessageReactionAdd,
GatewayMessageReactionAddDispatchData
>;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
*/
export type GatewayMessageReactionRemoveDispatchData = GatewayMessageReactionRemoveDispatch['d'];
export interface GatewayMessageReactionRemoveDispatchData {
/**
* The id of the user
*/
user_id: Snowflake;
/**
* The id of the channel
*/
channel_id: Snowflake;
/**
* The id of the message
*/
message_id: Snowflake;
/**
* The id of the guild
*/
guild_id?: Snowflake;
/**
* The emoji used to react
*
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
*/
emoji: APIEmoji;
/**
* True if this is a super-reaction
*/
burst: boolean;
/**
* The type of reaction
*/
type: ReactionType;
}
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
*/
export type GatewayMessageReactionRemoveDispatch = _DataPayload<
GatewayDispatchEvents.MessageReactionRemove,
GatewayMessageReactionRemoveDispatchData
>;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all}
@@ -1757,7 +1823,7 @@ export type GatewayPresenceUpdateDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update}
*/
export type GatewayPresenceUpdateDispatchData = RawGatewayPresenceUpdate;
export type GatewayPresenceUpdateDispatchData = GatewayPresenceUpdate;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-create}
@@ -1809,7 +1875,7 @@ export type GatewayThreadListSyncDispatch = _DataPayload<
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-list-sync}
*/
export type GatewayThreadListSyncDispatchData = RawGatewayThreadListSync;
export type GatewayThreadListSyncDispatchData = GatewayThreadListSync;
/**
* @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-members-update}
@@ -2414,7 +2480,8 @@ export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'state' |
// #endregion Sendable Payloads
// #region Shared
export interface _BasePayload {
export interface _BaseBasePayload {
/**
* Opcode for the payload
*/
@@ -2423,6 +2490,8 @@ export interface _BasePayload {
* Event data
*/
d?: unknown;
}
export interface _BasePayload extends _BaseBasePayload {
/**
* Sequence number, used for resuming sessions and heartbeats
*/
@@ -2433,10 +2502,10 @@ export interface _BasePayload {
t?: string;
}
export type _NonDispatchPayload = Omit<_BasePayload, 's' | 't'> & {
export interface _NonDispatchPayload extends _BaseBasePayload {
t: null;
s: null;
};
}
export interface _DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends _BasePayload {
op: GatewayOpcodes.Dispatch;
@@ -2444,57 +2513,10 @@ export interface _DataPayload<Event extends GatewayDispatchEvents, D = unknown>
d: D;
}
// This is not used internally anymore, just remains to be non-breaking
export type GatewayMessageReactionData<E extends GatewayDispatchEvents, O extends string = never> = _DataPayload<
E,
Omit<
{
/**
* The id of the user
*/
user_id: Snowflake;
/**
* The id of the channel
*/
channel_id: Snowflake;
/**
* The id of the message
*/
message_id: Snowflake;
/**
* The id of the guild
*/
guild_id?: Snowflake;
/**
* The member who reacted if this happened in a guild
*
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
member?: APIGuildMember;
/**
* The emoji used to react
*
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
*/
emoji: APIEmoji;
/**
* The id of the user that posted the message that was reacted to
*/
message_author_id?: Snowflake;
/**
* True if this is a super-reaction
*/
burst: boolean;
/**
* Colors used for super-reaction animation in "#rrggbb" format
*/
burst_colors?: string[];
/**
* The type of reaction
*/
type: ReactionType;
},
O
>
Omit<GatewayMessageReactionAddDispatchData, O>
>;
export interface GatewayMessageReactionRemoveData {

View File

@@ -52,7 +52,6 @@ export const FormattingPatterns = {
* The `fullName` (possibly including `name`, `subcommandOrGroup` and `subcommand`) and `id` group properties are present on the `exec` result of this expression
*/
SlashCommand:
// eslint-disable-next-line unicorn/no-unsafe-regex
/<\/(?<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

17093
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "discord-api-types",
"version": "0.38.7",
"version": "0.38.19",
"description": "Discord API typings that are kept up to date for use in bot library creation.",
"homepage": "https://discord-api-types.dev",
"workspaces": [
@@ -96,12 +96,13 @@
"scripts": {
"build:ci": "tsc --noEmit --incremental false",
"build:deno": "node ./scripts/deno.mjs",
"build:node": "tsc && run-p esm:*",
"build:generated": "tsx ./scripts/generate-prettier-routes-interface.ts",
"build:node": "yarn build:generated && 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:*",
"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",
@@ -110,11 +111,11 @@
"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\"",
"lint": "prettier --write . && eslint --format=pretty --fix --ext mjs,ts \"{gateway,payloads,rest,rpc,voice,utils}/**/*.ts\" \"{globals,v*}.ts\" \"scripts/**/*.mjs\"",
"postinstallDev": "is-ci || husky",
"prepack": "run-s clean test:lint build:node",
"postpack": "run-s clean:node build:deno && git checkout -- './deno/**/*.ts' './rest/**/*.ts'",
"test:lint": "prettier --check . && eslint --format=pretty --ext mjs,ts \"{gateway,payloads,rest,rpc,voice,utils}/**/*.ts\" \"{globals,v*}.ts\" \"scripts/**/*.mjs\"",
"test:types": "tsc -p tests"
},
"keywords": [
@@ -126,39 +127,46 @@
"author": "Vlad Frangu <me@vladfrangu.dev>",
"license": "MIT",
"files": [
"_generated_/**/*.{js,js.map,d.ts,d.ts.map,mjs}",
"{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",
"@commitlint/cli": "^19.8.1",
"@commitlint/config-angular": "^19.8.1",
"@favware/npm-deprecate": "^2.0.0",
"@octokit/action": "^7.0.0",
"@octokit/webhooks-types": "^7.3.2",
"@octokit/action": "^8.0.2",
"@octokit/webhooks-types": "^7.6.1",
"@sapphire/prettier-config": "^2.0.0",
"@types/conventional-recommended-bump": "^9.0.3",
"@types/node": "^22.0.0",
"@typescript-eslint/utils": "^8.0.0",
"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": "^6.0.0",
"@types/lodash.merge": "^4",
"@types/node": "^22.15.29",
"@typescript-eslint/utils": "^8.33.0",
"conventional-changelog": "^7.0.2",
"conventional-changelog-angular": "^8.0.0",
"conventional-recommended-bump": "^11.1.0",
"eslint": "^9.28.0",
"eslint-config-neon": "^0.2.7",
"eslint-formatter-pretty": "^6.0.1",
"eslint-import-resolver-typescript": "^4.4.2",
"gen-esm-wrapper": "^1.1.3",
"husky": "^9.0.11",
"is-ci": "^4.0.0",
"lint-staged": "^15.2.2",
"npm-run-all2": "^8.0.0",
"prettier": "^3.2.5",
"pretty-quick": "^4.0.0",
"rimraf": "^6.0.0",
"husky": "^9.1.7",
"is-ci": "^4.1.0",
"lint-staged": "^16.1.0",
"lodash.merge": "^4.6.2",
"npm-run-all2": "^8.0.4",
"prettier": "^3.5.3",
"pretty-quick": "^4.1.1",
"rimraf": "^6.0.1",
"ts-morph": "^26.0.0",
"tsutils": "^3.21.0",
"tsx": "^4.19.4",
"typescript": "^5.6.3"
"tsx": "^4.20.3",
"typescript": "^5.8.3",
"typescript-eslint": "^8.33.0"
},
"publishConfig": {
"provenance": true
"provenance": true,
"access": "public",
"registry": "https://registry.npmjs.org"
},
"repository": {
"type": "git",
@@ -198,5 +206,10 @@
"pascal-case"
]
}
},
"packageManager": "yarn@4.9.2",
"volta": {
"node": "24.5.0",
"yarn": "4.9.2"
}
}

View File

@@ -17,7 +17,7 @@ export const PermissionFlagsBits = {
/**
* Allows kicking members
*/
// eslint-disable-next-line sonarjs/no-identical-expressions
KickMembers: 1n << 1n,
/**
* Allows banning members

View File

@@ -5,7 +5,7 @@ import type { ApplicationCommandOptionType } from './shared';
export interface APIApplicationCommandChannelOption
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Channel> {
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM | ChannelType.GuildDirectory>[];
}
export type APIApplicationCommandInteractionDataChannelOption = APIInteractionDataOptionBase<

View File

@@ -47,19 +47,19 @@ import type {
} from './_chatInput/user';
import type { APIBaseApplicationCommandInteractionData } from './internals';
export * from './_chatInput/attachment';
export * from './_chatInput/base';
export * from './_chatInput/boolean';
export * from './_chatInput/channel';
export * from './_chatInput/integer';
export * from './_chatInput/mentionable';
export * from './_chatInput/number';
export * from './_chatInput/role';
export type * from './_chatInput/attachment';
export type * from './_chatInput/base';
export type * from './_chatInput/boolean';
export type * from './_chatInput/channel';
export type * from './_chatInput/integer';
export type * from './_chatInput/mentionable';
export type * from './_chatInput/number';
export type * from './_chatInput/role';
export * from './_chatInput/shared';
export * from './_chatInput/string';
export * from './_chatInput/subcommand';
export * from './_chatInput/subcommandGroup';
export * from './_chatInput/user';
export type * from './_chatInput/string';
export type * from './_chatInput/subcommand';
export type * from './_chatInput/subcommandGroup';
export type * from './_chatInput/user';
/**
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure}

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