fix(rest): proxy cumulative routes

This commit is contained in:
socram03 2023-06-05 05:01:57 +00:00
parent dbc5922ffb
commit 0436a4b162
4 changed files with 15 additions and 19 deletions

View File

@ -1,3 +1,3 @@
export * from "./slash/SlashCommand";
export * from "./slash/SlashCommandOption";
export * from "./contextMenu/ContextCommand";
export * from './slash/SlashCommand';
export * from './slash/SlashCommandOption';
export * from './contextMenu/ContextCommand';

View File

@ -1,5 +1,5 @@
export * from "./ActionRow";
export * from "./MessageButton";
export * from "./SelectMenu";
export * from "./TextInput";
export * from "./BaseComponent";
export * from './ActionRow';
export * from './MessageButton';
export * from './SelectMenu';
export * from './TextInput';
export * from './BaseComponent';

View File

@ -25,12 +25,10 @@ export class Router {
if (ArrRequestsMethods.includes(key)) {
return (...options: any[]) => this.rest[key](`/${route.join('/')}`, ...options);
}
route.push(key);
return this.createProxy(route);
return this.createProxy([...route, key]);
},
apply: (...[, _, args]) => {
route.push(...args.filter((x) => x != null));
return this.createProxy(route);
return this.createProxy([...route, ...args.filter((x) => x != null)]);
}
}) as unknown as Routes;
}
@ -48,7 +46,7 @@ export class CDN {
const lastRoute = `${CDN_URL}/${route.join('/')}`;
if (value) {
if (typeof value !== 'string') {
// rome-ignore lint/style/noParameterAssign: ?!
// rome-ignore lint/nursery/noParameterAssign: fix multiples value types
value = String(value);
}
return `${lastRoute}/${value}`;
@ -56,12 +54,10 @@ export class CDN {
return lastRoute;
};
}
route.push(key);
return this.createProxy(route);
return this.createProxy([...route, key]);
},
apply: (...[, _, args]) => {
route.push(...args.filter((x) => x != null));
return this.createProxy(route);
return this.createProxy([...route, ...args.filter((x) => x != null)]);
}
}) as unknown as CDNRoutes;
}

View File

@ -576,8 +576,8 @@ export class Shard {
}
/** This function communicates with the management process, in order to know whether its free to identify. When this function resolves, this means that the shard is allowed to send an identify payload to discord. */
async requestIdentify(): Promise<void> { }
async requestIdentify(): Promise<void> {}
/** This function communicates with the management process, in order to tell it can identify the next shard. */
async shardIsReady(): Promise<void> { }
async shardIsReady(): Promise<void> {}
}