Skip to content

Commit 24e9f3c

Browse files
committed
🐛 Fix specific help without example output
1 parent 4354fbe commit 24e9f3c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@totigm/bot-builder",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "This is a library to create bots for different platforms. It handles all the commands stuff behind the scenes, so you can focus on your bot's logic.",
55
"main": "dist/index.js",
66
"bin": "dist/index.js",

src/bot/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ export default abstract class Bot<Client extends EventEmitter = EventEmitter, Bo
8383

8484
const exampleArgs = {
8585
input: example?.input ? `${example.input} ` : "",
86-
output: example.output ? `${this.boldText("->")} ${example.output}` : "",
86+
output: example?.output ? `${this.boldText("->")} ${example.output}` : "",
8787
};
8888

8989
const hasExample = Object.values(exampleArgs).some((value) => value !== "");
9090
return hasExample
91-
? `${this.options.botMessages.help.exampleText}: ${formattedCommand} ${exampleArgs.input}${exampleArgs.output}`
91+
? `\n${this.options.botMessages.help.exampleText}: ${formattedCommand} ${exampleArgs.input}${exampleArgs.output}`
9292
: "";
9393
}
9494

@@ -103,7 +103,7 @@ export default abstract class Bot<Client extends EventEmitter = EventEmitter, Bo
103103
const explanationMessage = this.getExplanationMessage(commandName);
104104
const exampleMessage = this.getExampleMessage(commandName);
105105

106-
return `${explanationMessage}\n${exampleMessage}`;
106+
return `${explanationMessage}${exampleMessage}`;
107107
}
108108

109109
private addHelpCommand() {

0 commit comments

Comments
 (0)