Added more command flags, start documenting command flags, removed args argument from params function
This commit is contained in:
parent
e414d31b52
commit
d03967212e
24 changed files with 240 additions and 205 deletions
|
@ -1,9 +1,9 @@
|
|||
const ImageCommand = require("../../classes/imageCommand.js");
|
||||
|
||||
class HomebrewCommand extends ImageCommand {
|
||||
params(args) {
|
||||
params() {
|
||||
return {
|
||||
caption: args.join(" ").toLowerCase().replaceAll("\n", " ")
|
||||
caption: this.args.join(" ").toLowerCase().replaceAll("\n", " ")
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ const wrap = require("../../utils/wrap.js");
|
|||
const ImageCommand = require("../../classes/imageCommand.js");
|
||||
|
||||
class RetroCommand extends ImageCommand {
|
||||
params(args) {
|
||||
let [line1, line2, line3] = args.join(" ").replaceAll("&", "\\&").replaceAll(">", "\\>").replaceAll("<", "\\<").replaceAll("\"", "\\"").replaceAll("'", "\\'").replaceAll("%", "\\%").split(",").map(elem => elem.trim());
|
||||
params() {
|
||||
let [line1, line2, line3] = this.args.join(" ").replaceAll("&", "\\&").replaceAll(">", "\\>").replaceAll("<", "\\<").replaceAll("\"", "\\"").replaceAll("'", "\\'").replaceAll("%", "\\%").split(",").map(elem => elem.trim());
|
||||
if (!line2 && line1.length > 15) {
|
||||
const [split1, split2, split3] = wrap(line1, { width: 15, indent: "" }).split("\n");
|
||||
line1 = split1;
|
||||
|
|
|
@ -2,8 +2,8 @@ const wrap = require("../../utils/wrap.js");
|
|||
const ImageCommand = require("../../classes/imageCommand.js");
|
||||
|
||||
class SonicCommand extends ImageCommand {
|
||||
params(args) {
|
||||
const cleanedMessage = args.join(" ").replaceAll("&", "\\&").replaceAll(">", "\\>").replaceAll("<", "\\<").replaceAll("\"", "\\"").replaceAll("'", "\\'").replaceAll("%", "\\%");
|
||||
params() {
|
||||
const cleanedMessage = this.args.join(" ").replaceAll("&", "\\&").replaceAll(">", "\\>").replaceAll("<", "\\<").replaceAll("\"", "\\"").replaceAll("'", "\\'").replaceAll("%", "\\%");
|
||||
return {
|
||||
text: wrap(cleanedMessage, {width: 15, indent: ""})
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue