seedcord 0.8.1 → 0.9.0

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.cjs CHANGED
@@ -1738,8 +1738,10 @@ function Checkable(ctor) {
1738
1738
  };
1739
1739
  }
1740
1740
  __name(Checkable, "Checkable");
1741
- function EventCatchable(log) {
1741
+ function EventCatchable(options) {
1742
1742
  return function(_target, _prop, descriptor) {
1743
+ const log = options?.log ?? false;
1744
+ const silent = options?.silent ?? false;
1743
1745
  const original = descriptor.value;
1744
1746
  descriptor.value = async function(...args) {
1745
1747
  if (!original) throw new services.SeedcordError(services.SeedcordErrorCode.DecoratorMethodNotFound);
@@ -1749,6 +1751,10 @@ function EventCatchable(log) {
1749
1751
  if (!(err instanceof Error)) throw err;
1750
1752
  this.setErrored();
1751
1753
  if (log) console.error(err);
1754
+ if (typeof silent === "boolean" && silent) return;
1755
+ if (typeof silent !== "boolean" && silent.some((errorType) => err instanceof errorType)) {
1756
+ return;
1757
+ }
1752
1758
  const eventArgs = Array.isArray(this.getEvent()) ? this.getEvent() : [
1753
1759
  this.getEvent()
1754
1760
  ];