From 7b03f3140e84029e456016d87dcaffc0caf2bec7 Mon Sep 17 00:00:00 2001 From: "Ean Milligan (Bastion)" Date: Sat, 9 Jul 2022 17:02:22 -0400 Subject: [PATCH] V2.0.3 - Fix multiline input --- README.md | 2 +- config.example.ts | 2 +- src/commands/roll.ts | 2 +- src/solver/parser.ts | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 703d7fa..c7a6376 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# The Artificer - A Dice Rolling Discord Bot | V2.0.2 - 2022/07/08 +# The Artificer - A Dice Rolling Discord Bot | V2.0.3 - 2022/07/09 [![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-orange.svg)](https://sonarcloud.io/summary/new_code?id=TheArtificer) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=TheArtificer&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=TheArtificer) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=TheArtificer&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=TheArtificer) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=TheArtificer&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=TheArtificer) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=TheArtificer&metric=bugs)](https://sonarcloud.io/summary/new_code?id=TheArtificer) [![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=TheArtificer&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=TheArtificer) [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=TheArtificer&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=TheArtificer) diff --git a/config.example.ts b/config.example.ts index 509b0d5..f13cb3b 100644 --- a/config.example.ts +++ b/config.example.ts @@ -1,6 +1,6 @@ export const config = { 'name': 'The Artificer', // Name of the bot - 'version': '2.0.2', // Version of the bot + 'version': '2.0.3', // Version of the bot 'token': 'the_bot_token', // Discord API Token for this bot 'localtoken': 'local_testing_token', // Discord API Token for a secondary OPTIONAL testing bot, THIS MUST BE DIFFERENT FROM "token" 'prefix': '[[', // Prefix for all commands diff --git a/src/commands/roll.ts b/src/commands/roll.ts index d84c6e0..e04eb97 100644 --- a/src/commands/roll.ts +++ b/src/commands/roll.ts @@ -46,7 +46,7 @@ export const roll = async (message: DiscordenoMessage, args: string[], command: } // Rejoin all of the args and send it into the solver, if solver returns a falsy item, an error object will be substituded in - const rollCmd = `${command} ${args.join(' ')}`; + const rollCmd = message.content.substring(2); queueRoll( { diff --git a/src/solver/parser.ts b/src/solver/parser.ts index a214b9f..71b312e 100644 --- a/src/solver/parser.ts +++ b/src/solver/parser.ts @@ -178,22 +178,22 @@ export const parseRoll = (fullCmd: string, modifiers: RollModifiers): SolvedRoll // If maximiseRoll or nominalRoll are on, mark the output as such, else use default formatting if (modifiers.maxRoll) { - line1 = ` requested the theoretical maximum of: \`${config.prefix}${fullCmd}\``; + line1 = ` requested the theoretical maximum of:\n\`${config.prefix}${fullCmd}\``; line2 = 'Theoretical Maximum Results: '; } else if (modifiers.nominalRoll) { - line1 = ` requested the theoretical nominal of: \`${config.prefix}${fullCmd}\``; + line1 = ` requested the theoretical nominal of:\n\`${config.prefix}${fullCmd}\``; line2 = 'Theoretical Nominal Results: '; } else if (modifiers.order === 'a') { - line1 = ` requested the following rolls to be ordered from least to greatest: \`${config.prefix}${fullCmd}\``; + line1 = ` requested the following rolls to be ordered from least to greatest:\n\`${config.prefix}${fullCmd}\``; line2 = 'Results: '; tempReturnData.sort(compareTotalRolls); } else if (modifiers.order === 'd') { - line1 = ` requested the following rolls to be ordered from greatest to least: \`${config.prefix}${fullCmd}\``; + line1 = ` requested the following rolls to be ordered from greatest to least:\n\`${config.prefix}${fullCmd}\``; line2 = 'Results: '; tempReturnData.sort(compareTotalRolls); tempReturnData.reverse(); } else { - line1 = ` rolled: \`${config.prefix}${fullCmd}\``; + line1 = ` rolled:\n\`${config.prefix}${fullCmd}\``; line2 = 'Results: '; }