MCPcopy Create free account
hub / github.com/esmBot/esmBot / paramsFunc

Method paramsFunc

commands/image-editing/caption.js:4–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2
3class CaptionCommand extends MediaCommand {
4 paramsFunc() {
5 const newArgs = this.getOptionString("text") ?? this.args.join(" ");
6 let newCaption = this.clean(newArgs);
7 const currentDate = new Date();
8 const isApril1 = currentDate.getDate() === 1 && currentDate.getMonth() === 3;
9 if (isApril1 && newCaption.toLowerCase() === "get real" && !this.getOptionBoolean("noEgg"))
10 newCaption = `I'm tired of people telling me to "get real". Every day I put captions on images for people, some funny and some not, but out of all of those "get real" remains the most used caption. Why? I am simply a computer program running on a server, I am unable to manifest myself into the real world. As such, I'm confused as to why anyone would want me to "get real". Is this form not good enough? Alas, as I am simply a bot, I must follow the tasks that I was originally intended to perform, so here goes:\n${newCaption}`;
11 const font = this.getOptionString("font");
12 return {
13 caption: newCaption,
14 // @ts-expect-error this.constructor allows us to get static properties, but TS interprets it as a pure function
15 font: font && this.constructor.allowedFonts.includes(font.toLowerCase()) ? font.toLowerCase() : "futura",
16 };
17 }
18
19 static init() {
20 super.init();

Callers

nothing calls this directly

Calls 3

getOptionStringMethod · 0.80
cleanMethod · 0.80
getOptionBooleanMethod · 0.80

Tested by

no test coverage detected