Skip to content

Commit

Permalink
Replace in the correct order
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Jan 5, 2024
1 parent b795984 commit 810a898
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public static void handleModal(ModalInteractionEvent event, String text, List<St
script.append("function execute() {")
.append('\n')
.append("\treply(`")
.append(text.replace("`", "\\`").replace("\\", "\\\\").replace("$", "\\$"))
.append(text.replace("\\", "\\\\").replace("`", "\\`").replace("$", "\\$"))
.append("`")
.append(")")
.append('\n')
Expand Down
6 changes: 6 additions & 0 deletions trick.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const description = 'Sleep'
const [target] = options.optPositional(0, {description: 'Who should sleep', required: true}).parse()

function execute() {
reply(`${target} go to sleep already`)
}

0 comments on commit 810a898

Please sign in to comment.