mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix(rest): only calculate bits if not undefined (#3000)
This commit is contained in:
@@ -119,12 +119,12 @@ export function createRestManager(options: CreateRestManagerOptions): RestManage
|
|||||||
|
|
||||||
for (const key of Object.keys(obj)) {
|
for (const key of Object.keys(obj)) {
|
||||||
// Keys that dont require snake casing
|
// Keys that dont require snake casing
|
||||||
if (['permissions', 'allow', 'deny'].includes(key)) {
|
if (['permissions', 'allow', 'deny'].includes(key) && obj[key] !== undefined) {
|
||||||
newObj[key] = calculateBits(obj[key])
|
newObj[key] = calculateBits(obj[key])
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key === 'defaultMemberPermissions') {
|
if (key === 'defaultMemberPermissions' && obj[key] !== undefined) {
|
||||||
newObj.default_member_permissions = calculateBits(obj[key])
|
newObj.default_member_permissions = calculateBits(obj[key])
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user