1 less nested if

This commit is contained in:
Skillz
2021-05-01 10:18:52 -04:00
parent 1637ca84b2
commit a3d2cddd8c

View File

@@ -109,11 +109,9 @@ export async function sendMessage(
throw new Error(Errors.LINK_BUTTON_CANNOT_HAVE_CUSTOM_ID);
}
if (
!component.customId
!component.customId && component.type !== ButtonStyles.Link
) {
if (component.type !== ButtonStyles.Link) {
throw new Error(Errors.BUTTON_REQUIRES_CUSTOM_ID);
}
throw new Error(Errors.BUTTON_REQUIRES_CUSTOM_ID);
}
if (!validateLength(component.label, { max: 80 })) {