From 987aac92417fd8aaf2cd53bb326f157807f86c50 Mon Sep 17 00:00:00 2001 From: Synbulat Biishev Date: Thu, 8 Jun 2023 19:25:42 +0300 Subject: [PATCH] feat: change the param type to `Snowflake` --- packages/rest/src/lib/utils/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rest/src/lib/utils/utils.ts b/packages/rest/src/lib/utils/utils.ts index ee8832921790..07d63e542d86 100644 --- a/packages/rest/src/lib/utils/utils.ts +++ b/packages/rest/src/lib/utils/utils.ts @@ -1,5 +1,5 @@ import { URLSearchParams } from 'node:url'; -import type { RESTPatchAPIChannelJSONBody } from 'discord-api-types/v10'; +import type { RESTPatchAPIChannelJSONBody, Snowflake } from 'discord-api-types/v10'; import type { RateLimitData, ResponseLike } from '../REST.js'; import { type RequestManager, RequestMethod } from '../RequestManager.js'; import { RateLimitError } from '../errors/RateLimitError.js'; @@ -118,6 +118,6 @@ export async function onRateLimit(manager: RequestManager, rateLimitData: RateLi * * @param userId - The user id to calculate the default avatar index for */ -export function calculateUserDefaultAvatarIndex(userId: string) { +export function calculateUserDefaultAvatarIndex(userId: Snowflake) { return Number(BigInt(userId) >> 22n) % 6; }