Remove delay parameter, change argument handling, make help command show proper flag types
This commit is contained in:
parent
28f0245652
commit
6b34cb9d9e
63 changed files with 82 additions and 219 deletions
|
@ -2,7 +2,7 @@ import Command from "../../classes/command.js";
|
|||
|
||||
class DiceCommand extends Command {
|
||||
async run() {
|
||||
const max = this.type === "classic" ? parseInt(this.args[0]) : this.options.max;
|
||||
const max = this.options.max ?? parseInt(this.args[0]);
|
||||
if (!max) {
|
||||
return `🎲 The dice landed on ${Math.floor(Math.random() * 6) + 1}.`;
|
||||
} else {
|
||||
|
|
|
@ -3,7 +3,7 @@ import ImageCommand from "../../classes/imageCommand.js";
|
|||
class HomebrewCommand extends ImageCommand {
|
||||
params() {
|
||||
return {
|
||||
caption: (this.type === "classic" ? this.args.join(" ") : this.options.text).toLowerCase().replaceAll("\n", " ")
|
||||
caption: (this.options.text ?? this.args.join(" ")).toLowerCase().replaceAll("\n", " ")
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import ImageCommand from "../../classes/imageCommand.js";
|
|||
|
||||
class SonicCommand extends ImageCommand {
|
||||
params() {
|
||||
const cleanedMessage = (this.type === "classic" ? this.args.join(" ") : this.options.text).replaceAll("&", "\\&").replaceAll(">", "\\>").replaceAll("<", "\\<").replaceAll("\"", "\\"").replaceAll("'", "\\'").replaceAll("%", "\\%");
|
||||
const cleanedMessage = (this.options.text ?? this.args.join(" ")).replaceAll("&", "\\&").replaceAll(">", "\\>").replaceAll("<", "\\<").replaceAll("\"", "\\"").replaceAll("'", "\\'").replaceAll("%", "\\%");
|
||||
return {
|
||||
text: cleanedMessage
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue