refactor: replace WSCodes, WSEvents, and InviteScopes with discord-api-types equivalent (#7409)

This commit is contained in:
Almeida
2022-02-09 08:17:45 +00:00
committed by GitHub
parent 3d8c77600b
commit cc25455d2c
8 changed files with 48 additions and 268 deletions

View File

@@ -1,10 +1,10 @@
import { readdir, writeFile } from 'node:fs/promises';
import { Constants } from '../src/index.js';
import { GatewayDispatchEvents } from '../src/index.js';
async function writeWebsocketHandlerImports() {
const lines = ["'use strict';\n", 'const handlers = Object.fromEntries(['];
for (const name of Object.keys(Constants.WSEvents)) {
for (const name of Object.values(GatewayDispatchEvents)) {
lines.push(` ['${name}', require('./${name}')],`);
}