@tixyel/streamelements 7.9.0 → 7.10.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.d.ts CHANGED
@@ -1711,7 +1711,7 @@ interface CommandOptions {
1711
1711
  description?: string;
1712
1712
  arguments?: boolean;
1713
1713
  run: (this: Client, args: string[], event: CommandEvent) => void;
1714
- test?: string;
1714
+ test?: RegExp | ((command: string) => boolean);
1715
1715
  aliases?: string[];
1716
1716
  permissions?: string[] | boolean;
1717
1717
  admins?: string[];
@@ -1731,7 +1731,7 @@ declare class Command {
1731
1731
  name: string;
1732
1732
  description: string;
1733
1733
  arguments: boolean;
1734
- test: string | (() => string);
1734
+ test: RegExp | ((command: string) => boolean);
1735
1735
  aliases: string[];
1736
1736
  permissions?: string[] | boolean;
1737
1737
  admins: string[];
@@ -3113,7 +3113,7 @@ declare class UtilsHelper {
3113
3113
  userId: string;
3114
3114
  name: string;
3115
3115
  broadcasterId?: string;
3116
- }, session: StreamElements.Session.Data, checkWithAPI?: boolean): Promise<3 | 1 | 2>;
3116
+ }, session: StreamElements.Session.Data, checkWithAPI?: boolean): Promise<1 | 2 | 3>;
3117
3117
  /**
3118
3118
  * Identifies a user based on the received event and session data, returning their ID, name, role, badges, and top status.
3119
3119
  * @param receivedEvent - The event received from the provider (Twitch or YouTube) containing user information.
package/dist/index.es.js CHANGED
@@ -10622,7 +10622,7 @@ var oe = class e {
10622
10622
  }
10623
10623
  }, V = class e {
10624
10624
  constructor(e) {
10625
- this.prefix = "!", this.arguments = !1, this.test = `${this.prefix}${this.name} arg1 arg2`, this.aliases = [], this.permissions = void 0, this.admins = [], this.prefix = e.prefix ?? this.prefix, this.name = e.name, this.description = e.description ?? this.description, this.arguments = e.arguments ?? this.arguments, this.run = e.run, this.test = e.test ?? this.test, this.aliases = e.aliases ?? this.aliases, this.permissions = e.permissions ?? this.permissions, this.admins = e.admins ?? this.admins, I.push(this), N.length && N.forEach((e) => {
10625
+ this.prefix = "!", this.arguments = !1, this.test = () => !0, this.aliases = [], this.permissions = void 0, this.admins = [], this.prefix = e.prefix ?? this.prefix, this.name = e.name, this.description = e.description ?? this.description, this.arguments = e.arguments ?? this.arguments, this.run = e.run, this.test = e.test ?? this.test, this.aliases = e.aliases ?? this.aliases, this.permissions = e.permissions ?? this.permissions, this.admins = e.admins ?? this.admins, I.push(this), N.length && N.forEach((e) => {
10626
10626
  e.actions.commands.push(this), e.emit("action", this, "created");
10627
10627
  });
10628
10628
  }
@@ -10637,6 +10637,7 @@ var oe = class e {
10637
10637
  bits: "cheer",
10638
10638
  premium: "prime"
10639
10639
  };
10640
+ if (this.test instanceof RegExp && !this.test.test(e) || typeof this.test == "function" && !this.test(e)) return !1;
10640
10641
  switch (t.provider) {
10641
10642
  case "twitch": {
10642
10643
  let e = t.data;