()
| 26 | |
| 27 | class CaptionTwoCommand extends MediaCommand { |
| 28 | paramsFunc() { |
| 29 | const newArgs = this.getOptionString("text") ?? this.args.join(" "); |
| 30 | const font = this.getOptionString("font"); |
| 31 | return { |
| 32 | caption: newArgs?.trim() |
| 33 | ? this.clean(newArgs) |
| 34 | : words |
| 35 | .sort(() => 0.5 - Math.random()) |
| 36 | .slice(0, Math.floor(Math.random() * words.length + 1)) |
| 37 | .join(" "), |
| 38 | top: !!this.getOptionBoolean("top"), |
| 39 | // @ts-expect-error this.constructor allows us to get static properties, but TS interprets it as a pure function |
| 40 | font: font && this.constructor.allowedFonts.includes(font.toLowerCase()) ? font.toLowerCase() : "helvetica", |
| 41 | }; |
| 42 | } |
| 43 | |
| 44 | static init() { |
| 45 | super.init(); |
nothing calls this directly
no test coverage detected