Skip to content

Commit

Permalink
fix: make the plugin work on NodeBB v3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
oplik0 committed Aug 25, 2023
1 parent a4b5a35 commit 1ae428a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function createText(total, rolls, diceUsed, notation) {
);
}
}
const text = `[[dice:roll-many-dice-0]] ${total} [[dice:roll-many-dice-1]] ${diceString} [[dice:roll-many-dice-2]] ${
const text = `[[dice:roll-many-dice-0]] ${total} [[dice:roll-many-dice-1]] ${diceString}[[dice:roll-many-dice-2]] ${
escapeHTML(
notation,
)
Expand Down Expand Up @@ -235,7 +235,7 @@ async function parseCommands(post) {

async function parseChatCommands(message) {
const results = [];
const commands = message.cleanedContent.matchAll(/^\s*\/roll([^#\n]+)(#[^\n]*)?$/gim);
const commands = message.content.matchAll(/^\s*\/roll([^#\n]+)(#[^\n]*)?$/gim);
for (let [, notation] of commands) {
notation = notation
.replaceAll(/\s/gm, () => '')
Expand Down

0 comments on commit 1ae428a

Please sign in to comment.