interaqt 0.4.7 → 0.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8990,9 +8990,9 @@ class Ae {
8990
8990
  if (!e.some((s) => s.name === i))
8991
8991
  throw new Error(`${i} in payload is not defined in interaction ${this.interaction.name}`);
8992
8992
  for (let i of e) {
8993
- const s = t.payload[i.name];
8994
- if (i.required && !s)
8993
+ if (i.required && !(i.name in t.payload))
8995
8994
  throw O.payloadValidationFailed(i.name, "missing", t.payload);
8995
+ const s = t.payload[i.name];
8996
8996
  if (!s) return;
8997
8997
  if (i.isCollection && !Array.isArray(s))
8998
8998
  throw O.payloadValidationFailed(i.name, "data is not array", s);