UNPKG

@sapphire/plugin-pattern-commands

Version:

Plugin for @sapphire/framework that adds support for pattern commands.

35 lines (32 loc) 1.28 kB
'use strict'; var framework = require('@sapphire/framework'); var __defProp = Object.defineProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); var _PatternCommand = class _PatternCommand extends framework.Command { constructor(context, options) { super(context, options); __publicField(this, "chance"); __publicField(this, "weight"); __publicField(this, "matchFullName"); this.chance = options.chance ?? 100; if (options.weight) { if (options.weight < 0) { this.weight = 0; } else if (options.weight > 10) { this.weight = 10; } else { this.weight = options.weight; } } else { this.weight = 5; } this.matchFullName = options.matchFullName ?? false; } }; __name(_PatternCommand, "PatternCommand"); var PatternCommand = _PatternCommand; exports.PatternCommand = PatternCommand; //# sourceMappingURL=PatternCommand.cjs.map //# sourceMappingURL=PatternCommand.cjs.map