From 304a61c786eda8067e5bd39db23d7ac616c4d67f Mon Sep 17 00:00:00 2001 From: Fleny Date: Wed, 7 Aug 2024 08:20:50 +0200 Subject: [PATCH] Add the propriety if it has _ to the object (#3828) --- packages/rest/src/manager.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/rest/src/manager.ts b/packages/rest/src/manager.ts index a4bd2b1f8..b85a65f50 100644 --- a/packages/rest/src/manager.ts +++ b/packages/rest/src/manager.ts @@ -194,11 +194,14 @@ export function createRestManager(options: CreateRestManagerOptions): RestManage const newObj: any = {} for (const key of Object.keys(obj)) { - // If the key is already in snake_case we have no reason for the rest of the code to run. - if (key.includes('_')) continue - const value = obj[key] + // If the key is already in snake_case we can assume it is already in the discord format. + if (key.includes('_')) { + newObj[key] = value + continue + } + // Some falsy values should be allowed like null or 0 if (value !== undefined) { switch (key) {