mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat: add {add,remove}GroupDMRecipient methods (#11135)
* feat: add `{add,delete}GroupDMRecipient methods`
* fix: requested changes
---------
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
34
packages/core/scripts/check-routes.mjs
Normal file
34
packages/core/scripts/check-routes.mjs
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Routes } from 'discord-api-types/v10';
|
||||
import { glob, readFile } from 'node:fs/promises';
|
||||
|
||||
const usedRoutes = new Set();
|
||||
|
||||
const ignoredRoutes = new Set([
|
||||
// Deprecated
|
||||
'channelPins',
|
||||
'channelPin',
|
||||
'guilds',
|
||||
'guildCurrentMemberNickname',
|
||||
'guildMFA',
|
||||
'nitroStickerPacks',
|
||||
]);
|
||||
|
||||
for await (const file of glob('src/api/*.ts')) {
|
||||
const content = await readFile(file, 'utf-8');
|
||||
|
||||
const routes = content.matchAll(/Routes\.([\w\d_]+)/g);
|
||||
for (const route of routes) {
|
||||
usedRoutes.add(route[1]);
|
||||
}
|
||||
}
|
||||
|
||||
const unusedRoutes = Object.keys(Routes).filter((route) => !usedRoutes.has(route) && !ignoredRoutes.has(route));
|
||||
|
||||
if (unusedRoutes.length > 0) {
|
||||
console.warn('The following routes are not implemented:');
|
||||
for (const route of unusedRoutes) {
|
||||
console.warn(` - ${route}`);
|
||||
}
|
||||
} else {
|
||||
console.log('No missing routes.');
|
||||
}
|
||||
Reference in New Issue
Block a user