mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 00:10:07 +00:00
* (transformers) return as Optionalize<typeof> * fix check error Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
20 lines
660 B
TypeScript
20 lines
660 B
TypeScript
import { DiscordGetGatewayBot } from "../types/discord.ts";
|
|
import { Optionalize } from "../types/shared.ts";
|
|
|
|
export function transformGatewayBot(payload: DiscordGetGatewayBot) {
|
|
const gatewayBot = {
|
|
url: payload.url,
|
|
shards: payload.shards,
|
|
sessionStartLimit: {
|
|
total: payload.session_start_limit.total,
|
|
remaining: payload.session_start_limit.remaining,
|
|
resetAfter: payload.session_start_limit.reset_after,
|
|
maxConcurrency: payload.session_start_limit.max_concurrency,
|
|
},
|
|
};
|
|
|
|
return gatewayBot as Optionalize<typeof gatewayBot>;
|
|
}
|
|
|
|
export interface GetGatewayBot extends ReturnType<typeof transformGatewayBot> {}
|